Home > Projects > Clock – Timer Projects > NE555 Voltage-to-Frequency Converter: How It Works and How to Build One

NE555 Voltage-to-Frequency Converter: How It Works and How to Build One

What this circuit does

A 555 timer can turn a slowly changing analog voltage into a stream of pulses whose frequency rises and falls with that voltage. The output is a square wave, so it can be sent down a long cable, counted by a microcontroller, or fed into a frequency counter, without the voltage drop and noise pickup that spoil a direct analog measurement.

This article explains the version that behaves predictably: the 555 used as a Schmitt-trigger oscillator, with the timing capacitor charged by a current derived from the input voltage. That arrangement gives a frequency that is close to proportional to the input, and it avoids the awkward log-shaped response you get if you simply push the input into pin 5.

Why the pin 5 method is not the one to build

The internal divider of the 555 sets the timing thresholds at one third and two thirds of the supply. Feeding a voltage into the control pin (pin 5) moves both thresholds together, and the discharge time stays fixed while the charge time follows a logarithm. The result is a compressed, non-linear frequency range that drifts with temperature and is hard to calibrate. It works as a demonstration and it is not what you want if the number on the display is supposed to mean something.

The Schmitt-trigger oscillator

Wire the 555 so that the timing capacitor is charged from a current source and the discharge pin is used only to reset the capacitor each cycle:

  • Pin 2 (trigger) and pin 6 (threshold) are tied together across the timing capacitor.
  • Pin 7 (discharge) resets the capacitor through a small resistor each time the upper threshold is crossed.
  • The timing capacitor charges from a current that is proportional to the input voltage, usually through a transistor or an op-amp current source.

When the capacitor reaches two thirds of the supply, the output goes low and the capacitor is discharged to one third of the supply. Because the thresholds sit at one third and two thirds of VCC, the voltage swing across the capacitor is VCC/3. The oscillator frequency is then the charging current divided by the charge that has to be moved each cycle:

f = 3 · I_in / (C · VCC)

With a 5 V supply and a 10 nF capacitor, 100 µA of charging current gives roughly 6 kHz. Doubling the current doubles the frequency, which is the property that makes this worth building: the scale factor is set by C and the current-source resistor, not by the supply voltage.

Making the input a current

The simplest current source is a resistor from the input voltage to the capacitor, with the input buffered by an op-amp so that the source impedance of the sensor does not matter. If the input is 0–5 V and the resistor is 47 kΩ, the current spans 0–106 µA and the output spans 0–6.4 kHz with the 10 nF capacitor above. Keep the input above about 0.7 V, because below that the current source stops behaving like a current source and the frequency flattens out.

Two practical details matter more than the formula:

  • Use a low-leakage capacitor. A ceramic or film part is fine; an electrolytic is not, because leakage current adds to the charging current and the error grows at low frequencies.
  • Keep the charging node short and away from the output trace. The capacitor node is high impedance for most of the cycle, and a few centimetres of wire next to a switching line is enough to show up as jitter.

What it will and will not do

This is a low-frequency converter. Above roughly 50 kHz the internal comparator delay of the 555 starts to matter and the frequency stops tracking the input cleanly. Linearity of a couple of percent over a 10:1 range is realistic with a trimmed current source; 0.1 % needs a dedicated converter such as the LM331, not a 555.

The other limitation is temperature. The threshold levels and the current-source transistor both drift, so an uncalibrated build will move by a few percent over a normal room-temperature swing. If the reading has to be absolute, measure the actual frequency at two known input voltages and store the two calibration points in the microcontroller that counts the pulses.

Connecting it to a microcontroller

Feed the output through a 1 kΩ resistor into a digital pin and count pulses over a fixed gate time, or use the input capture unit of the timer. Counting for 100 ms gives 100 Hz resolution at the low end and is a reasonable starting point for a sensor that changes slowly. Do not feed the output directly into an interrupt pin while the same pin is used for anything else, and keep the 555 supply decoupled with a 100 nF capacitor close to the package.

References

  • Texas Instruments, NE555, SA555, SE555 precision timers datasheet — internal divider, threshold levels, discharge behaviour and output timing limits.
  • Texas Instruments, LM331 voltage-to-frequency converter datasheet — for comparison of linearity and drift against a dedicated converter.

Everything above is the documented behaviour of the parts and the arithmetic of the oscillator. No measurement on a physical build is claimed here; treat the component values as a starting point to be checked with a scope or frequency counter before they go into anything that matters.


About The Author

Scroll to Top