This is a small Arduino project our family did for Hallowe’en.
In the old cartoons, dark forests were shown as black backgrounds with mysterious eyes that would glow in the dark, often blinking or opening and closing.
The electronic hardware is very simple: multiple Arduino digital outputs sporting 330Ω resistors and an LED.
Mounting the Eyes
Each LED is mounted in a cardboard toilet paper tube with eyes cut out.
- Hold the tube horizontally in front of you.
- Cut large eyes in the middle of the tube. Use your imagination to get different expressions.
- Cover the eye openings with wax paper or cooking papyrus to act as a diffuser.
- Secure with tape.
- Cover the ends of the tube with aluminum foil and secure with tape.
- Make a hole directly opposite the eyes, and mount the LED, ensuring it’s pointing between the eyes.
- Secure the LED with tape.
Run pairs of copper wire from where the eyes will hide in the bushes to the Arduino. (Ensure the Arduino is protected from the weather. I put mine in a small cooler.) Check all connections and connect the battery to the Arduino.
Be sure to use a battery that has enough capacity to run all the lights and the Arduino for several hours. I used a small hobby 6V lead-acid battery.
This is a glorified “blink” program; nothing amazing going on here.
The software consists of a simple coöperative multitasking core that runs simple processes in a round-robin fashion.
Each process has a references to a master array oftapes, or eye programs.
- If the processes is sleeping and has not reached its wake time, return.
- If the process has no active tape, or reached the end of the tape, choose a new tape at random from the master array of tapes.
- Play the instructions at the current tape position.
- Turn the LED on or off, as instructed.
- Choose a future wake-up time as instructed.
- Increment the current tape index.
As you can see, there’s nothing terribly complicated about any of this. The software may be found on GitHub here.