Astable 555 supply voltage dependent frequency - Page 1
Forum section: electronics / beginners

author: TimNJ
author_rank: Super Contributor
timestamp: June 04, 2016, 05:23:40 am
content: Hi all,I've been an electronics enthusiast for many years now and I've never actually gotten my own board done, so I figured I'd change that and try something simple. I'm thinking about doing a simple 555 organ, operating the 555 in astable mode, configured for 50% duty cycle.I breadboarded the circuit which I found from this page:http://www.electronics-tutorials.ws/waveforms/555_oscillator.htmlIt works just fine, providing a good square wave with a duty cycle of 50% +/- 5% or so. However, when I change the supply voltage, the output frequency also changes. Since the 555 has upper and lower comparator limits which are located atfractions of the supply voltage, I'm not sure why the frequency would also change. Plus the frequency equation for the 555 configured for a 50% duty cycle is f = 1/(1.4*R2*C) which makes it seem voltage independent.So, why is it so?Thank you,Tim

author: Rerouter
author_rank: Super Contributor
timestamp: June 04, 2016, 05:40:10 am
content: Its likely that the discharge pins resistance changes with voltage, (may be written in datasheet as typical current)

author: TimNJ
author_rank: Super Contributor
timestamp: June 04, 2016, 06:01:18 am
content: Quote from: Rerouter on June 04, 2016, 05:40:10 amIn this case, the discharge pin (pin 7) is left unused. Instead, the capacitor is charged and discharged through R2, which means the RC time constant is the same for both, creating a a 50% duty cycle output.But perhaps it is something along those lines on a different pin?Thanks!

author: Rerouter
author_rank: Super Contributor
timestamp: June 04, 2016, 07:04:32 am
content: yep same for the output aswell,http://www.ti.com/lit/ds/symlink/lm555.pdfPage 5, Output Low,Page 6, Figure 4 Vs Page 7, Figure 5.

author: mikerj
author_rank: Super Contributor
timestamp: June 04, 2016, 08:09:25 am
content: Also what type of capacitor are you using for C1? SMD ceramic caps can be surprisingly sensitive to voltage, even running them at half their rated voltage can give a significant reduction in capacitance.

author: Zero999
author_rank: Super Contributor
timestamp: June 04, 2016, 09:11:30 am
content: Quote from: TimNJ on June 04, 2016, 06:01:18 amYou probably used the TTL NE555/LM555, rather than the CMOS TS555/ICM7555.The TTL 555 has an asymmetrical output voltage swing. If drops more voltage when the output is high and less when low. The duty cycle will not be 50% and the frequency will vary considerably, as the supply voltage changes because the voltage drop is not proportional to the supply voltage.Replace the 555 with the CMOS version and don't load the output. Take the output signal from pin 7 and a suitable pull-up resistor.

author: TimNJ
author_rank: Super Contributor
timestamp: June 04, 2016, 04:58:12 pm
content: Quote from: Rerouter on June 04, 2016, 07:04:32 amThanks for the pointers. From what I gather from the datasheet, the lower the supply voltage (i.e. Vcc = 5V) and the greater the output current, the worse the rail-to-rail performance of the 555. The trigger will switch the state of the flip flop at 2/3Vcc, but the output voltage may only be 2.5V, so it will take much longer for C to charge and thus the frequency of oscillation drops.To test this circuit, I was driving an 8ohm speaker directly from the output of the 555. This was probably causing significant voltage drop and making matters worse. (It might even exceed the 555s max source/sink current.)Quote from: mikerj on June 04, 2016, 08:09:25 amI'm using a through hole 0.1uF 50V X7R ceramic. At least, I believe that's what I have in my stock.Quote from: Hero999 on June 04, 2016, 09:11:30 amI'm not so worried about the 50% duty cycle as I am about keeping frequency independent of supply voltage. Is the voltage drop on the outputinverselyproportional to the supply voltage? A higher Vcc means a smaller drop?Why do you suggest using pin 7 as the output instead of pin 3? It makes sense that it would work, but why is it a better choice?I only had the TTL 555 in stock so I used it. I'm going to try the CMOS 555 and buffer the output and/or design a small transistor amplifier or use an LM386 (or similar) to drive the 8 ohm speaker. Hopefully that will do the trick.Thank you everyone! Really appreciate it.

author: Simon
author_rank: Unknown
timestamp: June 04, 2016, 05:56:42 pm
content: I used a 50V ceramic cap on 5V and got horendous frequency change. The change in voltage may affect the chip a bit but it's the cap that is the biggest problem

