Introduction: Dimmable Arduino Led Strip Driver
In this Instructable I'll show you how I built a driver for a Led Strip using an arduino.
Step 1: Step 1: Getting All Stuff Needed
For this project you will need:
- Arduino UNO
- 12V DC adapter with enough current to power the number of LEDs you want to drive.
- LED strip
- Potentiometer
- TIP120 or other component capable of driving high power
- 2k resistor
Step 2: Theory
A LED will vary its brightness according to the voltage supplied to it. The problem is that usually cheap DC power supplies are constant, they can provide a constant voltage, in the case of this project 12V.
So to workaround that we will have to make our own circuit to regulate the voltage output, using PWM (pulse width modulation). PWM works by switching the voltage on and off very quickly, depending on the ratio between the time on and the time of we can have an average output voltage between 0V and 12V.
Step 3: Circuit
For this circuit I’m powering the Arduino and the LED Strip with the same power supply, for that I’m using the Arduino’s power jack that can power the Arduino with voltages between 7V and 12V.
Double check if your power supply connector have the same polarity as the Arduino’s connector with is positive in the center, like in the picture below.
The potentiometer is connected to the analog input of the Arduino to regulate the level of the PWM output to the TIP120 power transistor (by software).
Step 4: Final Assembly
In the image you can see the final assembly, I soldered directly to the power jack the capacitor the smooth the PWM signal and also I soldered the the positive connector (exposed in the back of the connector) directly to the positive input of the LED strip and the ground connector (exposed in the side of the connector) to the ground of the board I made.
It is not represented in the circuit schematic but in the final assembly I put a switch between the connector (middle pin) of the TIP120 and the negative terminal of the LED strip to cut the power of the LED strip completely when switched off.
Step 5: Code
The code is pretty simple and self explanatory. You can download it in my Github page at: link to code
Step 6: Video
Step 7: Final Considerations
This is the first of my projects that I documented but I'm planning to write guides for lots of projects I love making.
You can check out my future projects in my blog.
Please ask any question or suggestions you have, I'll be pleased to answer.