Shouting at a box!

So, I finally got my RaspberryPi powered GoogleAIY box to talk nicely to both Google and a Scroll pHAT.

GoogleAIY a RaspberryPi and a Scroll pHAT Overview

I decided to find it a permanent home, but it was in pieces.

So I thought that I’d put it all together.

In a gorgeous blue Perspex cube.

All the bits

All of the requisite bits to put together a GoogleAIY kit. A GoogleAIY Voice HAT, a RaspberryPi, a full pHAT, a multicoloured GPIO cable, a ScrollPHAT, a laser cut perspex cube in pieces and various nuts and bolts. All The Pieces

The full pHAT board and headers

I soldered a female header in the middle of the full pHAT board so that the GPIO cable can fit relatively flush to the surface of the PCB.

I know I could have put the female end of the GPIO cable to a male header but my Scroll pHAT had already been soldered with male headers.

I’m not sure if this will create any future problems but I guess I’m going to find out.

More RaspberryPi bits, partially assembled; a full pHAT board that allows for two headers to be attached to a RaspberryPi, GPIO cable, ScrollpHAT and the GoogleAIY Voice HAT. Full pHAT Board Headers

Extending the headers

There was a few millimeters of space short between the boards so I had to extend the headers and standoffs.

Because I only had a header with extra long pins I had to pad the top of each standoff with a bolt to meet the bottom of the GoogleAIY board.

(The GoogleAIY board is the ‘VoiceHAT’ board in the top right and is yet to be place on top of the full pHAT board.)

The full pHAT and multicoloured GPIO cable connected on top of the RaspberryPi. The ScrollPHAT is to one side awaiting connection to the GoogleAIY kit. Extending The Headers And GPIO Cable

A RaspberryPi, a GoogleAIY Board and Scroll pHAT all connected

If you look closely you can see the gap between the top of the standoffs and the bottom of the top ‘VoiceHAT’ board.

I could have trimmed all of the header pins by a bit but didn’t want the extra hassle.

I’m sure it’ll all be fine.

The full pHAT and multicoloured GPIO cable connected on top of the RaspberryPi with the ScrollPHAT on the end of the cable. The GoogleAIY Voice Hat sits on top of the stack. Voice HAT And Scroll pHAT

A RaspberryPi nestling under a GoogleAIY VoiceHAT talking to a Scroll pHAT

A side view of the assembled boards before squeezing them into the case.

There is quite a collection of boards being stacked atop each other but it all seems stable enough.

A side view of the full pHAT, multicoloured GPIO, the RaspberryPi and the ScrollPHAT on the end of the cable. The GoogleAIY Voice Hat sits on top of the stack. The headers that seperate the boards are visible from this angle. Bridging The Gap Between Headers

Testing the RaspberryPi and GoogleAIY VoiceHAT

To make sure that both the AIY and Scroll pHAT processes were working, the whole thing has been powered up and is connected to the network via WiFi.

VNC is running on the laptop so I can see the GoogleAIY desktop.

(There is a handy shortcut to ‘check_audio.py’ file on the desktop.)

The result: I get to hear and respond to the Google voice prompts and can check both the microphone input and speaker output.

The whole thing wired up to a speaker to test the sound. The ScrollPHAT hangs loose to the side. Testing Testing

Will it all fit?

There’s not a lot of room in there especially as the LED button has to be squeezed in as well.

But I’m sure it will all fit.

The whole thing wired up to a speaker to and being fitted into the case. It’s a squeeze. The ScrollPHAT hangs over the edge of the Perspex case. Will It All Fit?

A longer Scroll pHAT cable?

The Hat isn’t sitting quite where I want it to, so it’s time to disassemble and fit a longer GPIO cable.

It was all a bit of a squeeze and of course I managed to ding one of the acrylic clips.

(The people at ModMyPi sent me a replacement FOC, which was really kind of them.)

It doesn’t all fit. A longer GPIO cable to enable to ScrollPHAT to be in the correct position is needed. Longer Cable Needed

Finally, my RaspberryPi GoogleAIY box talking to both Google and a Scroll pHAT and blinking away!

And here is the finished article running the test-all.py script.

It works. The blue square perspex cube has a blue flashing LED button meaning that GoogleAIY is actively listening for commands and the blue ScrollPHAT LED display is getting ready to show the time. Finished !

The Scroll pHAT code

At the moment I’m running a very simple clock script but in the future maybe I could run some animations ?

#!/usr/bin/env python

import sys
import time

import scrollphat

brightness = scrollphat.set_brightness(5)

while True:
    try:
        scrollphat.write_string(time.strftime("%H:%M     "))
        scrollphat.scroll(1)
        time.sleep(0.5)

    except KeyboardInterrupt:
        scrollphat.clear()
        sys.exit(-1)

Also, all of the Scroll pHAT code examples can also be found on Forgejo .

Update to ‘GoogleAIY a RaspberryPi and a Scroll pHAT’ : May 2023

This has now been running for 7 years flawlessly.

The only things I have ever done are to re-flash it once for a Debian update (to Buster).

Then update the software occasionally with an apt-get update

However there are a couple of things that I’ll tinker around with eventually:

  • Turn off the flashing blue light whilst it is in listening mode, it get very annoying
  • Somehow activate a playlist, the speaker seems as if it would cope OK-ish with basic audio out