*** There's a firmware update. Please check out! ***

LEDs are taking over conventional lighting every day. High-power LEDs over 1W are becoming more and more affordable, and I wanted to start using them to replace the lighting fixtures around me. However I realize that finding and configuring the power supply was a bit of a pain, since I wanted to use different LEDs in different configurations depending on what the lighting was for. Power supply needs to regulate the current that goes though the LEDs. With higher current that high-power LEDs require, active constant current circuit is the only practical option. Commercially available buck regulators are easy to use, however, they are usually made for a specific current and voltage range. For me that means having to purchase variety of buck drivers.

Also, most of LED drivers lack dimming function, or have poorly functioning dimmers. I think dimming is essential for modern lighting, and I want smooth control of brightness.
So I decided to develop a universal, dimmerable high-power LED controller. It has taken me four months to develop this controller. Although it's still in development, I think it's quite useful to all DYI'ers with LED lighting projects.

I made this an Open Source project. Both hardware and software are open - please use, and extend this project and share the knowledge. A 3D printable enclosure as well as couple of LED mounting hardware is also available as Open Source, download-able at Thingverse. Together you can really kick start LED conversion of your household lighting!

Step 1: Features

Here's the list of main features:
  • Inductor "switch mode" controller for high energy efficiency.
  • Wide supply voltage range of 5 to 18V (can go higher, but not tested). Great with batteries as well as AC adapters.
  • Up to 20W maximum output power (can go higher with active cooling). (at supply voltage 12V or above)
  • Constant current (pulsed) - configurable up to 3A peak current.
  • Selectable between buck-boost and boost mode.
  • Analog style dimmer control (smooth, flicker-free continuous adjustment)
  • IR remote receiver - controllable via Sony IR remote control
  • Digitally controlled dimming - via external microcontroller including Arduino.
  • Master/slave gang dimming - connect multiple units together and control the dimming from any one of the units.
  • High frequency pulse drive - 32kHz to 175kHz - no flicker even in video!
