So, this is a silly project, and very much a work in progress, but I was able to celebrate a mini success this evening, so I figured I’d post about my progress thus far.
Inspired by a tutorial in MagPi issue 47, wherein the author had hooked a Connex Action Dino to a Pi, allowing her to activate it via Node Red using a key phrase mentioned in an email, I decided this was a terribly fun idea, and dragged my Girlfriend to the nearest Maplin to purchase said Dinosaur:
The Node Red portion of the tutorial was simple enough, and thanks to it I now have a slightly better understanding of Node Red and how it works (choosing to use the tweeting of the phrase ‘grrr’ as my activation trigger - thanks, Mum).
The bit I had a problem with was the electronics, as I was having trouble understanding how it should be wired up, and not being sure if I had the components I needed. So rather than even trying to follow their example, I had remembered from my Arduino adventuring that you could use an optocoupler as a switch, so set about trying to make that work… without any joy. I have no idea why this didn’t work, but I’d imagine it was probably due to a fundamental misunderstanding on my part relating to the purpose of optocouplers.
Anyway, that was a couple of weeks ago, so today I decided to take a different approach. Having realised that it’s a simple DC motor which powers the dinosaur, I remembered the Arduino kit had a motor project, so set about rebuilding the circuit, substituting the motor for the dinosaur… and it worked:
OK, so that’s an Arduino, not the Raspberry Pi, but the fact I’m able to make it activate via an electronic signal is amazing. Now, because my joy is fleeting, trying to use the same circuit on the Raspberry Pi doesn’t work - but it’s too late in the day to try figuring out why, so the next phase of the experiment will have to wait - but for now I’m pretty happy.
The long-term goal is to have a pi and all the electronics inside the box, existing as a self-contained unit, so with some luck, I’ll figure out the problems with the Pi, and get my hands on another zero.