Thursday, October 26, 2017

Magic Mirror - build part 3


So, my magic mirror had been hanging in the living room above the fireplace, happily serving information for a few weeks, when May 2017's issue of the MagPi magazine (issue 57) was published, containing some rather spectacular electronic gubbins, the Google AIY Project kit (Artificial It Yourself)! A big speaker cone, wires, arcade style button, and a Voice HAT printed circuit board, enabling you to build your own version of Google's Home voice assistant, all free with the magazine. I had to have one!


Publication day came, and I tried at least 5 different stores, all of which did NOT have a copy or had already sold out. My wife eventually found and reserved a copy that was still available (thanks Sainsbury's Shrewsbury!) and we were able to pick it up the following Saturday from the customer service desk. Phew! We also found some additional copies on the shelves in the main store... I had them too!

I also ordered a brand new Pi3 and built it into the cardboard version. This was to become my test unit to see how to install and configure it, and to see if it really was actually worth the effort to cram it inside the magic mirror. The cardboard build seemed to go relatively smoothly, if a bit fiddly, however the instructions in the magazine didn't quite match with the necessities of reality (if I recall correctly, there was a file renaming step missing) but after some further troubleshooting, it eventually worked really well. Run the code, press the button, talk, and receive an answer. Super!


Next problem. If I was going to build this into the mirror, I didn't want to have to press the button to activate the assistant, nor worry about where to position or how to mount it. Luckily, there were additional instructions on the following pages to circumvent the button push, and move to a 'clap clap' trigger, which also worked. There also appeared to be further instructions to change the clap trigger to using the hot words "Hey Google", so I also tested that with similar success. A hands-off voice assistant it was to be then!


The major problem though, was with the additional height of the larger speaker cone, and the VoiceHAT board on top of the Raspberry Pi.


There are two little white plastic connectors (one for the microphone, and one for the pushbutton, which increased the height required beyond the 2cm of space available inside the mirror.


I considered a couple of solutions. Cutting more holes in the backing board for the components to poke out felt inelegant, would look messy and may affect how the mirror hangs on the wall. Equally, extending the GPIO ports with an IDE cable might work electronically, but I didn't even bother testing that because that configuration would still not have fit in the space available.

I really wasn't sure how to proceed, and found my mind wandering. My daughter was watching Dr Who, rather loudly in her bedroom next door. He wouldn't have this problem, because his Tardis is bigger on the inside... Therefore the only solution was to steal some Timelord technology and actually make the inside bigger...
...ah-ha!


Thanks to that flash of inspiration, it would be a relatively simple modification to tack on some additional 20mm strips of wood to make the 'walls' of the backing board higher.


Then, after carefully removing the brass clasps, do exactly the same with the outer frame. Wood glue the strips into place first, then drill pilot screw holes for extra security, and reattach brass hooks.



Hey presto, extra room!


New blocks of wood were cut and glued on top of the existing ones to increase the height of the screen mounts to again push the screen against the inside of the glass pane.


Some additional scraps were used to hold the new speaker cone in place. Unfortunately, it completely threw off all sense of symmetricality, but as it's all neatly hidden inside it only bothers me when I think about it... :)



The microphones are not permanently affixed, and are instead woven between other cables and left to dangle slightly, but not so much that they push up against the inside of the black card and glass. The mics are quite sensitive, so being inside a glass picture frame with a large, sound deadening bit of thick card in the way doesn't actually seem to be a problem at all.



Back on the wall, and configuring by remote was a bit more of a trial. There are instructions available for you to install the required software manually, and I followed those. The Google AIY stuff worked pretty much first time, but I had problems configuring regular audio output for my timebonger script. Again, I didn't leave myself any notes on what I did to eventually get this working, but it took many attempts and lots of Googling. I might have just chosen an alternate output device from the volume control's wiget on the menu... can't actually remember!

Finally, everything was working smoothly!

Coming up... Magic Mirror Build Part Four - Everything stopped working smoothly!

No comments:

Post a Comment