Hi. <br>I have a 96W LED chip I am trying to power. It requires 70-90VDC at 1.5A. I am having trouble finding a driver that can supply that kind of voltage (it's a new COB chip with 9 colors making it a full spectrum light for plant growth). Anyway any suggestions as to how I can supply this kind of voltage (I want to use an AC adapter). <br><br>Thanks!!<br>Matt
<p>SPEA-1 from Embuilt can be used to check the full THD and harmonic spectrum of any LED driver</p>
<p>Hi,<br><br>I have a 1m RGB (3x3W at max) 5050 light strip, and a 12V PSU, the chinese controller had 3x(smd fet and small resistors) in it.<br>Do you have any practical ideas how to make the driver stage more compact for 3ch? <br><br>Do I need V-sense for each channel?<br>At the bare minimal I can't go under 3 comparators?<br><br>it is not recommended to drive light in the 30-40 Khz range, because we use that for IR communication.<br><br>Thanks,<br>Arpad</p>
<p>Very nice design ! I'm curious if you recommend this pwm led driver for a photo studio light ?</p>
<p>Any Chance you still have some one or two if the PCBs? The Shop link returns an 404 </p>
<p>Great looking project. It seems you created this a while ago, have there been any alterations? Is this still considered a efficient universal method of driving leds? I have been looking at this and your poormans buck and they are both awesome looking projects, I already have components on order to build the poormans buck. Here is my problem though, there are some Higher Power leds from LEDENGIN that I'd like to use (30W, 10W) that run on 42V and 14.4/15V respectively. In boost mode, will this driver be able to power those? Otherwise I am limited to 3W bulbs which don't seem to emit enough light to replace incandescents around the house. Also, if I don't have a 3D printer, is there a website that will make them, kind of like a OSH Park but for 3D prints? </p>
<p>I forgot to mention, I have a lot of 12V power lying around and anything else above that would be a pain, that's why I'm particularly interested in the boost mode.</p>
I've been sitting here looking at the schematic, and I can't for the life of me figure out how it measures the current in buck/boost mode during the off time of the transistor. The sense resistor is effectively out of circuit.
I was thinking about using a DAC to generate the reference voltage on a laser diode driver I'm working on. The design is based on the PIC12F752. Have you ever tried doing it like that?
I haven't done it, but using the DAC would make the software a bit simpler. But the problem with the DAC contained in 8 bit PIC is that its low resolution. If I remember correctly the DAC only has 5 bit or so. Some PIC24 series have 8 bit DAC and that would be perfect. <br>
Yeah, it is a 5-bit DAC. 31 dimming levels probably aren't enough for fading effects, etc, but it's more than enough for modes in a flashlight or laser pointer. It looks like the PIC16F1704 and 1705 have an 8-bit DAC. The 16F753 has a 9-bit DAC. Getting more bits than that would force us to use packages with more than 14 pins.
Hope this finds you well , We are a PCB supplier, specialize in PCB manufacture. <br>Our Key advantages: <br> Quick-Turn Prototypes <br> High-Tech <br> High-Mix Low-middle Volume <br> Products range :up to 24 layers rigid PCB, up to 12 layers rigid-flex PCB, up to 6 layers flex board。 <br>Our PCB Scope: <br> FR4,Tg140-230,Rogers,Arlon,Isola <br> HDI, Blind and buried via board <br> Rigid-flex board <br> Metal substrates (Al / Cu based PCB) <br> Heavy Copper&amp;Gold <br> Gold fingers, <br> Impedence control <br> <br>Should you have any question ,please do not hesitate to contact me. <br> <br>Regards <br>Frank <br>Bestech Circuits (HK) Limited <br>Skype:frank-bestech <br>EMAIL:frank@bestechcircuits.com <br>Website:www.bestechcircuits.com <br>
Hi Aki! <br>Can You help me: <br>If i use your original firmware the light not absolutely dimming off (the LED does not go to the end(OFF)). Wich parametrs i can change to set dimming to lowest(off-min) and increase brightnes level(set max)? <br>
Dear Aki! <br>Thank You for answer.Error is the same. I want sent to You log file. How i can do it? <br>Thanks!
You can email me the log at aki@theledart.com.<br><br>
Dear author! <br>I make some changes in driver firmware. But if i build your own original or the modified project i get the error message : Build Filed! <br>I use: MP LAB IDE 8.90 <br>Thank You for answer!
There's an update to the firmware:&nbsp;http://www.instructables.com/id/Universal-High-Power-LED-Driver-Firmware-update/<br> <br> Please try that version. (Microchip changed the header file a bit around ver 8.70 that created the error, but I fixed that one.)<br> <br> Aki
Wow! Great work and thanks for this instructable! <br>i wanna order some PCB&acute;s, but first i want to know if i can strobe the PWM Signal without causing any problems. <br>Means i wanna build a dimmable LED Strobo. <br>I want a Frequency up to 1kHz with 0-100% brightness. <br>Thats why i can&acute;t use normal PWM drivers... <br>Is it possible with your PCB? <br>I guess with some editing of your code and connecting another potentiometer it should be even possible without an external uC - right?
Hi, can it work with led strip, like this for example: <br>http://www.ebay.com/itm/5M-5630-NON-Waterproof-Cool-White-SMD-Flexible-LED-Strip-Light-300-Leds-12V-/111000486427?pt=US_Car_Lighting&amp;hash=item19d825021b
Those LED strips are voltage driven (usually 12V or 24V), so you don't need a special driver. If you want to dim those, there are many PWM dimmers available. <br>
Dear author! <br>Thank you for great led driver! <br>Can you provide any information about PCB size. If i use provided (&quot;Universal-driver-rev2-gb.zip&quot;) PCB in result i I get such a size 102 mm x x25 mm by default. 102 mm x 25 mm is correct? Seems too small...... <br>Thank You!
That's the correct dimension. It is compact.<br> <br> Aki
Thank you for such a quick and teach-full reply. <br>You have helped me learn, and I appreciate your generosity. <br>Cheers Aki
Hi Aki <br>Awesome work ...I love this design. <br>Just one question (for a die-hard DIY'er), does the 10k ohm Potentiometer (VR1) need to be linear or logarithmic? <br>Many thanks friend. <br> <br>
Linear pot. The controller (firmware) does the logarithmic function, so the output brightness appears linear.<br> <br> Thanks!
Thanks for the great instructable! I have the parts on order with hopes of building this great LED driver. But I do have a question...I'm a beginner hobbyist in electronics so please take that into consideration. <br> <br>I see on the schematic that there's an ICSP header, and the pins match my Pickit3 so I'm good with that....but in the images of the PCB it looks like the ICSP header is used for connecting GND/+12V/BOOST-/LED+/BUCK-. Is this header also used to program the chip in circuit or is it programmed out of the circuit and put in? <br> <br>I'm sure that the information is in the instructable somewhere, and I've read it through and through, but my novice eyes just aren't finding it. I just don't understand how the same header could be used for both functions. <br> <br>Also if the header does indeed serve both functions, then does MCLR match up to GND or BUCK- when connecting the power supply &amp; LED strings? <br> <br>Thanks! <br>Charlie
ICSP is by its own, right under the PIC (around the middle on the PCB). Nothing connects to that port under normal use. It's used only when you upload the firmware. The power in and LED connections are on the right side, and the remote control connector is on the left.<br> <br> ICSP port on the PCB are just 5 holes. No headers are soldered. I just stick a 5 pin header into those holes and hold it to program the PIC, because it only takes less than 30 seconds to program. Hope this makes sense.<br> <br>
Yep, that makes sense! I also just noticed that on the schematic, &quot;Buck-Boost&quot;, &quot;Boost&quot;, and &quot;LED+&quot; are shown as individual pins. I assumed that the header pins on the right side of the PCB were ICSP when in fact they represent the individual power &amp; LED pins on the schematic. <br> <br>I understand it now. Like I said before, the info was there...I just wasn't seeing it. <br> <br>Thanks again! <br> <br>Charlie
Never mind! After some more looking at the PCB, it looks like an ICSP header wasn't populated, and I'm guessing that the header pins on the PCB for GND/+12V/BOOST-/LED+/BUCK- aren't technically shown on the schematic (unless I misunderstand something which is quite likely!). <br> <br>Thanks! <br>Charlie
Thanks for a great instructable and the inspiring ideas shared. I wanted to ask you why did you decide upon the reference voltage generation circuit instead on a voltage divider? It seems that the reference voltage is to be kept stable throughout the work of the driver and not dependent on other conditions. But I am no expert in PIC ASM and cannot be sure I've read the code and the writeup correctly.
Reference voltage needs to be stable against the power supply voltage. Because the&nbsp;purpose&nbsp;of this driver to supply LEDs constant current, and the reference voltage is used to compare against the current sense output.<br> By controlling the output so that current sense voltage matches the reference voltage, this driver keeps the output current constant.<br> <br> Using diode (more often zener diode) to create reference voltage is very common practice.<br> <br> Aki
Thank you for your answer. I am not very good at electronics and I have no formal education in the field. <br>I intend to start experimenting recreating part of this with an AVR and this is why I am trying to understand some of the logic before starting to prototype. <br>I just noticed that you use 7805 to provide stable 5v to the microcontroller. This way you already have somewhat stable voltage in your system. Unless the leds draw so much power that the power supply dips drastically and the voltage from the regulator falls, but in that case the current over the leds cannot be increased anyways. <br> <br>
Ok, in this&nbsp;particular&nbsp;circuit, I'm trying to create low voltage reference (0 - 0.6V) by&nbsp;clamping&nbsp;the voltage out of the PIC output. This output is a PWM signal, so the PIC can control the reference voltage from 0.6V down to almost 0V.<br> I wanted to allow 5V&nbsp;operation, and 7805 drops 1V or so - which is ok, but the reference needs to be&nbsp;steady.&nbsp;<br> <br>
Great driver. Can you provide single side PCB for the circuit for the simple DIY people.
Sorry but it's not that easy to turn this PCB into single layer. I always try to make my PCBs to have least number of layers, but this one kind of needs to be two layer to work well.<br> My &quot;Poorman's Buck&quot; PCB is single layer design. You might want to try that one.<br> <br> Aki
Hi, <br> i have seen your Poorman's Buck that one is also great. Thank for you great work. Keep it up.
Hello congratulations by Brazilian and design is great to have some doubt that would be very grateful if you can answer me. <br>I do not think the first component NTD5867NL N-ch MOSFET on my parents would be possible to replace it would have some similar example of this component. <br>segunto and did not quite understand how it would link several modules together to control pwm from just one. <br>thank you in advance for the immense contribution in providing the project.
If you can't find NTD5867NL, you can use many other N-channel MOSFET with following specs.<br> <br> Drain-Source voltage: 60V or higher<br> Maximum Drain current: 5A or higher<br> <br> Other specs are not that important. Form factor should be TO-251AA(I-Pak) or TO-220.<br> <br> I know those should work; <ul> <li> IRLI520NPbF <li> IRLU120NPbF <li> HUF75637P3 </ul> Good luck!<br> <br>
Hi Aki, <br> <br>Thank your very to share your projects. It really brings a lot of fun to my life. I made your universal High-Power LED Driver and it is working great. I bought a PICKIT3 from Microchip and tried to add some code for the IR remote control function. Now I could use '0-9' button to adjust the brightness to the pre-set value and turning on the light by cliking the 'Power' button. <br> <br>I am a novice for the PIC micro-controller, I am not quite clear about how the A/D and comparator usage. I want to use 2 or 3 18650 lithium battery to provide the power. I want to add the low voltage shutdown function to prevent battery overdischage. Could help to give some code example about this function? Say I want to shutdown the light when the supply voltage is under 6V(2 18650) or 9V(3 18650). <br> <br>I saw the 'shutdown_vol2 equ 24' in your code, but I did not figure out how to check the supply voltage and make action to turndown the light when the supply voltage is too high.
Look for a variable named &quot;sp_voltage&quot;. This variable holds A/D value of the S-SENSE input. 0xFF (255) corresponds to supply voltage of about 28.5V, so you can scale it to the number you need.<br> Just check this variable at the end of the main loop (note that it takes some time for the first conversion to be done), and shut down accordingly.<br> <br> Now the tricky part. A/D conversion uses PIC's supply voltage as a reference. So if it goes under 5V (happens when you give lower than about 6.5V to the circuit, because the 5V regulator needs some voltage) the A/D value changes. For us to know the exact voltage on S-SENSE, we need to have a known voltage supplied to the PIC.<br> PIC has an internal reference voltage you can use to determine the supply voltage (by calculation). You might want to check into that.<br>
Hi Aki, Thank your very to share your projects. It really brings a lot of fun to my life. I made your universal High-Power LED Driver and it is working great. I bought a PICKIT3 from Microchip and tried to add some code for the IR remote control function. Now I could use '0-9' button to adjust the brightness to the pre-set value and turning on the light by cliking the 'Power' button. <br> <br>I am a novice for the PIC micro-controller, I am not quite clear about how the A/D and comparator usage. I want to use 2 or 3 18650 lithium battery to provide the power. I want to add the low voltage shutdown function to prevent battery overdischage. Could help to give some code example about this function? Say I want to shutdown the light when the supply voltage is under 6V(2 18650) or 9V(3 18650). <br> <br>I saw the 'shutdown_vol2 equ 24' in your code, but I did not figure out how to check the supply voltage and make action to turndown the light when the supply voltage is too high.
Very nice!
its looking nice Ledartist , i have Coffee shop and made a <a href="http://www.brightledsigns.com" rel="nofollow">LED sign</a> after installing this my business rising swiftly..so these LED works greatly and special thanks to them who designed this nicely.Go forword your creativity.<br><br>
Excellent instructable! As someone who is designing a low current higher voltage (into the 100s of V) boost converter it is interesting to read someone going through similar things that I am. That being said, your design makes mine look like crap! Yours is much nicer and much more fancy. Mine is very basic to solve a simple problem. <br><br>The only additional thing that would be nice to see is you do a follow up project for converting mains to either 12V (for this) or do a mains powered version of this. Obviously, it would b significantly bigger but it would have a bit more application for this. Either that or since this is OpenSource I may build off your design. I guess its based on what time/funds will allow.<br><br>
Thanks your comments!<br> <br> I'd imagine that voltage that high would be hard to do as a boost converter, since finding MOSFETs with breakdown voltage higher than 100V seems to be hard. Are you using a transformer?<br> <br> Anyway, 12 - 24V DC power supply is easy to find. Most people have a few wall warts laying around I think. Battery operation is nice too. Add to that as long as I've been playing with electronics, and I even have a electrician license, developing high voltage circuits still makes me nervous...<br> <br> Please do use my design partially or as whole, to build your projects. Do not forget to share that here on instructables!<br>
Its not much above 100V actually (around 120-130V) I just realized I worded that kinda wrong. No transformer, just an inductor.Otherwise pretty much a standard constant current boost circuit. Nothing too special, just designed to work on 8-24V.<br><br>Yeah, if I do modify your design to work on household voltages I def will post it on here.
Can it be used with voltage variable dimmer (1~10V DC) that Lutron sells?
Not sure what that dimmer does. Is it a dimmer or a controller that outputs DC voltage?<br>
It is just a simple 0-10 VDC lighting control dimmer, voltage variable lighting control signaling system.
Ok, just like old dimming system, pre DMX days.<br> No this circuit doesn't support such a system, but very easy mod to connect 0-10V dimming voltage to where the pot is. All you need is a resistor voltage divider to reduce the voltage within 5V.<br>

About This Instructable


155 favorites


Bio: I am an electronic artist living in Brooklyn, NY. I work with LEDs and microcontrollers to create beautiful objects.
More by ledartist: T962A SMD Reflow Oven Fix/Hack Color Organ Triple Deluxe II Aurora 48 - 48 RGB LED Sequencer
Add instructable to: