# My DIY PWM LED dimmer



## insta (Jan 27, 2010)

Maybe some pictures will get a little more interest? I'm not trying to make any money at all, I'm sorry if I put anyone off in my initial post :icon_redf I just wanted to share this and see if anyone else could use it.

The voltage range is actually between 0 and +V. This means that you can control the brightness in any manner you see fit -- I'm using a simple potentiometer, but you can use a photocell and resistor to make a light-sensitive voltage source. This would allow you to have the internal hood track the brightness of the sun outside, or by inverting it, have the internal hood maintain a constant light level in your tank despite other indoor lamps being on.

Here's a shot of its brightness (note, these LEDs have little to do with the controller I'm talking about, they are the leftovers from my lantern. I'd suggest a real planted tank use higher-wattage lamps, or perhaps halogens or something similar):


Another brightness shot:


The $13, 12v @ 3.5A power supply I'm using. It was cheap, that's why I picked it:


The underside of the board, shown with a 20oz bottle for scale. I made the board myself with a laser printer and radioshack parts 


Topside of the board:


If nobody cares still, I'll let the thread die off. Otherwise, I can post the schematics of the controller (as the Eagle project files) and instructions for anyone who wants to make their own at-cost.


----------



## PDX-PLT (Feb 14, 2007)

insta said:


> I can post the schematics of the controller ...


Yea, I think you have to now. roud:


----------



## insta (Jan 27, 2010)

Well, I'm finally back from my business trip. I'd lost the original schematics and routings, so I've kinda slapped some together. The Eagle project files are available in the ZIP attachment -- as well as the full parts list, and where to buy each component. Component cost is just over $6. I'd appreciate if anyone wants to improve upon the design  It's pretty small -- by just dragging the right side of the board over, you can shrink it to 2.1" square. 

MOSFETs can handle a ton of current. At the relatively slow PWM frequency of 1khz, the MOSFET is "constant on" as far as the datasheet is concerned. It's on-state resistance of 0.06 ohms lends to just over 50 watts of power dissipation at 29 amps (regardless of voltage). Cool the MOSFET with a repurposed active CPU cooler for this kind of power handling. 29 amps at 48 volts is nearly 1400 watts of lighting -- you may find that a simple passive brick of aluminum is enough 




BTW, the project is licensed under the TAPR open-source license. Read up on it here -- http://www.tapr.org/TAPR_Open_Hardware_License_v1.0.txt .


----------



## insta (Jan 27, 2010)

I came up with a few ideas for variable-voltage inputs for the dimmer. The VCC and GND arrows go to the smaller connector on the controller, and the double-bar thingy goes to the middle pin (the variable voltage itself). Hope this inspires someone ...

Feel free to ask questions :bounce:


----------



## E.Eliveld (Jun 19, 2010)

Hello, Insta,

I realize a kind of late response but you’re post here was for me (initial) a reason to register on this website. I’m very interested in LED lighting/dimming. I have build a T5 compact dim (PIC) in my current tank (a modified Red Sea Max) and I want to use this circuit to generate a reference power that will regulate the brightness (is this understandable English? ;-) 

The timer/dimmer circuit that I use now is a commercial product: Flora-mate. It is used to dim Tube Lights by analog 10v. However the device is not sending a voltage but is – and I hope you understand my English – is used to pull down the controllers dimsignal to 0. As you probably know this type of electronic controllers generate their own 10 volt. Actually the timer/dimmer is working as manual putting a shortcut wire on the 0-10v connection or a trimmer (potentiometer). Anyway the owner has given me the opportunity to use the original schematics to build my own model. I needed a much smaller model of the circuit to build it the hood of my tank. Look at the modificaties on my website. Since many people in The Netherlands are using this timer/dimmer I want to build for this timer/dimmer (under TAPR open-source license) an ‘add-on’ led dimming driver. A module that can be attached to the original model without the need to modify the original. So as much as possible people who do own the Flora-mate can use this module by simply connecting it.

As soon I am allowed to post URL's I will do! (goto 3w eliveld.nl - select 12 maart 2008 in Sitemap to read more about the Flora-mate) For now I just have a few questions:

I noticed that in you’re model a 900 hz is used to generate a ramp. Is this frequency not a problem in your household? Most ramp generators I know off generate between 100 and 300 hz. Any idea’s what effects could be on fish or plants? And any idea’s what kind of colour leds are best?

About the picture you published: as you mentioned is the eagle board not the same as the one on the photo. On the board many more capacitors are placed while on the photo a transitor is visible. In the schematic the capacitors are drawn. However its not clear why they are there. (just for flattening the power?) On the photo I see a blue trimmer (dont know name in English). Where is it in the schematic? And what is it for?

Hope to hear from you soon!

Kind regards, Erwin


----------



## eSwYeL (Nov 19, 2010)

Can i use arduino to control the dimming? tq


----------



## insta (Jan 27, 2010)

E.Eliveld said:


> Hello, Insta,
> 
> I realize a kind of late response but you’re post here was for me (initial) a reason to register on this website. I’m very interested in LED lighting/dimming. I have build a T5 compact dim (PIC) in my current tank (a modified Red Sea Max) and I want to use this circuit to generate a reference power that will regulate the brightness (is this understandable English? ;-)
> 
> ...


Goodness, Erwin, I'm so sorry to have missed your post!

