PWM Led dimmer - Page 1
Forum section: electronics / projects

author: somlioy
author_rank: Regular Contributor
timestamp: September 09, 2012, 08:56:03 am
content: HiI'm currently working as an electrician, doing installation on new fishing boats etc. On the bridge we're using LED lamp from schneider electric which can be very bright when driving in the dark. So I thought I'd try to make a led dimmer for din-rail mounting, dimming the controll-lamps.I've surfed the web for schematics and composed my own, so I thought I'd come here for input. I'm fairly new to electronics and I'm not "quite there" understanding how much capacitance I need for the caps. I've tested the pwm circuit on a breadboard and it seems to work fine. But I'd like some input anyway.I'm not quite sure what transistors I will use, so if anyone got an input on that point I'd like that.Edit:After further testing of the dimming circuit it dosent seems to work correctly when using the leds in series with the transistorsw (J3 terminal connector). Leds are powered from a different voltage source at 24 volts. The voltage across the led is about 11volt at 0% duty cycle.Edit:Alright I figured out that issue; I forgot to remove a suppression-diode from the 12v rail down to the collector of Q1, since I tested a fan on the circuit.

author: jackbob
author_rank: Regular Contributor
timestamp: September 11, 2012, 04:43:28 am
content: You are not too far off. A few tips and from the schematic one important error. The 555 should be using pin 7. I will post a new schematic of the 555. Besides that I am not sure how much current the LEDs are pulling but you may want to consider a bigger voltage regulator or more than one working together. That regulator should not run more than 1 amp continuous without proper cooling. That just depends on the size of the project though. The transistors should be mosfets but again it's not critical. There are many small reasons for that, but mosfets are generally better for switching applications. Besides that looks like you got the idea. Keep it up and good job.

author: jackbob
author_rank: Regular Contributor
timestamp: September 11, 2012, 05:15:59 am
content: So here is a basic schematic, I am only using this to show you the 555 circuit not the led's or anything else because you have that part right already. Leave R1 1K and C1 .1uF because those values leave you with a good operating frequency for this project. The cap at pin 5 is optional in almost all 555 projects (mainly just for stabilization). Try using a MOSFET to drive all the led's, MOSFET's will do this with ease. Be sure to use a gate and pull down resistor. Gate resistor to pin 3 can be low (as low as 10 ohms) and are ok up to 1k for general purposes. The pull down resistor is very important and goes between gate and ground to turn the transistor back off, it must be a higher value than the gate resistor! 4k7 usually works great. Thats all for now, If you need further help I will be more than happy to make a whole schematic in multisim. Oh almost forgot, put capacitors in parallel with your led's, they take out the pwm waveform and make it a stable voltage which stops flicker in the led's this is noticeable and annoying at times. (ever drove past a house with led Christmas lights and they appear to flicker?) cheap light manufactures dont add the caps and it is noticeable at least for me.

author: David_AVD
author_rank: Super Contributor
timestamp: September 11, 2012, 07:40:35 am
content: Quote from: jackbob on September 11, 2012, 05:15:59 amThe reason you notice flicker in the Christmas lights is because they are simple half-wave (or full wave) sets run at 50Hz (or 60Hz) mains. They are not PWM, just fairly crude leading edge phase control.If you PWM LEDs at a reasonable rate (> 200Hz) you won't see any flicker. There's no need to "fix" the flicker with capacitors if the PWM is correct to start with.

author: jackbob
author_rank: Regular Contributor
timestamp: September 11, 2012, 07:54:58 am
content: Ya you would have to have super vision to notice it at these operating frequencies. but it can still be noticeable if the duty cycle is low enough and you are traveling fast. If you are moving it is noticeable at arduino 500Hz pwm with a lower duty cycle. They are definitely optional, but to me those are the little details that separate made in USA vs made in China.

author: David_AVD
author_rank: Super Contributor
timestamp: September 11, 2012, 09:33:12 am
content: I can't say I've ever seen capacitors across an LED load to smooth out the PWM, Chinese made or otherwise.

