I am using a 555 timer for a (16bit) frequency sensor/counter.

It works by counting the number of pulses read in the 125ms sample time set by a 555 timer; resets & repeats...

I am using the timer in astable operation.

  • TH (time pulse high) is the sampling ON signal.

    This time is set and trimmed (+/- 5% adjustment range) with a high quality POT.

  • TL (time pulse low) falling edge initiates a data-latch read --> then a counter reset operation

enter image description here

Right now I have it on a bread board. I am making a PCB for the final design and I want to iron out the following problem for the PCB design.

Here is the problem:

The measured frequency is not super stable (+/- ~3Hz @ 25kHz) and it takes a while to settle.

I think it is because the sample time is getting affected by the noise on the Vdd rail. I have decoupling caps on all the IC's but it is on a bread board so this can be expected. For the PCB layout I want to insure the 555 timer is on a solid 5v and the DCDC converter output is steady.

Here are some ideas I have on how to do this.

  1. Use a rail-rail opamp and 4v7 reference to regulate the Timer Vdd @ 4v7
  2. Use ferrite beads to further decouple the Timer and all the other ICs from each other.
  3. Use a seperate DCDC converter for the timer.
  4. Use a linear regulator IC for the Timer Vdd.

Which of these would be the best practice for insuring a constant timer Vdd value?

  • 17
    \$\begingroup\$ Maybe you should use a crystal instead. I am actually impressed that it's only +/- 3Hz @ 25 kHz. That's great, considering you're using a 555 timer. \$\endgroup\$ Aug 12, 2019 at 13:25
  • 3
    \$\begingroup\$ VDD stiffening may not help : it may be some thermal effect (capacitor or the chip itself warming up). indeed, "takes some time to settle" suggests that. The other answers are absolutely correct : if 3Hz in 25kHz isn't good enough, you really want a fundamentally better source (e.g. watch crystal oscillator at 32.768 kHz. \$\endgroup\$
    – user16324
    Aug 12, 2019 at 21:59
  • 1
    \$\begingroup\$ Awesome, I feel a lot better now about my circuit after finding out I'm getting pretty good results despite using a 555 timer as the reference. rev.2 will use a crystal and a counter to set the sample time. I can also adjust the sample time range by selecting which counter bit to use! \$\endgroup\$
    – Tony
    Aug 13, 2019 at 0:53

4 Answers 4


Your measured short-term stability is about +/-0.01%, which isn't bad for an uncompensated RC timer.

You can improve it by using low temperature coefficient resistors and capacitors in the timing circuit, maybe by bypassing pin 5 to ground, by isolating the circuit thermally and electrically, in the extreme controlling the temperature in an oven, powering it from a battery with an ultra-low noise linear regulator and capacitance multiplier stage, and using opto-isolation on the outputs.

But that's just silly. Use a crystal, they're cheap and orders of magnitude better. For example, a 100kHz crystal, oscillator (74HCU04 + a couple resistors + load caps) and a divide-by-four (eg. a 74HC74). Tolerance (absolute accuracy) of that particular linked crystal is +/-30ppm or about 0.75Hz in 25kHz. Short term stability will be much better again.

There are also programmable oscillator products you can order, there might be one in a useful range for you.

  • \$\begingroup\$ "Your measured short-term stability is about +/-0.01%, which isn't bad for an uncompensated RC timer." - How would one compensate it to make it more stable? \$\endgroup\$ Aug 12, 2019 at 14:30
  • 7
    \$\begingroup\$ @HarrySvensson You could isolate it from thermal effects like air currents and introduce deliberately temperature sensitive components to compensate for the drift of the capacitor and resistors (and, to a lesser extent, the IC). If crystals (and ceramic resonators) were not so cheap and available, such techniques might make sense. Another method is to use a lookup table driven by temperature, stored in EEPROM to trim some parameter. \$\endgroup\$ Aug 12, 2019 at 14:35
  • 1
    \$\begingroup\$ Better than a 100kHz crystal and 74HCU04, a 74HC4060 and a 6.4MHz crystal. Take your clock off of Q8, and Bob's yer uncle. \$\endgroup\$
    – TimWescott
    Aug 13, 2019 at 1:02
  • \$\begingroup\$ @TimWescott good option, can use a rugged HC49 crystal too, with higher maximum drive. \$\endgroup\$ Aug 13, 2019 at 1:15

I don't think you will ever get the accuracy and stability you want from a 555 timer. The pulse width is determined by the values of resistors and a capacitor, and the values of these elements will change with temperature and over time.

For a precise pulse duration you should be looking at a crystal oscillator with a digital counter to generate the desired pulse.


While I have many fond memories of using a 555 timer, sadly, incredibly cheap microcontrollers with a crystal are almost always a better choice for timers nowadays.

The PIC16 series has some members which have a very wide voltage range (3.3-18V+) and are available for a dollar and change.

  • 1
    \$\begingroup\$ Agreed, but I try hard not to use MCU's when I don't have to. I make IC tester boards. This is like a handy peripherally circuit that I can just copy and paste into new designs without having to flash program anything. Its so I don't need to use up a large expensive oscilloscope just to measure frequency. \$\endgroup\$
    – Tony
    Aug 22, 2019 at 0:04

This is more of a conclusion rather than a solution...

I didn't have enough time to design a new circuit using a crystal so I made the PCB with the following changes to try to make it better:

  1. higher precision, temperature stable film caps. I put 2 in parallel in a attempt to make the capacitance more stable. When one capacitor sinks/sources more current it heats up causing it's capacitance to go down... making the other capacitor sink/source more current. So you get some regulation happening. This is NOT always the case with ceramic capacitors which is what i was using before.

enter image description here enter image description here

  1. higher precision resistors for the RC circuit. I used .1% tolerance rather then 1%. They also had 4x the temperature stability.

  2. 4v voltage regulator for the 555 timer. This isolates the 555 voltage rail from the rest of the digital stuff by a factor of 100 (1% line regulation).

  3. Used 5k pot instead of 20k pot to trim the pulse time. Reduces the error caused by the pot instability.

  4. Buffered output for the 555 timer pulse signal. I used an LT1630 to drive the timing pulse to all the gates so the Timer IC wasn't driving any current. The gate inputs can interact with each other if input drive is not low enough impedance. I got ~7 gate inputs connected to the timing pulse so I wanted to guarantee a strong signal.

Result: I got around ~.04% accuracy (1 bit toggle @ ~2500dec value on bus). For the first circuit I was getting around .5% accuracy (the accuracy I posted originally was wrong) and the value was constantly drifting. The new circuit has no noticeable drift. So in conclusion using better quality components I increased the accuracy by ~10x and made it stable and actually usable.

I know this is not the best or even simplest method for making a frequency counter but its cheap and effective. I'll probably use it again when I need to take a crude frequency measurement.

The value gets read by the DB25 port with 8bits Hi/Lo select. The LEDs are just for debugging. I always add LEDs wherever it can make my life easier.

enter image description here

  • \$\begingroup\$ Nice design, I love this really :) \$\endgroup\$ Dec 27, 2019 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.