PWN Dimmer with NE555 and Mosfet - Page 1
Forum section: electronics / beginners

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 09:39:19 am
content: Greetings,I am planning to make a PWN dimmer based on this schematicI don't have a IRF530 at home though but i got IRF520, IRF740 and IRF3205.The LED strip i am going to use is a short one and runs on 12 V and when i measured it draws around 250 mA.So if i understand the datasheet correctly for IRF520, it would be capable to replace the IRF530 since it supports a Continuous Drain Current of 6.5 A at Tc = 100C and the strip doesn't draw more then 250-300 mA.Am i correct in my assumptions?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 30, 2016, 10:03:48 am
content: Yes, that would be fine.Even better, the gate can be connected to pin 3, and no pullup is needed.I think you'll fine 100nF is more like a blinker or strobe than PWM, so that may need to be smaller, like 10 or 1nF.Tim

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 10:23:30 am
content: You should use a CMOS 555, and if you are using the Discharge pin (7) to drive the MOSFET, the pullup needs to be a *LOT* smaller e.g. 680R, or the MOSFET will spend too much time in the linear region switching on and will tend to overheat if you push the frequency up to get rid of the flicker. Better to drive it from the Output pin (3) as Tim suggested. 10nF should work for the timing cap.

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 10:33:55 am
content: The 555 i have is a NE555.The design i found is from Instructableshttp://www.instructables.com/id/PWM-dimmer-using-NE555-and-MOSFET-with-DIY-alumini/?ALLSTEPSSo i understand you guys right now, the 100nF on pin 2 / 6 should be 10nF or 1 nF.The pullup on pin 7 should be 680R rather then 10K?

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 11:22:13 am
content: Just found Dave's PWM Led Dimmer Video.Except he is using a BD136 instead of a Mosfet like IRF520 and a LMC555CN for the 555, it looks like what you guys has mentioned.Guess i have to order and wait for the CMOS 555 to arrive before making a PWM Dimmer.

author: Yansi
author_rank: Super Contributor
timestamp: May 30, 2016, 11:31:44 am
content: No need for CMOS 555. Works fine even with the bipolar one. Just don't believe every shit from instructables. This is no good source of relevant information. This a site for trolls.Put the gate on pin3 through a 47ohm resistor.And tell us please, what load are you going to drive with it. If it's a motor (or any other inductive load), the PWM frequency need to be high (5+ kHz, 10-20k recommended) and also you will need a fast recovery (or schottky) diode accross the load and adequate circuit layout for that, using enough decoupling so the PWM current ripple would be filtered out enough for the supply. (small RC filter recommended for the 555 supply voltage too, something like few tens of ohms and 100uF cap)

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 11:37:53 am
content: It's a short LED strip which are driven by 12 V and during measurements it was using around 250mA in current.This seems to be the original schematic that the guy on instructables used.Which also has the connection for the LED.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 11:43:50 am
content: The reason to prefer a CMOS 555 is it has a rail-to-rail output, which the bipolar 555s don't have. This affects the On time and makes it greater than the Off time with your pot centered. Also, you have to allow for the input base bias currents, which result in issues with high value timing resistors. OTOH a bipolar 555 typically has about twice the output drive capability when compared to a CMOS one.I suggest you try it on a breadboard with the NE555 you have.N.B. that circuit is UNSUITABLE for high frequency PWM due to the poor turn-on gate drive. If you add a NPN emitter follower between the Discharge pin pullup (make it 1K) and the MOSFET gate, with a Schottky diode b-e, cathode to b, ('poor man's' gate driver for open collector outputs), the turn-on will be much faster and the MOSFET should run cool even if you increase the PWM frequency.

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 11:48:16 am
content: Have ordered some cmos 555.Noticed also that I was out of breadboard, should have it by tomorrow or Wednesday.

author: Yansi
author_rank: Super Contributor
timestamp: May 30, 2016, 12:13:10 pm
content: Quote from: Ian.M on May 30, 2016, 11:43:50 amNonsymetricality of the PWM at centered pot is an invalid argument here. Nobody cares if the PWM is few % off at center when dimming LEDs.What emitter follower? Why at all? CONNECT THE F*CKING GATE TO PIN 3. There is a high current capable totempole output stage suitable for driving mosfets. Not a single reason to use pin 7 with loads of other circuitry to increase the current capability.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 12:51:26 pm
content: The only reason not to connect both the load and the timing resistor to pin 3, is the load can then disturb the timing. However that isn't an issue for low frequency MOSFET gate drive, so yes, simply use pin 3 as both Tim and my self already said in replisy #2 and #3. I offered the emitter follower + diode idea for those that insist on driving the load from pin 7.The other reason to prefer CMOS 555s over bipolar ones is the objectionable shoot-through when a bipolar 555's output switches. The resulting current spike needs a lot of local decoupling, and if you don't get the decoupling right can cause problems with other circuits on the same supply. The classic case is two NE555 chips on the same supply with insufficient Vcc decoupling and no Control pin decoupling. If they are free running at slightly different frequencies (each measured with the other disabled), if both are enabled they will tend to lock together at the higher frequency.

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 01:06:11 pm
content: If Gate is Connected to Pin 3, Where or how does the Potentiometer going to work? Should that also be on Pin 3?

