Help diagnosing this dual 555 timer circuit please (PWM + Blinking) - Page 1
Forum section: electronics / beginners

author: doublec4
author_rank: Regular Contributor
timestamp: June 27, 2019, 09:51:13 pm
content: Hi all,With the help of a few people here I made a PWM circuit that has two discrete duty cycles. It switches between them using a DPDT switch (breadboard prototype uses mechanical switch... eventually might use analog switch on PCB). I tested this circuit to PWM some LED modules at bright and dim... works great!Then, I found this "rail road crossing flashing" circuit:http://www.555-timer-circuits.com/flashing-railroad-lights.htmlI used the output to drive the gates of a P channel and N channel MOSFETs instead of using the diode set up in the circuit since the 555 can't sink/supply enough current for my LED modules. Again, when bread boarded alone this circuit worked well although I had to modify the resistor and capacitor to slow the flash rate down considerably.Next plan was to combine the two circuits to be able to flash the two LED modules back and forth and have a bright/dim mode. See attached circuit.Now this circuit does work.. but what I can't seem to figure out is when I first used it with the 70% PWM circuit going, the flash rate of the second 555 timer increased quite a bit (quick strobe). I had to increase C2 and R7 to the values you see in the attached circuit to get ~2 second period (more of what I am looking for). Then, when I switch to the dim mode (20% PWM) the flash rate is affected again... it slows down again even more. This time it is a slight change, but it is noticeable.Can anyone shed some light as to why this would happen and how I can prevent it? I would like a consistent blinking rate between the two PWM duty cycles if possible.Thanks!Edit: You will notice there are no current limiting resistors for the LEDs in my circuit attached. They are LED "modules"... they have the resistors built into them so I left them out of the circuit diagram.

author: GerryR
author_rank: Frequent Contributor
timestamp: June 27, 2019, 11:41:54 pm
content: First I think you need a .01uf cap from pin 5 to gnd on both of the 555's. Then, if you are trying to make a 1 sec on, 1 sec off flasher, you need to add a resistor from pin 7 to pin 6. I calculate the resistor to be about 1 M with a 1.5 uf cap, and change the existing 1 M resistor to 1 K. Thi= .693 (RA+ RB) C; Tlo= .693 (RB) C. Therefore to get Thi= Tlo(or close), RBhas to be much greater than RA. (I think I did this right!) Have fun!!

author: doublec4
author_rank: Regular Contributor
timestamp: June 28, 2019, 03:06:18 am
content: Quote from: GerryR on June 27, 2019, 11:41:54 pmAh yes, I did have the 0.01uF cap on the PWM 555 timer on the breadboard, I must have missed that when I made the circuit diagram. However, I did not have a 0.01uF cap on the Flasher 555 timer because the diagram I based it off of did not. I will try and add one on the breadboard and see what happens.I'll also give the resistor/caps a try and see what happensThanks!

author: doublec4
author_rank: Regular Contributor
timestamp: June 28, 2019, 11:23:06 am
content: Okay, as mentioned in my last post, I have the 0.01uF cap on the PWM 555timer pin 5 to GND, but I did not have it on the Flasher 555timer pin 5 to GND. When I add it to the Flasher 555 Timer, in bright mode it slows down the flash rate, and in dim mode it speeds the flash rate up, all other things left unchanged. Obviously one circuit is affecting the other in some way that I am not seeing.I will go ahead and try the different circuit for the flasher... something similar is posted here:https://www.electronics-tutorials.ws/waveforms/555_oscillator.html

author: doublec4
author_rank: Regular Contributor
timestamp: June 28, 2019, 01:16:20 pm
content: I tried the changes in the resistor/capacitor combination and placement you suggested GerryR, but the flash rate actually increased dramatically. Same thing happens with similar circuits from that link I posted.When tested on it's own, the circuit flashes at the rate you calculated, same as the circuit in the link I posted. However, as soon as I combine it with the PWM circuit as shown in the circuit I posted, they are interacting in some undesirable way to produce a much faster blinking pattern. I just cannot seem to understand how/whySince the behavior changes when I switch between PWM duty cycles, I feel that it has something to do with that portion of the circuit controlling the duty cycle on the PWM 555 timer. Something about that portion is not "isolated" and it is affecting the flash rate of the Flasher 555 circuit:Higher duty cycle PWM results in higher frequency of blinking in the flasher circuit. Can be compensated for by adding 0.01uF cap on pin 5 of flasher555 and flash rate slows a bitLower PWM duty cycle results in lower frequency of blinking in the flasher circuit. Adding 0.01uF cap on pin 5 of flasher 555timer speeds it up.As always, any more help would be greatly appreciated!

author: mikerj
author_rank: Super Contributor
timestamp: June 28, 2019, 01:33:50 pm
content: The relatively high LED current is almost certainly putting significant noise onto the supply rails and I don't see any supply rail decoupling. Add some bulk capacitance (e.g. 100uF or so) and a 100n ceramic cap per 555, and put them as physically close as possible to the supply and ground pins.

author: doublec4
author_rank: Regular Contributor
timestamp: June 28, 2019, 02:05:11 pm
content: Quote from: mikerj on June 28, 2019, 01:33:50 pmJust tried what you suggested and it drastically increases the flashing rate

