Author Topic: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)  (Read 2996 times)

0 Members and 1 Guest are viewing this topic.

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
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.html

I 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.
« Last Edit: June 27, 2019, 09:52:58 pm by doublec4 »
 

Offline GerryR

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: us
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #1 on: June 27, 2019, 11:41:54 pm »
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), RB has to be much greater than RA.  (I think I did this right!)  Have fun!!
Still learning; good judgment comes from experience, which comes from bad judgment!!
 
The following users thanked this post: doublec4

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #2 on: June 28, 2019, 03:06:18 am »
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), RB has to be much greater than RA.  (I think I did this right!)  Have fun!!

Ah 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 happens :) Thanks!
 

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #3 on: June 28, 2019, 11:23:06 am »
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

 

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #4 on: June 28, 2019, 01:16:20 pm »
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/why

Since 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 bit
  • Lower 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!

 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3382
  • Country: gb
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #5 on: June 28, 2019, 01:33:50 pm »
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.
 

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #6 on: June 28, 2019, 02:05:11 pm »
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.

Just tried what you suggested and it drastically increases the flashing rate  :-\
 

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #7 on: June 28, 2019, 02:41:16 pm »
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.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #8 on: June 28, 2019, 02:53:04 pm »
Why doesn't one of the outputs of the Flasher just drive the Reset of the PWM Generator.
.  That took much longer than I thought it would.
 

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #9 on: June 28, 2019, 03:10:19 pm »
Why doesn't one of the outputs of the Flasher just drive the Reset of the PWM Generator.

That's what I'm doing now (see above RST and Vcc pin are 4/8) :)
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #10 on: June 28, 2019, 06:48:48 pm »
The PWM circuit has an RC time constant of roughly,, half a meg times 10nF.
>> 5e5*10e-9
ans =  0.0050000

While the right section has a time constant of 1M * 20uF = 20s

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

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3382
  • Country: gb
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #11 on: June 28, 2019, 09:02:49 pm »
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.

Just tried what you suggested and it drastically increases the flashing rate  :-\

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

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #12 on: June 29, 2019, 03:43:21 am »
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.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #13 on: June 29, 2019, 02:11:39 pm »
"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.
.  That took much longer than I thought it would.
 
The following users thanked this post: doublec4

Offline Arjunan M R

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #14 on: June 29, 2019, 02:53:09 pm »
I did not have a 0.01uF cap on the Flasher 555 timer because the diagram I based it off of did not.
If you don't know, to type µ hold down Alt+2+3+0. ;) :)
« Last Edit: June 29, 2019, 02:55:28 pm by Arjunan M R »
 
The following users thanked this post: doublec4

Offline GerryR

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: us
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #15 on: June 29, 2019, 03:47:32 pm »
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!!
Still learning; good judgment comes from experience, which comes from bad judgment!!
 
The following users thanked this post: doublec4

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #16 on: July 02, 2019, 04:55:03 am »
"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.

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

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #17 on: July 02, 2019, 04:58:48 am »
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!!

Interesting! If you get the chance to bread board this, I'd like to see what your results are.

Thanks!
 

Offline GerryR

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: us
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #18 on: July 03, 2019, 08:22:33 pm »
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.
« Last Edit: July 03, 2019, 08:33:58 pm by GerryR »
Still learning; good judgment comes from experience, which comes from bad judgment!!
 
The following users thanked this post: doublec4

Offline doublec4Topic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #19 on: July 04, 2019, 11:30:09 am »
I am certainly going to give this a try this week, thanks! :)
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3382
  • Country: gb
Re: Help diagnosing this dual 555 timer circuit please (PWM + Blinking)
« Reply #20 on: July 04, 2019, 11:53:10 am »
I am certainly going to give this a try this week, thanks! :)

Make sure you add power supply decoupling caps from the start.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf