What Is It?
This is an LED strip animation which is supposed to resemble pairs of glowing eyes that appear, blink a few times, then disappear again. The idea is that the lights could be hidden in shrubbery, under a porch, behind a dark window, etc, to give the impression of sinister monsters watching from the shadows!
In my first demo video, I was using LED strips that are inside a container, from another project. One thing you might notice is at the beginning and end, there is supposed to be a slow fade in/out. Instead, there is a stuttering, blinky appearance. This turned out to be a bug in my early code where I accidentally declared an 8-bit variable where I needed 32-bits.
Later I improved the code, including the fix for the fading, and turning off the WiFi on my Particle Core board, to conserve battery. The WiFi can be toggled on and off by clicking the MODE button. Mainly, this is a convenience so that I can turn WiFi back on for the purpose of OTA (over the air) firmware updates. But later, I might add animation controls that I can change via the Particle Cloud service, or using the Blynk app.
In this second video, I've strung the LED strips out across the loveseat in my family room on a dark night. This gives a much better impression of how the final project will look for Halloween.
I recently did a battery test with a "lipstick"-style 2600 mAh USB battery, and it powered the project with 8 pairs of eyes, across 2 meters of LED strips, at 25% brightness (same settings as in the second video above). This lasted for nearly 8 hours, so it will definitely out-last the trick-or-treaters.
First off, a caution -- I am powering my Particle Core via USB, and the LED strip directly from the GND and VIN pins of the Core. This isn't usually recommended, but I know that my current draw at any given time is pretty low. It would be better to get power to your LEDs directly from your power source.
Wiring is pretty simple: 5V and GND connections to the Particle Core, either via USB or the GND and VIN pins. If you use separate power sources for your controller and the LED strips, make sure that the grounds are connected together. You can use any GPIO for data, but I happened to use pin A5. If you use a different pin, make sure to edit the DOUT definition in the eyeblink-demo code.
Flash the code to your Core, und watschen der blinkenlichten.
NOTE: I'm putting the Core into MANUAL mode to disable the WiFi and conserve battery power. But if you click the MODE button on the Core, it will attempt to connect to WiFi and the Particle Cloud, so that you can re-flash it OTA (Over The Air).
I have several ideas for improvements. The position of the eyes can be changed, or even animated. Likewise for the colors. Imagine a pair of eyes that gradually fades from green to red, as it glides from left to right, for example. I'd like to make a new demo that randomly, but intelligently, places eyes in the available space, keeping a minimum distance between them, and ensuring that adjacent pairs do not overlap. Eventually, I'd like to also make it friendly for an LED matrix (anybody want to donate one to me for testing? ;) ).
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!