Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

555 square wave

Status
Not open for further replies.

shaneshane1

New Member
Hi im trying to work out how to get a 1 second square wave from a 555, im not to sure how to obtain this wave.

I want the output to be High for 1 second and then low for 1 second and so on, i have searched google, but cant find anything i can fully understand.
 
shaneshane1 said:
Hi im trying to work out how to get a 1 second square wave from a 555, im not to sure how to obtain this wave.

I want the output to be High for 1 second and then low for 1 second and so on, i have searched google, but cant find anything i can fully understand.
hi,
As pointed out lots of examples on the web.
When you calculate the frequency for the 1sec On, 1sec OFF, remember its
0.5HZ not 1HZ.
 
I went and searched google to try and find how to get a 1second square wave using a 555, well i found many sites describing how to get the square wave, but not the times that i want,

i have looked at the formulars, and i can work out how to get the high pulse but not the low, meaning i know the total resistance of both resistors to obtain 1second high, but dont know how to split the resistance to get the 1second low? eg:

t1(High) = .693 X (R1+R2) X C. dont know resistance?

t2(low) = .693 x R2 x C dont know resistance?


i can work out the total resistace for t1(high) by doing this equation

100(1second) / 0.000470(capacitor) = 212765.957 / .693 = 307021 ohms


so 307K is the R1+R2 total using a 470uF cap, im probly going about this all wrong,but i cant find how to work it out????????

I want to use the high/low times to find the resistors,not the resistors to find the high/low times?
 

Attachments

  • 555.PNG
    555.PNG
    3.7 KB · Views: 293
Last edited:
Your 555 circuit has different charge and discharge times so the output is not a square-wave.
You can bypass one resistor with a diode so that charge and discharge times are the same or you can change the circuit slightly like this:
 

Attachments

  • 555 square wave.PNG
    555 square wave.PNG
    9.6 KB · Views: 301
audioguru said:
Your 555 circuit has different charge and discharge times so the output is not a square-wave.
You can bypass one resistor with a diode so that charge and discharge times are the same or you can change the circuit slightly like this:

i went with the bypass over R2 (R1 and R2 are of equel value) with a diode and got an even high/low,thanks!!!

so if i want 1second high and 1second low would the formula go like this

2(2seconds in total) divided by 0.000470uF(cap) = 4255.31915

and then

4255.31915 divded by 0.693 = 6140ohms total (for both resistors)

so i half that so its 3070ohms each (R1 & R2) equaling 1second high and 1second low??? i dont currently have these resistors to check if im right
 
Look at those big numbers.
OOps. I dropped my slide-rule in my peanut butter. I'll calculate it tomorrow when my dog licks it clean.
 
shaneshane1 said:
I went and searched google to try and find how to get a 1second square wave using a 555, well i found many sites describing how to get the square wave, but not the times that i want.

The traditional way a 555 is wired to generate a 50% duty cycle is given in the datasheet, page 10, including formulas for both high and low times:

https://www.electro-tech-online.com/custompdfs/2007/12/LM555.pdf

EDIT: If you don't want to do much math, just figure out the ON time with the standard equation: t1 = 0.693 Ra C, which gives 31k for 1s. According to the datasheet, Rb cannot be greater than 1/2 Ra in this mode, so stick a 20k trimpot in place of Rb, and crank it until you get your 50% duty cycle. Then replace the trimmer with the respective value.

Or, do the math :)

Corey
 
Last edited:
well the way i worked it out ( after a long time ) was if i reversed the equation from an example, i can get my answer from whatever seconds i choose eg:

.693 x 10,000(ohms) x 0.000470(farads) = 3.2571 seconds

so if i divide everything backwards this is what i get.

3.2571(seconds) / 0.000470(farads) / .693 = 10,000(ohms) 10K

so i would assume that this is a correct way of working this out?
 
shaneshane1 said:
well the way i worked it out ( after a long time ) was if i reversed the equation from an example, i can get my answer from whatever seconds i choose eg:

.693 x 10,000(ohms) x 0.000470(farads) = 3.2571 seconds
so if i divide everything backwards this is what i get.
3.2571(seconds) / 0.000470(farads) / .693 = 10,000(ohms) 10K
so i would assume that this is a correct way of working this out?

Yes; that's called solving for R.

They give t1 = 0.693 Ra C

So, Ra = t1 / 0.693 C

