Instructables

Universal High-Power LED Driver with 3D-printable Case

Featured
*** 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!

 
Remove these adsRemove these ads by Signing Up
1-40 of 54Next »
prandall16 months ago

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?

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.

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?
ledartist (author)  The Lightning Stalker9 months ago
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.
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.
lacicor1 year ago
Hi Aki!
Can You help me:
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)?
lacicor1 year ago
Dear Aki!
Thank You for answer.Error is the same. I want sent to You log file. How i can do it?
Thanks!
ledartist (author)  lacicor1 year ago
You can email me the log at aki@theledart.com.

lacicor1 year ago
Dear author!
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!
I use: MP LAB IDE 8.90
Thank You for answer!
ledartist (author)  lacicor1 year ago
There's an update to the firmware: http://www.instructables.com/id/Universal-High-Power-LED-Driver-Firmware-update/

Please try that version. (Microchip changed the header file a bit around ver 8.70 that created the error, but I fixed that one.)

Aki
mastamuk1 year ago
Wow! Great work and thanks for this instructable!
i wanna order some PCB´s, but first i want to know if i can strobe the PWM Signal without causing any problems.
Means i wanna build a dimmable LED Strobo.
I want a Frequency up to 1kHz with 0-100% brightness.
Thats why i can´t use normal PWM drivers...
Is it possible with your PCB?
I guess with some editing of your code and connecting another potentiometer it should be even possible without an external uC - right?
pr.albert1 year ago
Hi, can it work with led strip, like this for example:
http://www.ebay.com/itm/5M-5630-NON-Waterproof-Cool-White-SMD-Flexible-LED-Strip-Light-300-Leds-12V-/111000486427?pt=US_Car_Lighting&hash=item19d825021b
ledartist (author)  pr.albert1 year ago
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.
lacicor1 year ago
Dear author!
Thank you for great led driver!
Can you provide any information about PCB size. If i use provided ("Universal-driver-rev2-gb.zip") 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......
Thank You!
ledartist (author)  lacicor1 year ago
That's the correct dimension. It is compact.

Aki
Millchard1 year ago
Thank you for such a quick and teach-full reply.
You have helped me learn, and I appreciate your generosity.
Cheers Aki
Millchard1 year ago
Hi Aki
Awesome work ...I love this design.
Just one question (for a die-hard DIY'er), does the 10k ohm Potentiometer (VR1) need to be linear or logarithmic?
Many thanks friend.

ledartist (author)  Millchard1 year ago
Linear pot. The controller (firmware) does the logarithmic function, so the output brightness appears linear.

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.

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?

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.

Also if the header does indeed serve both functions, then does MCLR match up to GND or BUCK- when connecting the power supply & LED strings?

Thanks!
Charlie
ledartist (author)  charliemyers1 year ago
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.

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.

Yep, that makes sense! I also just noticed that on the schematic, "Buck-Boost", "Boost", and "LED+" 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 & LED pins on the schematic.

I understand it now. Like I said before, the info was there...I just wasn't seeing it.

Thanks again!

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!).

Thanks!
Charlie
mircho1 year ago
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.
ledartist (author)  mircho1 year ago
Reference voltage needs to be stable against the power supply voltage. Because the purpose of this driver to supply LEDs constant current, and the reference voltage is used to compare against the current sense output.
By controlling the output so that current sense voltage matches the reference voltage, this driver keeps the output current constant.

Using diode (more often zener diode) to create reference voltage is very common practice.

Aki
Thank you for your answer. I am not very good at electronics and I have no formal education in the field.
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.
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.

ledartist (author)  mircho1 year ago
Ok, in this particular circuit, I'm trying to create low voltage reference (0 - 0.6V) by clamping 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.
I wanted to allow 5V operation, and 7805 drops 1V or so - which is ok, but the reference needs to be steady. 

skmdmasud1 year ago
Great driver. Can you provide single side PCB for the circuit for the simple DIY people.
ledartist (author)  skmdmasud1 year ago
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.
My "Poorman's Buck" PCB is single layer design. You might want to try that one.

Aki
Hi,
i have seen your Poorman's Buck that one is also great. Thank for you great work. Keep it up.
lmoreira22 years ago
Hello congratulations by Brazilian and design is great to have some doubt that would be very grateful if you can answer me.
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.
segunto and did not quite understand how it would link several modules together to control pwm from just one.
thank you in advance for the immense contribution in providing the project.
ledartist (author)  lmoreira22 years ago
If you can't find NTD5867NL, you can use many other N-channel MOSFET with following specs.

Drain-Source voltage: 60V or higher
Maximum Drain current: 5A or higher

Other specs are not that important. Form factor should be TO-251AA(I-Pak) or TO-220.

I know those should work;
  • IRLI520NPbF
  • IRLU120NPbF
  • HUF75637P3
Good luck!

sangyue2 years ago
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.

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).

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.
ledartist (author)  sangyue2 years ago
Look for a variable named "sp_voltage". 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.
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.

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.
PIC has an internal reference voltage you can use to determine the supply voltage (by calculation). You might want to check into that.
sangyue2 years ago
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.

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).

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!
PedroDaGr82 years ago
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.

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.

ledartist (author)  PedroDaGr82 years ago
Thanks your comments!

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?

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...

Please do use my design partially or as whole, to build your projects. Do not forget to share that here on instructables!
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.

Yeah, if I do modify your design to work on household voltages I def will post it on here.
JVC-Force2 years ago
Can it be used with voltage variable dimmer (1~10V DC) that Lutron sells?
1-40 of 54Next »