author: somlioy
author_rank: Regular Contributor
timestamp: September 12, 2012, 07:09:13 pm
content: Thanks for your repsonse.Why use pin 7 instead of pin 3? I remember reading somewhere that its better to use pin 3?I thought using a big voltage regulator wouldnt matter since it's only driving the pwm circuit and the transistor? The leds are industrial ones running on an external 24v powersupply with its of circuit from plcs, relays and stuff. This ones to be specific:http://i01.i.aliimg.com/img/pb/926/158/378/378158926_529.JPGFrom what I read using a 0.1µF cap on the 555-timer will give me about 700Hz pulse freq, thought I don't have one right now, so I'm using a 10µF one, which gives me about 100-200Hz. Can't see much flickering with that.Pictures attached; 0.8% duty cycle (according to scope) and 50%. Measurements are made at the collector and ground.Also update my schematic a bit.What type of caps would be best to use for this purpose?

author: PSR B1257
author_rank: Frequent Contributor
timestamp: September 12, 2012, 07:20:17 pm
content: Code:I remember reading somewhere that it was better to use pin 3?WherePin3 is the Output.I build the circuit (linked from jackbob) many times no problems what so ever. But I have never seen a circuit like yours with a resistor connected to pin3 from the potentiometer...

author: somlioy
author_rank: Regular Contributor
timestamp: September 12, 2012, 07:26:01 pm
content: The resistor from pin 3 to the potmeter is to limit the current when it's shorted. Which jackbobs circuit also have, thought its a 1k ohm reistor.http://forum.allaboutcircuits.com/showthread.php?t=45746#4Bascily the circuit I used.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: September 12, 2012, 07:37:25 pm
content: Code:Which jackbobs circuit also haveNo, there isn't any resistor from pin3 to the potentiometer!The 1k is connected from pin7 (Discharge) to Vcc. This connection, which is obviously missing in your circuit.Code:Bascily the circuit I used.But there is pin 7 driving the MOSFET...you should at least copy this circuit right...

author: somlioy
author_rank: Regular Contributor
timestamp: September 12, 2012, 07:55:39 pm
content: Sigh, follow the link in the specific post I linked (post #4). Which will give you this:

author: Kibi
author_rank: Unknown
timestamp: September 13, 2012, 07:43:17 pm
content: Just my 5 cents here.This is a schematic of an LED dimmer project that I have done. This works. I do apologise, it's a bit messy. The potentiometer connects to X4. The wiper of the potentiometer connects to pin 3 of the 555.Once I have finished this project completely, I'll post a project thread about it.

author: jackbob
author_rank: Regular Contributor
timestamp: September 13, 2012, 08:54:01 pm
content: Pin 3 is supposed to be the output if you ever take a peak at the datasheet. A 10uF is kind of large for this I would use a .1 ceramic disk type capacitor.

author: Kibi
author_rank: Unknown
timestamp: September 13, 2012, 09:38:24 pm
content: Yes, know pin 3 s the output, it always has been for as long as can remember. It's even labeled as out on my schematic. I too was a bit surprised when I found this design in this configuration, but it works well.If you look closely, C5 is 10nF, not 10uF.

author: jackbob
author_rank: Regular Contributor
timestamp: September 13, 2012, 10:00:15 pm
content: Simlioy said he was using a 10uF cap which seems a bit too large for this. But I have seen pin 7 used as an output a lot but I don't like it because it is not consistent with the pinouts. I see the same on the tl494 pwm chip a lot too 9 and 10 are the output pins but I see 11 used a lot instead. I'm not sure if there is a reason to use these pins. Anyone know why pin 7 instead of pin3?

author: Kibi
author_rank: Unknown
timestamp: September 13, 2012, 10:23:18 pm
content: I do apologise, I thought you were referring to the capacitor in my schematic.

author: somlioy
author_rank: Regular Contributor
timestamp: September 19, 2012, 09:14:54 pm
content: Finally got the 0.1uF caps. Currently running on 1.2kHZ ish. Also got some 100k pots so will try the other suggested circuit.Does anyone have a clue why my circuit dosent work on 5V? I can't seem to get the pulses down to zero duty cycle. Only get down to 30%. Swapping from 7812 to 7805 in the circuit, nothing else. Also the frequency drops drastically. 200-300Hz

author: David_AVD
author_rank: Super Contributor
timestamp: September 19, 2012, 09:33:21 pm
content: Probably because you're using the 555 in an unusual way. Also missing the capacitor off pin 5.

author: somlioy
author_rank: Regular Contributor
timestamp: September 21, 2012, 09:28:08 pm
content: Alright, do you think the cap on pin 5 is needed?

author: somlioy
author_rank: Regular Contributor
timestamp: October 01, 2012, 05:40:56 pm
content: After hours and hours of fiddling I finally finished my first pcb layout. I'm quite satisfied myself if I may say so.(Clickable)