author: doublec4
author_rank: Regular Contributor
timestamp: June 28, 2019, 02:41:16 pm
content: In an effort to greatly simplify this whole circuit, I eliminated the alternating flashing between the two LED modules. I put them in parallel to one another now.Also, instead of the flashing 555timer cutting power to the LEDs through the N channel mosfet, it now just directly supplies/cuts power to pin 4/8 of the PWM 555 timer.The lights now flash in unison and the flash rate does not seem to be affected by the PWM signal which is great. I would still really like to understand what was going on in the first circuit and why that approach wasn't working.I will draw up this latest circuit that I just described and post it soon.

author: StillTrying
author_rank: Super Contributor
timestamp: June 28, 2019, 02:53:04 pm
content: Why doesn't one of the outputs of the Flasher just drive the Reset of the PWM Generator.

author: doublec4
author_rank: Regular Contributor
timestamp: June 28, 2019, 03:10:19 pm
content: Quote from: StillTrying on June 28, 2019, 02:53:04 pmThat's what I'm doing now (see above RST and Vcc pin are 4/8)

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 28, 2019, 06:48:48 pm
content: The PWM circuit has an RC time constant of roughly,, half a meg times 10nF.>> 5e5*10e-9ans = 0.0050000While the right section has a time constant of 1M * 20uF = 20sNone of these are close to the 2s that OP is observing.If the circuit starts behaving very differently when decoupling & buffer caps are added, then it is probably because those capacitors are doing their work.Also:Go buy an oscilloscope, they are indispensable for debugging electronic circuits.

author: mikerj
author_rank: Super Contributor
timestamp: June 28, 2019, 09:02:49 pm
content: Quote from: doublec4 on June 28, 2019, 02:05:11 pmIf adding decoupling to the supply rails significantly changes the flashing rate this is telling you there was a bad noise problem. Leave the decoupling caps in place and adjust the timing components to get the flash rate you require.

author: doublec4
author_rank: Regular Contributor
timestamp: June 29, 2019, 03:43:21 am
content: That is the part I am having a hard time understanding though. If I add the decoupling caps shouldn't the flash rate slow back down? Instead it speeds up.I had to have the calculated RC time of the flash circuit at 20s to achieve appx 1Hz flash rate when the two circuits were combined.If I use a RC time of 2s on the flash circuit and test it independently, then of course it flashes as designed. As soon as I combine it with the PWM circuit, even with the decoupling caps, it speeds way up.

author: StillTrying
author_rank: Super Contributor
timestamp: June 29, 2019, 02:11:39 pm
content: "If I add the decoupling caps shouldn't the flash rate slow back down? Instead it speeds up."Where are you adding the decoupling caps.Bipolar 555s draw current spikes of >350mA when they switch, which can cause voltage spikes on the supply, without a 100nF very close to their 1,8 supply pins strange things can happen. Having decoupling on the pin 5 but not the 555's supply can sometimes make things worse.

author: Arjunan M R
author_rank: Regular Contributor
timestamp: June 29, 2019, 02:53:09 pm
content: Quote from: doublec4 on June 28, 2019, 03:06:18 amIf you don't know, to typeµhold down Alt+2+3+0.

author: GerryR
author_rank: Frequent Contributor
timestamp: June 29, 2019, 03:47:32 pm
content: Not sure how you are making out on this, but a simple solution is to send the PWM output to the wiper of a relay and connect your LED's, one to the NO contact and one to the NC contact. Then connect the coil of the relay to the flasher. This keeps both circuits isolated from each other. I haven't bread-boarded your flasher circuit, but I believe you are getting in trouble with the flasher output being tied back to your charging circuit for the flasher and trying to drive the LED circuits as well. Also, it is always a good idea to use a divider circuit when driving a FET or a BJT input. (On the FET, it lowers the input impedance so it is not as susceptible to noise, and on the BJT it gives a place for the base charge to go giving faster off times. If I get time, I will bread-board the flasher / output circuit to see what is going on. Keep having fun!!

author: doublec4
author_rank: Regular Contributor
timestamp: July 02, 2019, 04:55:03 am
content: Quote from: StillTrying on June 29, 2019, 02:11:39 pmI didn't have 100µF but had 50µF that I put across the 12V/GND rails near the circuit. Then the 100nF caps I put close to pin 8 on both circuits. Perhaps the 50µF wasn't enough...

author: doublec4
author_rank: Regular Contributor
timestamp: July 02, 2019, 04:58:48 am
content: Quote from: GerryR on June 29, 2019, 03:47:32 pmInteresting! If you get the chance to bread board this, I'd like to see what your results are.Thanks!

author: GerryR
author_rank: Frequent Contributor
timestamp: July 03, 2019, 08:22:33 pm
content: Attached is what I did so far; I'm still playing. The main differences from your original schematic are the way I set up the flasher and the way I biased the FETs. It appears to work OK. I don't like the way the PWM switching is done in conjunction with the flasher. I prefer doing it with a relay as suggested above. I will try that later. Outside of seeing the PWM output on the supply rail (the way I set it up while bread-boarding), everything appears to work independently and the timing is as calculated.

author: doublec4
author_rank: Regular Contributor
timestamp: July 04, 2019, 11:30:09 am
content: I am certainly going to give this a try this week, thanks!

author: mikerj
author_rank: Super Contributor
timestamp: July 04, 2019, 11:53:10 am
content: Quote from: doublec4 on July 04, 2019, 11:30:09 amMake sure you add power supply decoupling caps from the start.