Introduction: Spooky Fading LED Eyes
Using a microcontroller, like an Arduino, to fade an LED is not always the best option. Sometimes, you want a simple, low powered circuit that can be embedded directly into a prop while running from a battery for weeks at a time.
After testing about a dozen prototypes, I developed this circuit that works extremely well and is simple to implement, tweak, and embed inside of almost anything. This circuit will run on as little as 3.5 volts making it ideal for a lithium-ion battery, 5V USB, a button cell, or a small AA battery pack.
Using all standard components that you probably already have in your supply drawn is an added bonus.
Let's get started.
These are the standard supplies that are needed for this project
- 555 timer IC (either a bipolar or CMOS)
- Resistors (100k, 45k, 10k, 1k, and 220)
- Capacitors (1000 or 1200uF, 100uF, and 0.1uF [optional])
- LEDs (5mm or 3mm)
- Diode (any will do, I used a 1N4007)
- NPN Transistor (any will work, I used a 2N2222)
- A battery pack of at least 3.5V (I used a 18650 lithium-ion)
To build a permanent solution, solder the circuit into a piece of perf board using:
Step 1: The Circuit
The circuit is made up of two main parts -- a "555 timer" circuit, and an "LED fade" circuit.
First, the 555 timer circuit:
This is a standard 555 timer circuit that uses a 45k & 100k resistor divider along with a 100uF capacitor to generate a 3-4 second cycle with a 50% duty cycle. The 50% duty cycle is important to produce a good fade-in and fade-out time.
However, you can adjust this to match whatever you desire. For example, you made want an extremely slow blink that may take up to a minute to complete.
Second, the fade-in and fade-out circuit:
Using an NPN transistor (2N2222 works great) allows us to run as many LEDs as our power can manage. A 555 timer has a limited output current to pin 3 and it is a good idea to drive your LEDs through a transistor.
In this part of the circuit, we are using a 10k resistor to slowly charge and discharge a large volume capacitor -- either 1000uF or 1200uF will work. When the 555 output pin is high, the capacitor slowly charges up and slowly turns on the transistor which will turn on the LEDs. Once the 555 output pin goes low and sinks current through the 555 timer, the capacitor will start to slowly discharge causing the LEDs to slowly fade out.
While it is a simple circuit design, it is very smooth and effective.
Third, the photoresistor to turn the circuit on at night (optional)
This part is completely optional but if you want your circuit to turn on at night and off during the day to conserve power, add this to your final design.
Use the POT to adjust the threshold of light for the on/off light needed to turn on the circuit.
Fourth, the power (optional)
My final version will include a printed circuit board (PCB). And, with the PCB I will have multiple options to power the circuit including a screw terming for a battery and a mini or mico-USB jack. It is always a good idea to think about all of the ways you could use the final circuit when building a PCB.
Designing a final PCB board can be a lot of fun and it makes building a dozen of these circuits a breeze.
Step 2: The Breadboard Version
Always build a breadboard version before you commit to soldering a final version on perf board. At this stage, you can easily adjust the 555 timer's resistor divider, the two timing capacitors, and also check your input voltage to make sure the timing is appropriate for your project.
For example, if you want to run this circuit from a 9V or 12V power supply, you'll find that the capacitors charge up too quickly and the LEDs cycle too fast. Adjust the circuit by increasing the resistor values to compensate.
One option to speed up your testing phase would be to use a potentiometer between pins 8, 7 & 6 of the 555 timer. This will let you dial-in your desired on-off timing quickly. Use a 200k potentiometer if you have one, otherwise, a 100k or 500k would work.
Once you find the perfect timing, use your multimeter to measure the resistance between pins 8 & 7 and 7 & 6. Locate the closest resistor to those two measurements and test them in the breadboard before moving on.
In my case, I made many adjustments before settling on the 47k & 100k voltage divider in my final design.
NOTE: if you turn the potentiometer all of the way either direction, you will cause zero resistance (a short-circuit) on pins 7 or 6. Make sure you keep this in mind while testing.
Step 3: The Prototype Board
I always finalize my projects with a solder board, either on a piece of perf board (as shown here) or with a printed circuit board (PCB). Having a soldered version will make the project more robust, less likely to wiggle loose, and looks more professional when showing to your friends.
For this project, I used a 4cm x 6cm piece of perf board to solder the final circuit. As you can see, there are a lot of wires that do make it confusing to design. However, before I commit to having a dozen PCBs made, I wanted to make sure the final version behaved as anticipated, which it did.
Always use a connector or screw terminal when attaching your LEDs and battery. Being able to detach the board from will make it a lot easier to debug any problems that come up. Premade connectors and terminals are very cheap and will save you a huge headache later.
Once completed, the final board can be attached inside of your prop with some hot glue or double-sided tape.
NOTE: If the prop you are adding LEDs to is plastic, you can use a hot soldering iron tip to melt holes for the LEDs. Make the holes slightly smaller than the LEDs for a tight, friction fit. It is usually easier to insert the LEDs from the outside rather than trying to fiddle with them through the inside of a small prop, as show her with my rat.
Step 4: The Final Product
Now you can add slow fading LEDs to ALL of your projects.
At 4.2V, this circuit draws roughly 6.5mA using a bipolar 555 timer and 2 LEDs with 200 ohm resistors. Making it ideal to operate from a single rechargeable lithium-ion battery, like a 18650.
At 6.5mA, if you run it 24 hours per day, it should run for roughly 25 to 26 days before the battery drops below the cut-off voltage. To get an even longer runtime, add the optional circuit that turns off the fading during the day or use a larger resistor on your LEDs (increase the resistor from 200 ohms to 470 ohms or even 680 ohms).
I hope you enjoyed this project. If you made a version, please click the "I Made It" button and leave your pictures and videos of your fading eyes.
Step 5: Order PCBs Now
UPDATE: After a few delays and revisions, the PCBs are NOW available on Tindie for only a few bucks. So order as many as you want.
Participated in the
Make it Glow Contest