555 timer, 50% duty cycle astable, run from 5V

  • Thread starter Borek
  • Start date
  • #1
Borek
Mentor
28,441
2,837

Main Question or Discussion Point

Standard disclaimer: I know next to nothing about electronics (which doesn't stop me from having fun :wink: )

I have a buzzer here that I am trying to run from an 555 based oscillator. I need around 2700 Hz and 50% duty cycle, and it would be best to run whole thing from 5V. 50% duty cycle is not something that can be done in a standard way (by "standard" I mean "described in the datasheet"), but I found this suggestion (here):

tim58a.gif


I used 47.5 nF for C1 and determined (using 10k potentiometer) that R2 of 7.46 kΩ (both R and C are measured, not read from the element, so they are reasonably accurate) gives more or less the frequency I need. That was a bit surprising, as for those RC frequency calculated from the formula given should be around 2035 Hz, which is quite off. So - my first question is - any ideas why the difference? (Frequency was measured with two different devices and they gave very similar result, within 1%). Duty cycle was not 50%, but not that far, buzzer was quite happy with that.

But, initially to measure the frequency I used an oscilloscope (DIY DSO138) which I have to run from 9V, and having only one adjustable power supply I initially run the oscillator from 9 V as well.

IMG_8381.jpg


Later I switched the oscillator to 5V - and things got weird. Not only the frequency has changed, but also the duty cycle, and the upper voltage is not constant, it is rising a bit during the "on" phase.

IMG_8382.jpg


Datasheet says nothing about such a behavior of 555, and 5V is in the recommended range of 4.5-16.

And ideas what is happening? Is it an effect of the non-standard use of the chip, or is it something to be expected when working close to the minimum required voltages?
 

Answers and Replies

  • #2
Baluncore
Science Advisor
2019 Award
7,721
2,672
Remove your R1.
Set frequency with R2 and C1.
NE555 is then symmetrical schmitt-trigger with thresholds Vcc/3, 2*Vcc/3.

Maybe put a pull-up resistor or your load between pin 3 output and Vcc.
Pull-up R should be << R2. Increase value of R2 while reduce C1 to taste.
An alternative is to take the R2 drive from the discharge pin 7 open-collector with a low value pull-up.
 
  • #3
jim hardy
Science Advisor
Gold Member
2019 Award
Dearly Missed
9,839
4,873
They don't tell you in the 555 documentation that to get 50% duty cycle you can drive the timing R&C from output pin .. The datasheets used to say 50% was not achievable , i dont know if they still do..

Baluncore's fix is the way to go IMHO .

old jim
 
  • #4
Tom.G
Science Advisor
3,236
1,979
For the basic 555 astable circuit see pg.11, fig.12 of: http://www.ti.com/lit/ds/slfs022i/slfs022i.pdf

Then add "D" as shown at the left edge below. This makes
  • Output High time = 0.72 x RA x C (approx. - the 0.72 makes RA a little lower than expected to account for the diode drop.)
  • Output Low time = 0.693 x RB

blob.jpg
 
  • #5
Baluncore
Science Advisor
2019 Award
7,721
2,672
@Borek.
I suspect your "buzzer" is resonant and so may only be reproducing the fundamental of the square wave. The transducer is probably not responding to the odd harmonics that make the square wave. The duty cycle only controls the harmonic content, so it is probably unimportant. Anything close to 50% duty will have a high amplitude fundamental. If the buzzer does respond to harmonics then will harmonic content matter that much?

If the duty cycle is not 50% then even harmonics will be present. As the duty cycle changes various harmonics will be reduced. At duty cycles with integer ratios some harmonics will be completely missing. For example at 25% duty = ¼, every 4th harmonic will be missing. At 20% every 5th harmonic will be missing. The special case is 50% = ½ when every second harmonic is missing, which is consistent with getting only odd harmonics from a true square wave.

If a precise 50% duty cycle is needed then run the oscillator at twice the required frequency and use a D-type flip-flop to divide the output frequency by two.

The NE555 was designed to drive TTL logic. That is why active-low logic is used and why there was no need for the output voltage to go all the way to the positive supply. The unpredictable high output voltage explains why deriving a timing voltage from the output causes problems. The designer of the circuit you found employed R1 to compensate for the reduced Vout when high.

Attached is an NE555 circuit having very close to 50% duty cycle. The frequency will be close to 2.70 kHz when Ct = 10nF and Rt = 26kΩ. Frequency should be independent of supply voltage.
 

Attachments

  • #6
Borek
Mentor
28,441
2,837
They don't tell you in the 555 documentation that to get 50% duty cycle you can drive the timing R&C from output pin .. The datasheets used to say 50% was not achievable , i dont know if they still do..
As far as I can tell the datasheet (the one Tom.G linked to, same one I consulted before posting) doesn't say anything about whether it is possible to get 50% duty or not. It states "SEPTEMBER 1973–REVISED SEPTEMBER 2014" though, so it is quite likely it is a later change. But, the datasheet shows just a basic a-stable circuit, and the one I tried to use is not something from the datasheet.

@Tom.G - the version with diode added is one of things to play with, thanks for the idea.
 
  • #7
jim hardy
Science Advisor
Gold Member
2019 Award
Dearly Missed
9,839
4,873
As far as I can tell the datasheet (the one Tom.G linked to, same one I consulted before posting) doesn't say anything about whether it is possible to get 50% duty or not.
Sneaky aren't they ?
Set either of these to 50% and solve for ratio of RA to RB
page 11 of datasheet

upload_2017-8-26_16-11-34.png


0.5 = RB / (RA + 2RB)

0.5 (RA + 2RB) = RB

RA = 0 which shorts supply during discharge.

A constant current source in place of RA might be made to work.
 

Attachments

  • #8
Borek
Mentor
28,441
2,837
I suspect your "buzzer" is resonant and so may only be reproducing the fundamental of the square wave.
Yes, it has a resonant frequency listed as 2700 Hz (or was it 2730 Hz?). I have it cannibalized from a device in which it is pretty loud and driven by a 50% duty cycle square wave from a microcontroller (through a transistor), which is why I was aiming at more or less the same oscillation parameters. I like how loud it is as I am thinking about making something that will help find lost RC models. Unfortunately I can't find a similar one (google for CFDR02 to see how it looks like) in any of the places I typically buy elements.

Attached is an NE555 circuit having very close to 50% duty cycle. The frequency will be close to 2.70 kHz when Ct = 10nF and Rt = 26kΩ. Frequency should be independent of supply voltage.
Thanks, will try that one too.

Still not clear to me why the circuit works so differently in different voltages. I thought while I am in the recommended range of the Vc it should be rather stable. Apparently I was wrong.
 
  • #9
Tom.G
Science Advisor
3,236
1,979
Still not clear to me why the circuit works so differently in different voltages. I thought while I am in the recommended range of the Vc it should be rather stable. Apparently I was wrong.
The basic astable circuit as given in the data sheet is pretty stable over the voltage range. That's what the chip was designed for. So far, the attempts have been to use it outside its design range. Like using a VW Beetle to pull a plow -- It may work, sometimes, but not very well.

@Baluncore had the "correct" approach for 50% duty cycle. The rest of us were in the "minimum parts count" box. He leaped outside that box with:
If a precise 50% duty cycle is needed then run the oscillator at twice the required frequency and use a D-type flip-flop to divide the output frequency by two.
EDIT: For completness, a T-type flip-flop is all that's needed but they are harder to find, so most of us use a D-type.
 
  • #10
Borek
Mentor
28,441
2,837
Remove your R1.
Hm, that actually made things worse (even at 9 V) - duty cycle increased to 58% (frequency changed a bit as well, but that's understandable and easy to adjust).

The basic astable circuit as given in the data sheet is pretty stable over the voltage range. That's what the chip was designed for. So far, the attempts have been to use it outside its design range.
Thanks for the confirmation - that was one of my first ideas (even mentioned in the opening post).

I must admit I don't understand why the timer is designed in such a way 50/50 is beyond its basic capabilities, sounds a bit illogical. Perhaps some historical reasons.
 
  • #11
berkeman
Mentor
57,451
7,469
I must admit I don't understand why the timer is designed in such a way 50/50 is beyond its basic capabilities, sounds a bit illogical. Perhaps some historical reasons.
The 555 is not a very stable circuit, so if 50% duty cycle is needed, I think Baluncore has the right idea...
If a precise 50% duty cycle is needed then run the oscillator at twice the required frequency and use a D-type flip-flop to divide the output frequency by two.
 
  • #12
Borek
Mentor
28,441
2,837
Attached is an NE555 circuit having very close to 50% duty cycle. The frequency will be close to 2.70 kHz when Ct = 10nF and Rt = 26kΩ. Frequency should be independent of supply voltage.
squarene555-png.png


Well, frequency changes with the voltage (which is not a problem - circuit will be always run from the same voltage, so I have to get the resistances right just once), but the duty cycle remains fairly constant.

Many thanks.
 
  • #13
jim hardy
Science Advisor
Gold Member
2019 Award
Dearly Missed
9,839
4,873
Well, frequency changes with the voltage (which is not a problem - circuit will be always run from the same voltage, so I have to get the resistances right just once), but the duty cycle remains fairly constant.
Here is what i think is happening:

When driving significant load a 555's output voltage won't make it to the supply rail, it'll sag.. @Baluncore mentioned that earlier. It's one of those pesky little things about 555's .
Observe your 'scope photos
high state output is 3.86 or 7.65 volts
and
that is 1.14 or 1.35 volts short of your 5 or 9 volt supply.
What are implications of that ?

<<< RUNON SENTENCE ALERT - PARSE CAREFULLY>>>>
So - while voltage at capacitor swings between 1/3 and 2/3 Vsupply, because the 555's internal divider tracks Vsupply and that's why 555 is usually pretty indifferent to variations in Vsupply,
BUT
in this schematic -
voltage that's doing the charging, Vout, doesn't track supply nearly so well as the 555's internal voltage divider .
That divider establishes Trigger and Threshold points at 1/3 and 2/3 Vsupply..
So C1's charge time is affected by output voltage sag.
That shows up in your 'scope photos - look at how much longer is 'high' state at 5 volts than 9.

C1 charges while output is high and discharges while it's low.
During charge time I2 flows as red arrow shows, during DISCHARGE time it flows opposite.

555forBorek.jpg

With 5 volt supply charging volts to R2 is only 3.86/5 = 77% what it should be so charging is slower than expected and HIGH state is inordinately long...
In fact , voltage across R2 is nominally 3.86 - 2.5 = 1.36 instead of 5 - 2.5 = 2.5 .
That means I2 is low to tune of 1.36/2.5 = 54% and your scope shows high state is nearly 50% longer at 5 volts than at 9.
With 9 volt supply, charging voltage to R2 is 7.65/9 = 85% what it should be and I2 is nominal 79% what it should be, a vast improvement over 54%..

So, when supply voltage changes, the charge time changes accordingly, hence frequency, all on account of output sag..

That suggests-
An interesting experiment would be to try your circuit without the buzzer. Then only load on 555 is charging current of a milliamp or less. Then the output should hardly sag at all giving you more consistent charging voltage.

If that squares away the duty cycle and frequency, the mystery disappears which in my book is plenty of payoff by itself.

It also opens the door to a simple fix -
Connect your buzzer between Vsupply and DISCHARGE pin. DISCHARGE pin can sink as much current as Output pin , just can't source any, but with that connection it isn't asked to..

worth a try ? I'm always up to learn something.

old jim
 
Last edited:
  • Like
Likes Baluncore
  • #14
Baluncore
Science Advisor
2019 Award
7,721
2,672
(google for CFDR02 to see how it looks like)
Can you please measure the DC resistance of the buzzer. That will tell us if it is a coil of wire or a piezo element.
If it is a coil of wire then connect it between the positive supply and output to pull the output signal up that last volt.
 
  • Like
Likes jim hardy
  • #15
Borek
Mentor
28,441
2,837
OK guys, sorry to keep you waiting - it is not that I ignored your posts, just got sidetracked by the real life.

First of all, to make things easier (for me) to analyze, I combined all the important circuits together, using identical convention and as similar placement of elements as possible. That helped me realize that Baluncore circuit is just a standard astable configuration, so the duty cycle should be 25/(1+2*25) = 25/51.

555_oscillators.png


Second - I am chaotic and lousy :frown: Net effect is that I am not able to reproduce some of the results I got earlier. At least in one case I misconnected the wire and I was measuring the frequency of the floating output (should it really matter? I understand high load can be a problem for the reasons Jim described, but lack of load?).

Third - the buzzer has a DC resistance of 15 Ω (but it probably doesn't matter, see below).

Four - frequency change when changing the supply voltage is most likely not because of the load connected to the output. While in some of the tests I did buzzer was connected directly to the output, initially I was not aware of the fact I can draw 200 mA from the chip so I connected the buzzer through a 1 kΩ (or 100 Ω) resistor and 2N2222 transistor, I assume that means the load was negligible.

Today I did another trial, using Baluncore's circuit, again with a transistor and with a much higher Rload (1 kΩ, can't use 100 Ω as the transistor gets saturated):

Untitled-2.png


When changing voltage the duty cycle remains almost constant, but the frequency again changes from 2.7 kHz at 5 V to 3.3 kHz at 9 V.
 
  • #17
Baluncore
Science Advisor
2019 Award
7,721
2,672
@Borek.
Just a couple of notes.

You have big changes of load current on the supply. Accurate timing is dependent on Vcc remaining stable throughout the cycle. Have you looked for noise on your Vcc rail?

The Spk1 resistance of 15 ohms indicates an inductive winding. You need to look at the voltage across Spk1 to see if it has a negative spike when it turns off. Emitter followers are less suseptable to flyback damage, but you might need to place a reverse biased power diode across Spk1 as a flyback diode to catch any off spike.
 
  • #18
jim hardy
Science Advisor
Gold Member
2019 Award
Dearly Missed
9,839
4,873
You have big changes of load current on the supply. Accurate timing is dependent on Vcc remaining stable throughout the cycle. Have you looked for noise on your Vcc rail?
good catch. From 555 datasheet:

upload_2017-9-2_19-14-4.png



i'm wondering if Borek's supply is up to the task.

From CFDR-02 datasheet at http://download.maritex.com.pl/pdfs/ac/CFDR02.pdf
upload_2017-9-2_19-29-35.png


With 50ohm impedance 5 volts is 100 milliamps.

I think i'd try driving it through a capacitor sized to set current to about 30 milliamps at whatever is desired operating voltage.

Thoughts ?
 
  • #19
Tom.G
Science Advisor
3,236
1,979
With 50ohm impedance 5 volts is 100 milliamps.
Yikes! And the thing is rated at 1.5V.
If the frequency isn't required to be 2700Hz, how about the CFD06 or the CFD12 at 2400Hz? (They are cheaper too. Only important if you are buying lots of 'em.)

I think i'd try driving it through a capacitor sized to set current to about 30 milliamps at whatever is desired operating voltage.

Thoughts ?
Perhaps a series diode for flyback voltage protection and series resistor for current limiting if needed. Series configuration is suggested to minimize resonant frequency shift due to damping.
 
  • #20
Baluncore
Science Advisor
2019 Award
7,721
2,672
When changing voltage the duty cycle remains almost constant, but the frequency again changes from 2.7 kHz at 5 V to 3.3 kHz at 9 V.
The only explanation I can see for that frequency variation is an unstable power supply.

You could pull the 1k0 base resistor R11, or pull the 2N2222, to see if frequency still changes without the extra load on the supply. Does disconnecting the load change the frequency or the supply voltage?
 
  • Like
Likes Asymptotic and jim hardy
  • #21
Tom.G
Science Advisor
3,236
1,979
+1 for @Baluncore

The ICM7555 datasheet shows frequency vs. supply voltage stability of 0.5% per Volt; so a power supply, wiring, or electrical noise problem are prime suspects. If you have access to an oscilloscope, troubleshooting should be rapid, even long distance. No worries if not. It's a simple enough circuit that there is only a half dozen or so causes. Any chance you can post a photo of the actual build?

Also suggest that R10 be changed to 1k8 to ensure cutoff of T1. R10 minimum is set by IC4 output characteristics and threshold voltage of T1. The ICM7555 is a CMOS device with only a few milliamps sink current and less than 1mA sourcing current.

Datasheet is at: http://www.intersil.com/content/dam/Intersil/documents/icm7/icm7555-56.pdf

Just an FYI: Transistors component designators are assigned the 'Q prefix'; so the 2N2222 would normally be labeled 'Q1' instead of 'T1'. 'T' normally designates a transformer (a slightly different animal:wink:)
 
Last edited:
  • #22
Borek
Mentor
28,441
2,837
I am baffled more and more (and you will be probably too). I understand how the 555 is designed around the idea of "self compensation", that is, it should work reliably regardless of the Vcc. But, somehow it doesn't behave as expected for me.

The voltage from the power supply is fairly constant. My power supply (KORAD KA3005D) is rated 30 V 5 A, so I assumed I am quite far from stressing it, but better safe than sorry, I have checked that when using 15 V the oscillations are in the 35 mV range. Perhaps not perfect, but definitely way too low to explain the problem.

I modified the circuit again, to use well behaving, small load:

Untitled-1.png


and it didn't help:

Untitled-2.png


Looks like the frequency depends quite linearly on the Vcc. Also, after powering the circuit frequency goes slowly up as if some element characteristics was changing with the temperature (but even at 15 V nothing was warm to touch).

Replaced the IC with another one from the same batch, no changes. They bear the Texas Instruments logo and I bought them in a place I don't expect to be distributing any counterfeits.

Circuit is a wire mess on the breadboard - can it be source of problems?

From CFDR-02 datasheet at
Yikes! And the thing is rated at 1.5V.
Actually I am not sure it is rated 1.5 V. From my googling (and from my attempts at finding the element in places where I can buy it for a reasonable price, without paying an arm and a leg for p&p) looks like there are at least three variants bearing the same symbol, but rated for different voltages.

Just an FYI: Transistors component designators are assigned the 'Q prefix'; so the 2N2222 would normally be labeled 'Q1' instead of 'T1'. 'T' normally designates a transformer (a slightly different animal:wink:)
Perhaps that is an European thing, transistors in all circuits in my books are marked with T and it is a default symbol used by Eagle. Actually each time I see one marked Q I wonder WTH?

The ICM7555 is a CMOS device with only a few milliamps sink current and less than 1mA sourcing current.
I am using NE555P.
 
  • #23
Averagesupernova
Science Advisor
Gold Member
3,601
603
I would suspect some ESR in the cap, or leakage. Try scaling the values of the R and C. Also, try a very small cap in parallel with the R as compensation.
 
  • #24
jim hardy
Science Advisor
Gold Member
2019 Award
Dearly Missed
9,839
4,873
Hmm something warming up ?

You have a 'scope, right ? Two channel ?

Channel 1 on node TRIG-THR
channel 2 on DISCH

once with 5 and once with 9 volt supply.. ?
Looking for low state voltage on discharge pin to be consistent

old jim
 
Last edited:
  • #25
Baluncore
Science Advisor
2019 Award
7,721
2,672
Replaced the IC with another one from the same batch, no changes. They bear the Texas Instruments logo and I bought them in a place I don't expect to be distributing any counterfeits.
Do not be surprised, they may have come originally from China. I purchased TI branded chips from bonitaeshop (bonitathestar[at]gmail[dot]com) guo xiaolong via eBay. My purchase was for Qty 600x NE555 and Qty 600x TL084. Luckily it was for a small run, because it turns out that the TI branded TL084s do not meet the TI specs, but I did not find out soon enough to claim the Paypal or eBay guarantee.

The TL084s supplied are slow, they run on Iqu = 1.1 mA which is less than the 7 mA expected, the input bias current is 1000 times that specified, and they have a cross-over transient step on light loads.

That cross-over transient gave it away. I first tracked that down in 1989 when it caused an LM324 band-pass filter to free-run and completely ignore the small input signal.

Turns out the chips behave just like the real cheap LM324 quad op-amps they are, before they were enhanced by “rebranding” as TI, TL084s in a higher price bracket. I have not wasted more time on the TI branded NE555s but I guess they have specification problems. I thought it was a RoHS Pb content price, not an idiotic substitution or re-branding.

The fake chips need to be destroyed. I informed eBay of the fraud but eBay will not discipline the seller so they are still listed on eBay from several agents of the fraudsters. In colloquial Australian, the agents and suppliers are “a bunch of thieving bastards”. Australians get 3 years Government legislated protection. Maybe I should now report eBay.
http://www.australia.gov.au/information-and-services/public-safety-and-law/consumer-protection

The picture used to sell these items on eBay is different to the chips being delivered.
If anyone has purchased TI, LM324CN with the date code 13WHY28M E4,
or TI, NE555P with the date code 86AX9HM, then you need to check your stock.
 
  • Like
Likes Asymptotic, dlgoff and jim hardy

Related Threads on 555 timer, 50% duty cycle astable, run from 5V

  • Last Post
Replies
5
Views
7K
  • Last Post
Replies
5
Views
10K
Replies
8
Views
6K
Replies
5
Views
5K
  • Last Post
Replies
1
Views
2K
Replies
9
Views
14K
  • Last Post
Replies
2
Views
5K
  • Last Post
Replies
10
Views
7K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
13
Views
5K
Top