author: Yansi
author_rank: Super Contributor
timestamp: May 30, 2016, 01:15:25 pm
content: Quote from: Ian.M on May 30, 2016, 12:51:26 pmNever seen such behavior, nor have I ever heard of such shootthrough problems with the 555 output drivers. Crossconduction is the usual symptom of complementary output MOS devices.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 01:31:23 pm
content: Its a well known & well documented issue. SeePhilips AN170 NE555 and NE556 applications, page 5, second paragraph of 'GENERAL DESIGN CONSIDERATIONS'. Also see Q4 & Q6 in the FAQ on page 7.A spike of over 100mA would not be unusual.Also seehttps://www.eevblog.com/forum/projects/arrggghh!-injection-locking-between-halves-of-a-556/

author: Yansi
author_rank: Super Contributor
timestamp: May 30, 2016, 02:04:19 pm
content: That really is interesting now. Maybe I haven't encountered any issues because I've been usually quite thorough with supply decoupling. Thank you for the appnote.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 02:16:01 pm
content: Yes. Those of us who actually RTFM and use appropriate decoupling rarely get bit in the ass by such idiosyncrasies. I first ran into it personally back in the early 90's trying to get a 555 to clock a Z80 reliably. The transition glitch was preventing it executing instructions, but the address counter was incrementing! The cure was to rewire the timer with feedback from pin 3, and drive the Z80 from pin 7 with a 1K pullup + as a precaution, add extra decoupling right at the 555 pins.

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 04:51:45 pm
content: Another part of my wondering is the part where you guys / girls say to use pin 3 rather then pin 7, Is there a reason and how do you guys figure that out?Read it somewhere? Experimented with glorious magic smoke or lack of it?Since i am a beginner, i want to learn and not just follow a schematic.Thanks for all the help so far!

author: Audioguru
author_rank: Super Contributor
timestamp: May 30, 2016, 04:53:07 pm
content: Many Instructables are written by kids who are only 10 years old (no kidding!) and who know nothing about electronics.I agree that the pin 3 output of a bipolar 555 can drive the gate of the Mosfet much better because the 10k pullup resistor in the Instructable will take all day to charge the high capacitance of the gate.Intersil shows a 'scope photo of the supply current spike of a bipolar 555 and also explains the need for good supply bypass capacitors.

author: Audioguru
author_rank: Super Contributor
timestamp: May 30, 2016, 05:02:49 pm
content: Quote from: Forser on May 30, 2016, 04:51:45 pmThe gate capacitance of a Mosfet is high (look on its datasheet) and needs a fairly high current to charge it quickly. If it charges slowly then the Mosfet spends time being linear and gets hot.With a 12V supply the 10k pullup resistor has a maximum charging current of only 12V/10k= 1.2mA. The datasheet of the 555 shows that its pin 3 output is rated at 200mA so it can provide plenty of current to quickly charge the gate capacitance of a Mosfet.The pin 3 output current of a Cmos 555 is rated at only 10mA which might not be enough.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 05:12:38 pm
content: I knew it was bad, but didn't remember seeing that bit of NE555 bashing!Its on page 5 of the IntersilICM7555datasheet. Of course they aren't saying what the test conditions are to get a >350mA shoot-through spike in a NE555. I'd guess it would be at max supply voltage.Some CMOS 555s are better than others and 10 mA output source/sink sounds like one of the wimpy ones. The better ones do 40-50mA. Unfortunately with a capacitive load like a power MOSFET gate, there is no way of slamming it through its transition region quickly without drawing a big current spike.

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 06:06:48 pm
content: I am a bit confused regarding the Pin 3 / Pin 7.If Gate on Mosfet is connected to Pin 3, then nothing is connected to Pin 7 and where or how will the Potentiometer work since Gate is on Pin 3.and should i still lower the 100 nF to 10 nF on Pin 2 / 6.Looking at Dave's 555 hack for his LEDs,It's close to the one i have been looking at except he is using Pin 7 to drive the BD136.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 06:39:47 pm
content: Pin 3 (Output) and pin 7 (Discharge) are controlled by the same internal drive signal (when Reset is pulled high), but pin 7 is open collector (it can only pull its load low) and pin 3 is a Totem pole output (which can drive a load both high and low). If you stick an external pullup resistor on pin 7 and make sure all loads are small compared to the pullup current, they'll have basically the same waveform.Dave's version uses a PNP transistor so pin 7 doesn't have to be able to drive the base high.When driving a MOSFET you need to be able to slam the gate from 0V to >8V or so as fast as possible, which pin 7 cant do so both the timing resistor and gate drive should be from pin 3. leave pin 7 open circuit.If it flickers with the original 100nF cap, use a 10nF one instead.

