I’ve been playing with Particle 3rd Generation Mesh devices lately (Argon/Boron/Xenon). Since I knew I wanted a remote motion sensor, a pair of Xenons seemed perfect (albeit admittedly quite overkill). I simultaneously started working on modifying the 3D model of Hypnotoad I found on Thingiverse to allow for getting Neopixel LEDs in each of the eyes as well as making a simple motion sensor.
For the model, there may well be a better way via a different software package but since all I had were STLs I found that designing the cavity in Fusion 360, exporting it as an STL and performing a Boolean difference operation in Meshmixer worked well-enough (although it did take a while since it was an iterative process getting the cavity designed properly). For the motion sensor, the only sensor I had handy that would work was an ultrasonic sensor. While not perfect, it would do the job. Putting together a working prototype was easy enough, however I found the code more difficult than anticipated.
I started off breadboarding with a Photon I had handy and got it working quite well using the library ‘New_Ping’. After switching to a Xenon (to make a battery-powered sensor more feasible as well as be able to utilize mesh networking), I found that library not to work due to the 3rd generation devices currently not supporting another commonly used library ‘SparkIntervalTimer’. Ultimately, I had to read from the sensor in a much simpler way that while usually works, also gives me intermittent short distance readings (of half or even less than the actual distance). Since I was going to have the sensor trigger when someone walks in front of it, this proved to be a problem. However, after further testing I was able to calibrate/position it such that it rarely if ever gave a false-positive (since this was just for 1 night of the year, I also wasn’t too worried about a few false-positives).
Next was to put together the controller for the Hypnotoad that would manage the Neopixel LEDs in the eyes as well as play music. I already have some wireless speakers on my front porch that I normally have connected to a Chromecast Audio for listening to music, so I only needed to play the music via a headphone jack. I went with an Adafruit Music Maker FeatherWing for this purpose. The libraries for this device are great, making it super-easy to output whatever audio you want and have complete control over it (although for this project, I didn’t need or use any of the more advanced functions).
After a bit of soldering and heat-shrinking, I ended up with a functional board and Neopixel wiring harness.
Unfortunately, I forgot to include a level-shifter since the Xenon only talks in 3.3V. Once I realized my error, and since I didn’t have one handy, I decided to alter things and just run them off of 3.3V. I couldn’t tell a meaningful difference in brightness and it meant I could get it working right then rather than in a week. I’m sure the fact that I’m only running two Neopixels helped with the brightness issue as well.
The Hypnotoad model was already in two pieces (body and head) and since I only needed the eyes to be clear/translucent I printed the head with some translucent PLA and the body in white.
The code for controlling the eyes was quite simple, I kept the color constant (yellow) and just altered the brightness with time such that they both ‘breathed’ but exactly out of sync. For painting, I simply covered the eyes in painter’s tape and spray painted everything else black to act as a primer.
Since I have no skills painting and a good friend of mine does, I got him to do it for me. I was quite happy with the finished project.