author: Simon
author_rank: Unknown
timestamp: June 04, 2016, 05:59:15 pm
content: you don't need R1 also as you are using the output as the charge pin there is a fixed voltage drop on it so it's not proportional to supply voltage as you change it. the LMC555 will be better at this.

author: TimNJ
author_rank: Super Contributor
timestamp: June 04, 2016, 06:13:15 pm
content: Quote from: Simon on June 04, 2016, 05:56:42 pmIdeally, shouldn't the capacitance be independent of the maximum voltage rating of a capacitor at a given voltage? I'm planning on doing this board with (mostly) surface mount parts, and searching Digikey for 0.1uF C0G SMD caps with maximum voltages <50V brings up only a couple of results. In fact 25V is the lowest I can find.Quote from: Simon on June 04, 2016, 05:59:15 pmThe website I got the circuit from said that R1 is there to ensure that C is charged up to Vcc. In my testing, a 100K resistor did keep the duty cycle closer to 50% over range of frequencies. However, that might be flawed.I did some more testing a couple of minutes ago. When changing Vcc from 5V to 10V, there is a significant (audible) change in frequency. However, sweeping Vcc from 10V to 15V resulted in a much smaller change in frequency, which confirms some thoughts on the troubles of using a low supply voltage. Additionally, putting a 1K resistor in series with the 8ohm speaker was helpful in keeping the duty cycle constant.

author: Simon
author_rank: Unknown
timestamp: June 04, 2016, 06:31:40 pm
content: Quote from: TimNJ on June 04, 2016, 06:13:15 pmThe capacitor does not get charged to supply voltage it continually ranges between one third and two thirds of the supply voltage. The reason they have told you to put it in and that you have to fine tune it is because the formulas for a 555 timer assume that your charging resistor comes from the supply voltage which in many cases is actually awkward it is easier to take it from the output. The problem is that the output voltage is always a fixed amount lower than the supply voltage which can be anything between .3 and 1.3 V depending on which variant of the 555 timer you have. So they have proposed this resistor because while it allows the circuit to work under 50% duty which it otherwise would not it needs this resistor to compensate for the fact that the capacitor will charge slightly slower than it will discharge because there is a higher voltage drop on the output when it pulls high versus when it pulls low.

author: TimNJ
author_rank: Super Contributor
timestamp: June 04, 2016, 07:24:11 pm
content: Quote from: Simon on June 04, 2016, 06:31:40 pmThanks!In which case, perhaps I should leave this resistor in? I swapped in a few different resistors there, 50K, 500K and open circuit, and 100K did in fact get the closest to 50% duty. So because there is a greater voltage drop when pin 3 in sourcing current, it presents a smaller voltage to the capacitor and thus the duty cycle >50%. However, if we "trickle" in a little extra current via the 100K resistor, we compensate for that slower charge time? Makes sense if that's right.Also, I'm curious about what you said about using a 50V capacitor. If you have the time, could you elaborate on why you think that happened?I'm not sure the behavior of pin 7 (discharge) which flips states too, but perhaps Hero999 suggested using it because it does NOT exhibit this voltage drop difference between high and low states?Thanks again.

author: edavid
author_rank: Super Contributor
timestamp: June 04, 2016, 07:34:18 pm
content: If you want good frequency stability, you can't use the 50% duty cycle circuit shown.Instead of wasting your time trying to tweak it, use the regular datasheet astable circuit, and add a flip flop on the output to get the 50% duty cycle.Or just use the asymmetrical output - something like 70% will sound better anyway.

