-2

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.

Fried
  • 1
  • 2

3 Answers3

2

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

and

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.

K H
  • 4,023
  • 1
  • 11
  • 24
0

I agree with @KH with all the math, but for practical values use a CMOS TLC555 if possible, but with these low resistor values an NE555 should work the same.

I used my LabVIEW program for the TLC555 and it came up with 826.947 ohms for R1 and 6.800 K for R2, and a 100 nF capacitor, to give you 1000.000230 KHZ with a 1.1% duty cycle error. The program can take it to absurd accuracy but temperature and Vcc drift make that not worth it. It can be set as accurate as a xtal oscillator, but it will drift much more than a xtal.

Fixed resistor values should be 0.1% if possible as a tiny change affects both frequency and duty cycle. Use NPO or (worst-case) X7R capacitors and 50 ppm resistors to minimize drift with temperature.

As it is R1 was 680 ohm with 146.947 ohms added to fine-trim the frequency. If you need it accurate then just add a 500 ohm trim pot in series with R1. Bourns 3299W series 25 turn trim pots are great for fine trim.

If the duty cycle MUST be 50% then use 610 ohm for R1 and 3.3 K 0.1% for R2 which will double the frequency, then use a 74HC74 or 74HCT74 flip-flop to divide by 2 and you will get a perfect 50% duty cycle.

  • 2
    You simply cannot use an RC network on a 555 of any variety and expect to get 1.1% accuracy. Solutions such as this are 20 years old, and have essentially no learning value today. This should be done with something like an ATTinyxx, and there are plenty of tone generator examples. – Jack Creasey Jul 30 '18 at 05:51
  • if you have precision, temperature compensated parts there's no reason why A 555 can't give a precision result. but yeah, crystals are built to a greater precision than resuistors and capacitors. – Jasen Слава Україні Jul 30 '18 at 08:54
0

for those that want a crystal circuit

you could perhaps use a CD4060 to run a 32.000 KHz crystal, and divide it down to down to 1Khz

A 4.096MHz crystal is cheaper, and the CD4060 has enough divider stages, but I'm not sure that the oscillator in a CD4060 is up-to the task of running such a fast crystal.