This project is not perfect. Dumb things were done. I will talk about the dumb things and how they could have been less dumb. We all learn through failure, and being humble and talking about failure is a great way to learn!
tl;dr: There's no such thing
Like many of us, I sometimes buy things on impulse (dumb_thing++). BigLots was having a sale on ridiculous animatronic stuff for Halloween, and my wife had made the mistake of putting me in charge of decorations (dumb_thing++, but not MY dumb thing, so dumb_thing--). I bought an animatronic triceratops skull, which is honestly only marginally Halloween-related. When triggered by motion, it would open it's mouth and screech at you for far too long for comfort.
So, I did what any one of us would do with an inexpensive impulse buy that we considered throwing away: I took it apart to see how it worked.
A blessedly few number of screws later, I had it in pieces, and saw that the animatronic bit was controlled by a simple DC motor connected to some mysterious plastic box. I cut the wires off of the motor, pulled out the awful screechy motion-sensing electronics, and started testing.
As it turns out, that plastic box thing was a bit of a blessing - it is a clutch like mechanism that wouldn't let the mouth open or close too much if you ran the DC motor too far in any given direction. This means that finding limits, etc weren't necessary, and writing a program to control it would be very very simple. Some electrical engineer at the animatronic triceratops design firm (BTW, are you hiring? That sounds like a fun place to work!) was both lazy and clever enough to shift their workload over to some poor mechanical engineer.
Since this is the project planning section, I will explain to you how project planning works in my brain. I have an animatronic skull that I can control, a holiday coming up, an extremely modest skill set and a great enjoyment of absurdity. I had a vague recollection of an Amazon Echo controlled Billy the Big Mouth Bass, and I thought - THAT's what I should do! (dumb_thing++).
The WHY of this came much later in the process.
tl;dr: An Amazon Echo, an Arduino, an Adafruit Motor Shield, a 3.5mm TRS splitter, and an amplified speaker.
In case you hadn't noticed from the planning section, planning ahead is not my strong suit, so I tend to have parts on hand in case inspiration strikes.
Arduinos provide the simplest, and possibly laziest, way to control things, and being simple and lazy myself, I have several on hand. I also had an old Adafruit Motor Shield (v1), which provides a lazy way to control things like DC motors. This is also what was used in the Billy Bass project, so I could be lazy and steal code from there, so an Arduino was clearly the best choice.
I had an Echo Dot around for immediate testing, and ordered a refurbished one to use semi-permanently.
For initial testing, I used non-amplified speakers. I needed a little bit more volume outside, so I eventually added a 5V audio amplifier (powered from the Arduino) and a speaker.
Other than that, a 3.5mm splitter rounds out the parts list.
tl;dr: Connect splitter to Echo AUX output, one side to your amplified speaker, the other side through a small circuit to A0 on the Arduino. Connect the skull motor to a motor controller output on the Motor Shield M2, and program to move the motor up and down when audio is detected.
I started from the basis of the Billy Bass Instructables project, but quickly figured out that this didn't work great for me for a variety of reasons:
- They fed aux audio output directly into an Arduino analog input
- The code is a mess
- It didn't really work
But we learn from failure, right?
In reading this thread on an Arduino forum, I found what appeared to be a reasonable audio input circuit. I put this on a scrap of perfboard, connected it up and LO AND BEHOLD...it didn't work.
Honestly, I'm not really sure what's wrong here. However, I found that if rather than connecting the 5V+ input, I grounded it, it worked like a charm. Why? I don't know, but if it works, it works, and this seems non-dangerous in this case. I had to turn the volume all the way up on the Echo Dot to get a good signal into the Arduino using this. For this reason, I selected an audio amplifier with a volume control knob, so I could control the volume in other ways than through the Echo Dot (dumb_thing--).
Here are the basic construction steps:
- Build the interface circuit on a bit of perfboard (or the extra space on the Adafruit Motor Shield v2)
- Connect the splitter to the AUX on the Echo Dot
- Connect an amplified speaker to one side of the splitter to provide audio
- Connect the other side to your audio interface circuit. One channel is fine.
- Connect the output of your audio interface circuit to an analog input on the Arduino (I used A0).
- Connect the DC motor in the skull to one of the Motor Shield motor inputs (I used M2)
Power is supplied via the Amazon Echo power supply (for the Echo itself), and a 9V 1A power supply that powers the Arduino and from there 5V to the audio amplifier.
The plastic of the plaque is easy to cut with a utility knife. I traced out cut-outs for the components and taped or screwed them in place. This either means I can take it apart and re-use the components later or they will eventually fall off and get damaged (dumb_thing++)
The Arduino is programmed with some very simple code. You may have to adjust some of the thresholds or movement values or choose to do so out of personal taste. I'll be honest - I didn't spend very long tweaking this, so the movement could probably be more elegant!
What I have done is used a Zigbee motion sensor (Zigbee hub required as well, like an Amazon Echo Plus) to sense when people are approaching my door, and using that event to trigger an Alexa Route in the Alexa app. Sadly, although Alexa will tell you a Halloween joke, it isn't possible to trigger this event at present! (Shame on you Amazon!) Instead, you're stuck with the normal terrible Alexa jokes, rather than holiday-themed terrible Alexa jokes.
There's so much of this that is overkill. Here's a list of potential improvements:
- Use an less-capable Arduino (Nano?) with a simpler motor control circuit (simple transistor control?)
- Use a single 5V power supply to power the Echo Dot, Arduino, and audio amplifier - perhaps a single two-port USB plug?
- Figure out how to get AUX output from the Echo Dot without disabling the internal speaker. Then no external speaker would be necessary
- The skull also has LED eyes - these should really be connected to the Arduino as well and made to glow with the speech
- Make a nicer plaque for the head
- More sophisticated animatronic control
- Triceratops skulls aren't exactly specific to Halloween - this could really be used for any holiday!
Want to make a simpler project? No problem - here are your options:
- Use an amplified speaker with an AUX input - no construction requred, but you'll have to supply power
- Use non-amplified speakers - quiet, but works!
- You can skip the animatronic skull completely and use the motion sensor and an Echo Dot to have pretty much the same thing.
Having an Echo device that controls a lot of your home automation outside is dumb (dumb_thing++). Having tech that is cheap and hacky but seen as valuable outside is dumb (dumb_thing++).
One interesting fact about the Echo Dot is that you can mute the microphone, but it will still be possible to trigger commands through Routines. This means at least the one hanging outside takes some work to issue voice commands to. Changing the default wake word to something more obscure is also wise.
I have a camera watching over my entryway and live in a fairly safe neighborhood, so theft doesn't seem likely. If it is stolen, I'll have video of the perp, and I'm pretty sure someone will let me know if this turns up on eBay or Etsy (pretty please).