(BTW, you say you want to use a 47uF cap, but keep using 470uF. If so, you want 0.000047F, not 0.000470uF. My example in the previous post assumes you want 47uF...)

Corey
 
shaneshane1 said:
No it was just a typing error, i meant 470uF not 47uF, i just fixed it!!!

You could make your circuit smaller by using the 47uF cap, or even smaller. There's no reason to go that big...

Wired the way I indicated, with 47uF, Ra 31k, and Rb ~13k, you get your 0.5Hz, 50% duty cycle square wave out of a 555, without having to add diodes, etc.

FYI,
Corey
 
saturn1bguy said:
You could make your circuit smaller by using the 47uF cap, or even smaller. There's no reason to go that big...

Wired the way I indicated, with 47uF, Ra 31k, and Rb ~13k, you get your 0.5Hz, 50% duty cycle square wave out of a 555, without having to add diodes, etc.

FYI,
Corey


at the time all i had was 470uF and a hole heap of resistor, so i was just going of what i had!, you metioned Ra 31K and 13K for the resistors, how did you work out how to get the 13K, did you use a Trimpot? or use math?
 
Audioguru, I have not seen that circuit with pin 7 (discharge) left open before. How close to 50% duty cycle does it give? John
 
jpanhalt said:
Audioguru, I have not seen that circuit with pin 7 (discharge) left open before. How close to 50% duty cycle does it give? John
I never made the circuit but it is close to 50-50.
The trigger threshold for pin 2 is 33.3% of the supply voltage and for pin 6 it is 66.6%. But the output sinks 0.01V to 2.5V from ground and sources 1.3V to 2.5V from the positive supply depending on the amount of load current. It is best with a huge hot 200mA load.
 
Thanks. I have always used the diode to give easily controlled duty cycles. I will have to try that alternative some day. John
 
shaneshane1 said:
You metioned Ra 31K and 13K for the resistors, how did you work out how to get the 13K, did you use a Trimpot? or use math?

Perhaps you didn't read the referenced LM555 datasheet? With a 555 wired that way for a 50% duty cycle,

1) The text indicated that Rb will always be less than 1/2 the value of Ra, and
2) If you look at their example [Fig. 14] one can ratiometrically ballpark the value of Rb. For your circuit it was about 13k (22k/51k * 31k = ~13k).

I've built this circuit many times, but didn't breadboard it up for you, no. The trimpot method is a cheat, but very quick and effective. I just did that math, and it works out too :)

FYI,
Corey
 
The 555 timer has always been an interesting IC for me. I had not seen the particular data sheet by National so I did the math with the components shown for figure 14. I came up with about a 6% time difference between
t1 and t2 with Ra 51K, Rb 22K, and C .01uF. I then built the circuit and looking close on the scope I could see a slight time difference between t1 and t2. I then measured the frequency on my counter and the frequency was 1.398KHZ. I then used the 51K and the .01uF and built the circuit posted by Audioguru with the charging and discharging path from pin 3 of the timer. There was no load on the timer as suggested by Audioguru, and there was a clearly noticable difference between t1 and t2 times. The frequency measured was 1.236KHZ. I then put a 1K pull-up resistor from pin 3 to Vcc.
The waveform had equal times for t1 and t2. The frequency measured as 1.357KHZ.
Looking in my copy of,"The 555 timer applications sourcebook",by Howard Berlin he recommends the pull up resistor from pin 3 to Vcc and the value should be at least 1/10 the value of the resistor from pin 3 to pins 2 and 6.
 
jpanhalt said:
Audioguru, I have not seen that circuit with pin 7 (discharge) left open before. How close to 50% duty cycle does it give? John
If you use a CMOS 555 with a high resistance load and high resistance feedback (>100k), the outputs will swing nearly rail-to-rail. The duty cycle will then be very close to 50%.
 
Well after alot of testing different ways of being able to do this, the best and most accurate way that i have found is what audioguru had suggested i do, and thats to add a diode across one of my resistors,

if i use two resistors of the same value, with a diode to bypass one resistor i get an even high/low output everytime.

so say i want 3.2seconds high and 3seconds low using a 470uF cap, i do this


3.2/0.000470 = 6930 then 6930/.693 = 10K resistor

so i use two 10K resistors(one with a diode) and i get 3.2seconds high and 3.2seconds low, and its very accurate.

saves the hastle of having to work out the other resistor thats needed if i just use two the same!!!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top