Play YouTube tracks from your Google AIY / Raspberry Pi box

Those of us who were lucky enough to get hold of the new issue of The MagPi, with the AIY project give-away, have been beavering away over the weekend trying to get our cardboard boxes to understand a word we’re saying, with differing levels of success. I, myself, had great fun and reviewed the project hereThe Pi Hut recently tweeted that they were ordering another pallet of the issue and kit!

Mike Redrobe has written an excellent post on the Raspberry Pi forum in which he installs some additional software on the Raspberry Pi and then extends the voice-recognizer Python script that AIY uses. Once the AIY service is restarted, you can command the AIY box to “play <track name>” and it will go and find the track on YouTube and play the audio through the speaker. Ingenious! Take a look at how to do it here.

Prepare your Raspberry Pi’s SD card for network and ssh operation, headlessly

Taron Foxworth over at Losant has done a great, short tutorial on preparing a Pi Zero W (or any Raspberry Pi with wifi capability, be it built-in or dongle, for that matter) for wifi connectivity and enabling ssh headlessly. This means that you don’t need a monitor for the Pi to be able to connect to it – you simply put a couple of files onto the SD card from your Windows/Mac machine and you’re done – it will connect to your network and open up ssh access. Take a look here.

Gesture-controlled music player with a Raspberry Pi inside

Tejas Ozarkar has fashioned this stylish music player from a Raspberry Pi, some perfboard, some sensors and a bit of wiring. The circuit he’s built allows you to increase and decrease the volume (by raising/lowering your hand above an ultrasonic sensor) and select/control a song by moving your hand in front of an IR proximity sensor. He’s written the whole thing up as a tutorial with photographs and diagrams on hackster.io. The case is actually made out of cardboard and sticky-backed paper, which just goes to show you don’t need a 3D-printer or laser cutter to get something that looks pretty good! Take a look at the write-up here. You can see the player and sensors in action below (Caution: Explicit lyrics)

Google AIY kit with Raspberry Pi’s The MagPi – review

On Thursday, there was much excitement when The MagPi issue 57 was released to the public. The issue came bundled with a Google AIY Projects Voice Kit, including a Voice HAT, a microphone add-on board, a big arcade button, a speaker and bits and pieces with which to put it all together. There was a big rush to get hold of the issue. Indeed, The Pi Hut, the official outlet for The MagPi, sold out within hours. It has now become very difficult to get hold of the issue anywhere!

As a subscriber, I received mine on Friday (a little irritating given that, until now, subscribers got theirs on the launch date, but anyway…) and on Saturday I was able to explore the kit.

If you’re still trying to get hold of the issue/kit, The Pi Hut tweeted today (Monday) that they had ordered another pallet-full. Visit this page and sign-up to get notified when they’re back in stock.

Hardware

The main component of the AIY Project Kit is the Voice HAT:

From a features point-of-view, this is a very exciting HAT. There are connections for the microphone add-on, the button and, of course, the speaker. However, most of the rest of the GPIO is broken out as connections for servos and other inputs & outputs. There are also specifically break-out points for I2C, UART and SPI – particularly important for sensors. There is even a place for an additional screw-terminal for a second speaker, giving stereo audio output. In short, you’ll easily be able to expand the system by adding other inputs and outputs, and I commend the designers for adding all of this great functionality.

The button is, perhaps, a bit of an overkill for this fairly simple project. It has five terminals (of which four are used) and needs to be assembled from three parts before use. It is nice and big, though, and it glows beautifully! The microphone board is ingenious – just big enough to allow stereo input, but small enough that you can just tape it to the cardboard box that makes up the project housing.

The cardboard housing is made of heavy-duty material, which means it’ll put up with you bending it the wrong way (as I inevitably did) when assembling and it protects the Pi and other components quite well. It also allows access to all the Pi’s ports, which means if you need to plug it into a monitor, you can do so easily.

You are instructed to use a Raspberry Pi 3 when assembling the project. This seems a bit over-the-top considering how much the Pi 3 costs, especially when it has been tested out as working with a Pi Zero. The housing, however, is specifically designed for the Pi 3, so you’ll probably want to use a Pi 3 anyway. However, it is reassuring to know that it works with the Pi Zero (and Pi 2 for that matter) in case you want to make the project smaller at a later date.