author: Forser
author_rank: Contributor
timestamp: May 30, 2016, 07:37:36 pm
content: So only remove Pin 7, Connect Pin 3 to Gate on MOSFET, lower 100 nF to 10 nf if it flickers.Only Question i have if i use a Mosfet and connect Pin 3 to Gate on Mosfet, should the Pontentionmeter still be connected as it ?

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 08:06:01 pm
content: Yes. Both pot wiper and gate to pin 3 if you are basing your circuit on a modification of the original schematic you posted. If the MOSFET heats up quickly, add a 47R resistor between pin 3 and the gate as Yansi suggested.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: May 30, 2016, 08:20:50 pm
content: Use your NE555, no need for the CMOS version _in this application_. Use the schematic below. Note the Pin 3 and Pin 7 connections; Pin 3 is almost always used as the Output from a 555 astable circuit. Use almost any mosfet; I would prefer IRF3205 for this application. Substitute your LED strip plus any needed dropping resistor for the 12v bulb shown in the schematic. The mosfet will not heat up.Tested and running on my breadboard right now. Provides a pulse width from under 2 percent Hi to about 99 percent Hi at around 215 -230 Hz. Pin 3 output shown at the extremes of the pot setting in the scopeshots below. I used a 50k pot on my breadboard but 10k works fine too but at a higher frequency.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2016, 08:33:49 pm
content: If the MOSFET heats up and it has good gate drive, at a low enough frequency for it to fully switch in <<1% of the period, its a sign it may be oscillating at RF. This is more usually a problem if there is a drain resistor e.g. for current sensing or limiting. A resistor in series with the gate damps any oscillation, and should be fitted as close to the MOSFET as possible. Values between 10 and 100 ohm are usual. In some applications you'll also see a ferrite bead on the gate lead.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: May 30, 2016, 08:52:19 pm
content: One more: mosfet IRF3205 Drain trace at close to maximum duty cycle setting. Nice clean switching, almost no linear region operation or other bad effects. This is with the 12v incandescent bulb as load, drawing a bit less than 250 mA average.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: May 30, 2016, 11:40:13 pm
content: That's right, and with the IRF3205's whopping 8 milliOhms Rds(on)and the circuit's maximum drain current of 300 mA pulled by the LED strip load .... well... let's just say "heatsink optional"......

author: Forser
author_rank: Contributor
timestamp: May 31, 2016, 01:13:45 pm
content: Been building after Schematic from Alsetalokin.Everything starts up fine but very bright already on the lowest potentiometer selection but that isn't a issue.Issue i have is after a second or so, it autodims the Leds and requires to turn off / on the power and power supply reports a Current of 0.03 only even at start.Got a Oscilloscope that i could hook it up to and see if 555 is doing something odd but don't really know where to put the ground from the probe and don't want to blow anything up.If there are any questions about the wiring or something else, just ask.Will tinker around and see if i can figure it out.

author: Forser
author_rank: Contributor
timestamp: May 31, 2016, 05:44:12 pm
content: Solved it, I had misplaced the 1 k resistor and noticed it when i looked more closely at the image of the build Alsetalokin had done.Also changed the wiring so it matched the image, aka, Pin 4 to Pin 8 and Pin 2 to Pin 6.Now it works, also changed the Potentiometer to 200k to dim it more, don't know if that is the correct way of doing it or not.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: May 31, 2016, 07:17:30 pm
content: Glad you got it working.You must want really dim LEDs! You could try increasing the value of the LED series resistor, but this will also make them dimmer at the bright end too.The scope probe ground goes to the circuit common ground. Same as Mosfet Source pin, 555 pin 1, etc.