author: Simon
author_rank: Unknown
timestamp: June 04, 2016, 07:38:11 pm
content: The value of a ceramic capacitor changes with voltage applied. Some time ago Dave did a video on this and he did in fact use a 555 timer circuit to demonstrate how the capacitance changes by using a ceramic capacitor as the main timing capacitor when he varied the supply voltage as the frequency changed, a little while before that I had found the same myself. Ceramic capacitors are good for bypassing because they are cheap so can be peppered on a board with no concern of the cost and they have very good response times as they have very low ESR. But in timing applications where the capacitance needs to be precise they are awful. Just check the tolerance on your ceramic, it will most likely be something like -20% +50%.Yes but charging voltage is not the same as the discharge voltage if you use the output. Traditionally the charge resistor comes straight from the supply but when you do this care has to be taken that the resistor is not too small as it will also supply current into the discharge pin or in your case the low side transistor of the output. Using the discharge pin and the output to do the discharging is pretty much the same thing. If you look at the block diagram of a 555 timer which I strongly recommend you do and thoroughly read one of the data sheets you will see that pin 7 the discharge pin is simply connected to the collector of an NPN transistor with its emitter connected to ground. In the CMOS version this is a MOSFET transistor. This transistor however can only sink a limited amount of current and due to the way the circuit works out in a traditional a stable configuration you will not be able to take the duty cycle below 50% because there is always more charging resistance than there is discharging resistance you can closely approach 50% only but no less. By using the IC output to both charge and discharge you can achieve full control of the duty cycle from pretty much 0 to 100% but as we have discussed the fact that the output voltage is not always the supply voltage which is the reference for the internal voltage divider there will always be a little bit of guesswork and trial and error.I myself have made a circuit similar to yours to drive a buzzer the duty circle is closer to 60% but I don't really care where you need a different duty from 60% or 50% you can still use the output but you use 2 independent resistors with opposite polarity diode in series with each one so that when the output is high the current flows into the capacitor through one resistor and cannot go into the other as it is blocked by the diode. When the output goes low the resistors change over and the other resistor is used to discharge in this way you can achieve the full range of duty.

author: Simon
author_rank: Unknown
timestamp: June 04, 2016, 07:39:39 pm
content: The duty will vary less at a higher voltage as you found because the fixed voltage drop on the output is much less in proportion to the supply voltage. If say you have 1.3 V drop on the output this will be significant if your supply is 5 V. But at 15 V it is much less relevant but it will alter both the frequency and the duty of your signal.The best capacitors to use for frequency stability with respect to change with voltage are film capacitors. But they are bigger and more expensive something like 5 times more expensive if not more.

author: Zero999
author_rank: Super Contributor
timestamp: June 04, 2016, 08:45:22 pm
content: Quote from: TimNJ on June 04, 2016, 04:58:12 pmTry using a film capacitor instead.QuoteThe voltage drop of the TTL 555 timer's output stage is relatively unaffected by the power supply voltage but the comparator thresholds are. When powered from 5V, the output will be 3.6V and the threshold 3.3V so the capacitor will take much longer to charge, than when the circuit is powered from 15V and the output is 13.6V and threshold is 10V.This is characteristics of the output stage is explained on the data sheet. Looking at a schematic if the 555 output stage may also help.http://www.ti.com/lit/ds/symlink/ne555.pdfQuoteThe voltage drop on the output is dependant on the load on pin 3 so taking it from pin 7 solves the problem.

author: Audioguru
author_rank: Super Contributor
timestamp: June 05, 2016, 01:15:27 am
content: Why do you want to play a squarewave through a speaker? It sounds awful like acid rock "music".

author: timofonic
author_rank: Frequent Contributor
timestamp: June 05, 2016, 02:29:11 am
content: Acid rock is cool to me, but I also love chiptunes too

author: Simon
author_rank: Unknown
timestamp: June 05, 2016, 06:59:15 am
content: I wonder if there is an efficiency argument to be had when driving a magnetic sounding device with a square or sine wave. Presumably the response of whatever restraining mechanism the speaker has is probably sinusoidal? Why give it full voltage before it needs it but then of course it's more difficult to generate a sine wave. I did once get someone ring me up wanting to buy a whole load of those ICL 3086 or is it ICL 8036 chips to create some sort of musical instrument.

author: Zero999
author_rank: Super Contributor
timestamp: June 05, 2016, 10:47:12 am
content: I believe it's more efficient to use a square, than a sine wave to drive a speaker but whether it's suitable for the application is another thing.

author: dentaku
author_rank: Frequent Contributor
timestamp: June 05, 2016, 12:45:34 pm
content: What if you use the regular astable circuit most people know?Just for fun, here's what it can take to make an actual stable musically useful VCO with a 555. It's quite a lot of work if you really want to get that serious, which I doubt you dohttp://electro-music.com/wiki/pmwiki.php?n=Schematics.VCO555ByThomasHenry

author: Zero999
author_rank: Super Contributor
timestamp: June 05, 2016, 07:32:57 pm
content: A 555 timer will not be able to produce more than one note at a time. Why not use a couple of 74HC14s to make 12 oscillators and combine the notes using switches and an audio mixer? The sawtooth waveform on the RC circuit may sound better than a square wave.