If I'm understanding you correctly, you can in fact drive this dimmer straight from a Floramate if it outputs a variable analog voltage -- in fact that's the entire purpose of this circuit! It will require no modifications to do so. Use 10v as VCC, and feed the variable output into the input.

I chose 900hz just because it seemed like a useful number. It was completely arbitrary. Change C5 to change the frequency.

As for errata, the photos and the Eagle board are NOT identical, they just do the same thing. The photos are of the first version. I did make a few hardware changes since then. I removed a trimmer and replaced it with fixed resistors. I did add more filtering capacitors -- large electrolytics to help with sags when the driving op-amps change state, and small electrolytics (or large ceramics) to help control ringing. They're just for stability. The transistor in the original was to fire the MOSFET -- turns out its better to just let the op-amps do that for as low of a frequency as I'm using, since they both push and pull at a few milliamps (enough to switch the FETs on in a few microseconds).

Incidentally, I used a larger version of this circuit (at a 50khz frequency) to power a flyback transformer. By feeding music into the voltage input, I can make musical arcs  I actually made my own MOSFET driver for that, with a 4011 quad-NAND gate driving two 2N2222 transistors to slam the MOSFET gate open and shut. But I'm also using an 800V 10A FET...


----------



## mistergreen (Dec 9, 2006)

eSwYeL said:


> Can i use arduino to control the dimming? tq


yes, there are a few PWM outputs on the board.


----------



## eSwYeL (Nov 19, 2010)

can i just connect the pwm to the board v_signal?


----------



## insta (Jan 27, 2010)

You really need to not use my dimmer with your Arduino. Just use a low-side driver like I said in PM. I don't have time to redraw the schematic from the design notes for whichever one you pick.


----------



## eSwYeL (Nov 19, 2010)

Thank you for the reply, i'll try the low-side driver like you mentioned in PM. About the capacitor, can you tell me whare do the 2 100uf capacitor go in the eagle board. which is the 16v and 50v? is it C1=16v and C3=50v or the other way around. tq..:help:

1 - $0.15 - 3w.allelectronics.com/make-a-store/category/140100/Capacitors/Electrolytic-Radial/1.html (100 uF, 16V)
1 - $0.30 - 3w.allelectronics.com/make-a-store/category/140100/Capacitors/Electrolytic-Radial/1.html (100 uF, 50V)



insta said:


> You really need to not use my dimmer with your Arduino. Just use a low-side driver like I said in PM. I don't have time to redraw the schematic from the design notes for whichever one you pick.


----------



## insta (Jan 27, 2010)

C3 was the 50v cap. It's incase you run higher than 10-12v for the LEDs.


----------



## eSwYeL (Nov 19, 2010)

Ok... thanks bro. insta... gonna build the board and try running it with arduino. i'll update this thread once its finish. thanks for the good DIY idea.roud:



insta said:


> C3 was the 50v cap. It's incase you run higher than 10-12v for the LEDs.


----------



## E.Eliveld (Jun 19, 2010)

Thanks for the reply, it seems now that its my time to be late ;-)

Next year I will start to modify second RSM , for now I started to disassemble it and I'm looking around for the LED's.

Erwin


----------



## E.Eliveld (Jun 19, 2010)

Thanks for the reply, it seems now that its my time to be late ;-)

Next year I will start to modify second RSM , for now I started to disassemble it and I'm looking around for the LED's.

Erwin


----------



## newaisa (Nov 15, 2011)

First of all, sorry to have digged this 1 year old topic now.

But the information I got here seems too good to miss.
I am looking into building a PWM controller myself.
But I need to have 10 channels of PWM output (5V). Each channel I will need around 3A.
The schematic posted by insta has cleared my doubt on the high current switching.

However I still could not figure out which microcontroller I can use to control 10 channels of PWM independently.
Please suggest


----------



## Naekuh (Oct 19, 2011)

look for a TEC PWM controller.

although 10 channels is asking for rare... and 3amps on top of 10 channels is asking for super rare... 
30amp controller... mmmm.... lol... where? 

lol...


----------



## E.Eliveld (Jun 19, 2010)

newaisa said:


> However I still could not figure out which microcontroller I can use to control 10 channels of PWM independently.
> Please suggest


Hello,

I'm not sure if I do understand you correctly... You want to switch 10 channels, 3 amp and 5 V each?
As far as I know an Arduino can switch max 6 channels? (and only 3 are hardware? - maybee I'm mistaking but 10 is impossible)

If you want to control 10 channels you need something like a PC to control it I believe. Most controlcards have 8 (or less) exits.

Just to clarify some design steps:

1)create one ramp generator and feed this to 10 PWM drivers.
2)control PWM drivers with clocks to send start and stop signals?

Would this in principle be sufficient?

Erwin


----------



## newaisa (Nov 15, 2011)

Naekuh said:


> look for a TEC PWM controller.
> 
> although 10 channels is asking for rare... and 3amps on top of 10 channels is asking for super rare...
> 30amp controller... mmmm.... lol... where?
> ...


I thought the same as well before this until i found this 10 minutes ago:
http://www.instructables.com/id/Control-Ikea-Dioder-LED-Strip-with-Arduino-16X-P/

Turns out it is really IMPOSSIBLE as you said to do it with arduino board alone. But with this separate 16 channel 2A board I am very close to what I'm looking for.
I think I will just follow this approach and see how it turns out. Parts that I need to change are those mosfet in order to support higher current.

Thanks for all the comments given.


----------

