Electrical – how to make a square wave 1kHz circuit

duty cyclefrequencyoscillator

i want to make a 5V oscillator that has a frequency of 1khz. it will basically go to 5V (HIGH) and then 0 V (low) in a frequency of 1khz with 50% duty cycle.

Best Answer

If you check out this tutorial on 555 timers, the circuit showing in the "basic Astable 555 Oscillator Circuit" section will likely do what you need. The resistors R1 and R2 and the capacitor C1 control your frequency and duty cycle. It can be made a bit more versatile with a few diodes but for a 50% duty cycle, just make sure the resistance of R1 is vastly smaller than R2. If you buy a newer/low power 555 chip you can use smaller capacitors, larger resistors, and waste less power. I like TS555IN personally although I've only tried 4 or 5 ranging from old RadioShack ones to those. That said if you need a lot of current you may wish to use a different 555 or have the 555 timer drive a transistor or mosfet. To choose the resistor and capacitor values for the circuit, they give you formulas:

Time on = 0.693(R1+R2)*C


Time off = 0.693*R2*C

So if you make R1 tiny compared to R2, say 1/1000th or 1/10000th, you can just neglect R1 in the equations, giving you a 50% duty cycle and a period(T) of

T = Time on + Time off = 2*0.693*R2*C = 1.386*R2*C

Your frequency is 1000Hz, so

F = 1/T means T = 1/F

1.386*R2*C = 1/1000 = 0.001

R2*C = 7.215 e-4

So if you pick a capacitor, you can calculate the resistance you need to get 1000hz or vice versa.

For a ts555IN, I'd use a 100pF(1e-10) ceramic capacitor and 7 megOhms resistance. With a variable capacitor and or trimmer resistor you'll be able to tune the frequency. If you need your frequency to be stable it would be wise to make sure the 5V into the 555 timer is stable.