Software

For this project, the recommended route is to download an SD card image from the Google AIY Projects site, although you can also add the software onto an existing Raspbian install by following instructions on GitHub.

The provided image is nice because it has everything pre-installed and ready to go. It’s also smaller than the regular Raspbian image so it is a bit quicker to download and write to the SD card. Apart from the pre-installed software, and the AIY desktop background, very little is different, and this is re-assuring for those of us who will want to extend the provided software.

There is a little bit of manual configuration to do, even with the pre-installed image. I think this is actually to its benefit – you learn more this way about how to do things, such as configuring the Google API.

Assembly instructions

The instructions for assembly are available both in The MagPi and also on the AIY Projects site. The instructions come with a large number of photographs to aid your progress.

All I can say is Thank You! to whoever wrote the instructions and took the photographs. The guidance is clear and the photographs are extremely useful when trying to get things in the right orientation. I did have a little confusion when setting up the Google API. The instructions assume you have never set-up the API before. I had, so the instructions didn’t quite match what I was seeing. This is a minor thing, though.

Using it

Once assembled and plugged in, you press the button (or clap your hands if you’ve configured it to respond to this audio signal) and ask it a question. It’s as simple as that. I had success getting it to answer questions, and some of them are very witty. (Ask it how to make tea or coffee!) I liked how it didn’t just use one site to provide the answers – it made me feel that I was getting more balanced responses. I have noticed that you can’t really get it to do much – such as playing podcasts. It just didn’t seem to know what to do. However, with a little programming, I’m confident that I’ll be able to create custom actions for it to carry out. I also noticed that if you don’t provide it with a valid input, i.e. if you clap your hands and don’t say anything intelligible, it tells you so, but the audio is very distorted. Other users have reported a similar thing with locally-held sound samples, so this is clearly a bug.

Overall

For the £5.99 cost of the magazine, you get a ridiculous amount of high-quality goodies. It could have been done cheaper, perhaps with a pHAT-sized board and a lower-quality button, so I commend Google and The MagPi for the high standards they’ve stuck to. It is a pity that more were not produced, as this issue has become difficult to get hold of. Indeed, some copies have appeared on eBay for up to £100, which is disgraceful behaviour, but entirely expected!

Overall, highly recommended if you can find it. If you want the kit, but can’t find an issue, the easiest thing to do is to subscribe to the MagPi. Alternatively, sign up to this Google Form to be informed when the kit becomes available to buy.

New MagPi comes bundled with free goodies for an artificial intelligence Raspberry Pi

 

Issue 57 of The MagPi is with us, and what a bumper issue it is. It comes with the hardware for a Google-powered artificial intelligence/voice recogniser project, or AIY Project. Here’s the MagPi’s description of the contents:

Inside the magazine, you’ll find a Google Voice Hardware Accessory on Top (HAT) accessory board, a stereo microphone Voice HAT board, a large arcade button, and a selection of wires. Last, but certainly not least, you’ll find a custom cardboard case to house it all in.

You’ll need to add your own Raspberry Pi 3 (or 2 or Zero) to it. The magazine, naturally, comes with instructions on how to put the project together as well as all the great articles we’ve come to associate with the publication.

Having looked at some pictures of the contents, it’s pretty clear that the stereo microphone is an add-on and not a HAT… but let’s gloss over that. 😉

Rob Zwetsloot gives a briefing on the tech below:

What is a little disappointing is that, as a subscriber, apparently I don’t get my issue until tomorrow. This is particularly irritating as the issue is later than usual anyway. And yes, that is a whinge!

You can read more about the issue, and download a PDF of the magazine, here.

Google’s support site for the AIY Project is now up-and-running. It includes an assembly guide and diagrams. Of particular interest is the HAT diagram:

This shows a lot of the functionality built into the HAT. I’m a little unsure what Driver0-3 are for, but I’m sure some bright spark will work it out! 🙂 Also on the Google site is the downloadable OS image, based on Raspbian. There is also a GitHub repository which shows you how to include the software on your own Raspbian image. Not terribly sure why the instructions are spread all over the place, but I’m sure there must be a good reason! 😉