author: Forser
author_rank: Contributor
timestamp: June 02, 2016, 04:47:29 pm
content: So, spent a few hours on getting the setup moved from breadboard to a perfboard.It works but for some reason, it seems like it isn't dimming but increasing the light instead.Been trying to figure out if i put something wrong and such but can't figure it out.Any clues on how to do a fault search on it?Got access to an Oscilloscope, Multimeters and power source.Sadly, it's a bit of a mess on the backside but i have looked closely with magnifier and don't see any shorts or similar.Thanks in advance for any tips on how to try and solve it, don't need a straight up answer but tips on how to do a fault search so i learn more.

author: Yansi
author_rank: Super Contributor
timestamp: June 02, 2016, 08:55:20 pm
content: Swap the leads going to the ends of the potentiometer resistance track.Hope I guessed your problem.

author: Forser
author_rank: Contributor
timestamp: June 03, 2016, 09:18:04 am
content: @Yansi, When you mean the Leads, you mean the Diodes (1N4148)? I tried that and didn't make any difference.I built up the circuit on the breadboard again (not with the soldered parts) and it works just fine.Can a broken Mosfet be the reason for it to behave like it does?On the breadboard i can go from 300 mA to 100 mA but on the soldered board, it only goes from 300 mA to 200 mA and it looks brighter also so something is off but i can't figure it out, been looking around to see if the wires are correct and such and only thing i can think of is the Mosfet.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: June 03, 2016, 12:41:38 pm
content: No, I don't think your mosfet is broken.It's very difficult to tell from your pad-per-hole construction but it looks to me like you may not have the center pin (wiper) of the pot connected to 555 Pin 2 (and 6) . Correct me if I'm seeing it wrong but it looks to be connected only to the capacitor but not to the Pin 2+6. The capacitor should go between Pins 1 and 2 (or, equivalently, Pin 2 and Ground) and the pot wiper to the Pin 2 side of the capacitor.I think if I were you I'd start over on the circuit board, using thinner wires, more direct routing and a finer tip on your soldering iron. Chalk this one up to practice.Also, if you have a 3-pin version of the blue screw connector, these make very good mosfet sockets so you don't have to solder directly to the mosfet (you have to spread the legs of the TO-220 package a bit). I use them all the time in my own constructions.

author: Forser
author_rank: Contributor
timestamp: June 03, 2016, 01:44:26 pm
content: I rechecked the wires.From center pin on pot, it goes to cap which is connected to pin 2 and there is a wire between pin 6 and 2.On the breadboard, I changed the cap from center pin / pin 2 to cap on pin 2 to ground and center to pin 2.Which resulted on the breadboard a even dimmer led strip.Will rebuild the circuit on a stripboard instead to decrease the number of cables I need to use.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: June 03, 2016, 08:26:46 pm
content: Quote from: Forser on June 03, 2016, 01:44:26 pmNote that on the schematic, the center pin of the pot is connected to Pin 2+6, and the capacitor is connected between Pin 2+6 and Pin 1 (ground).It looks to me like on your circuit board, the center pin of the pot goes _only_ to one side of the capacitor, and the other side of the capacitor is connected to Pins 2+6. If you do have it wired this way, it's not what the schematic shows.QuoteI'm not following you here, I don't understand what you mean. The schematic shows center pin of pot > Pins 2+6, and capacitor between Pins 2+6 and Pin 1 (ground).QuoteThat's probably a good idea.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: June 03, 2016, 11:59:15 pm
content: Also, check the value of your "1k" resistor.Never mind, I was probably reading it from the wrong end (110R 1% vs. 1k 1%)Just for fun I built up the circuit on a pad-per-hole board like yours, although I rarely use these for prototyping. Had to dig up my last genuine Radio Shack board!I wanted to see if I could improve your routing, while still using the same basic component layout that you used.

author: Forser
author_rank: Contributor
timestamp: June 04, 2016, 04:02:18 pm
content: Did a recheck today of the circuit, checked that pin 2 and 6 connected right, the center pin on pot and the cap and so all ground and such.And now it worksFrom full blast to the lowest.Thank you all for your help!

author: Forser
author_rank: Contributor
timestamp: November 13, 2017, 07:22:43 pm
content: After a long time since last post, i am now doing the schematic in KiCad to make it into a PCB.Difference is i want to add two 2-pin connectors for two led strips and i am not sure if the connections on the schematic is correct or not. Each length of strip will be the same length and amperage and power supply will handle the extra amount of amps.Attached the schematic to this post.

author: Zero999
author_rank: Super Contributor
timestamp: November 13, 2017, 09:08:37 pm
content: Quote from: alsetalokin4017 on May 30, 2016, 08:20:50 pmYes that works much better, than charging & discharging the capacitor, from the output.You'll find it's better with a 50k pot. than with a 10k pot. A 100k pot would be better, with a smaller capacitor.