In a lot of circuits (especially with the 555 timer), I see capacitors used to set the duration/frequency of something.

Now mostly the value of a capacitor can be calculated, however, what if I want it to be variable, and controllable from a microcontroller.

I know there exists varcaps/var. diodes etc, but if I look at the data sheets they only mention they are for radio/TV tuning. For resistors there exist variable resistors ICs, and I would expect something similar for variable capacitor ICs.

Do I miss/oversee something here?

(update) Example:

Using for C: 100 nF Using for R1 and R2: MCP42010 (100 kOhm version, see Datasheet

Slight problem is that the wiper resistance is 125 ohm, resulting in a minimum frequency (using the calculations in the circuit link) when using 100 kohm is 48 Hz, and maximum frequency (when using 125 ohm) is 48 Hz.

• If you plan to use an MCU, why do you not integrate the timer function in it's program, saving yourself the hassle with the 555?
– Bart
Jun 13 '17 at 9:43
• @Bart ... maybe that's best indeed, for me it's just a 'learning' question ... I can imagine there are many examples, not only the 555 timer. Like some high frequency IC where involving an MCU will be too performance costly to use as 'timer'. Jun 13 '17 at 9:45

Do I miss/oversee something here?

Varicap diodes vary the capacitance by varying the DC voltage on reverse biased PN junction. PN junctions don't have a massive amount of capacitance hence you only get several tens of pF for something like a BB171 made by NXP: - The data sheet refers to it as a VHF device but I use it at frequencies from 1 MHz to 15 MHz.

For resistors there exist variable resistors ICs, and I would expect something similar for variable capacitor ICs

There is one digitally controlled capacitor that i have come across but, like the varicap diode, this was for applications that required a capacitance in the tens of pF range. I guess there is no massive reason why bigger value digitally controlled capacitance chips couldn't be available other than market demands.

I mean, you can make a low-speed to medium-speed oscillator by varying the resistance and if you wanted a high-speed LC oscillator most varicap diodes are in the right capacitance range to suit the higher frequencies.

• What's wrong with using a variable resistor - nobody would consider using a variable capacitor at this low frequency. Jun 13 '17 at 10:08
• If you want a 20Hz frequency, you start with a larger cap like 100uF, then you get practical resistor values. Jun 13 '17 at 10:20
• @MichelKeijzers it seems to me that you want something that doesn't exist within the constraints of using a 555 timer. If you want an oscillator that can smoothly run from 20 Hz to 4800 Hz this requires specialist design over and above what a simple 555 can permit. It doesn't work with a programmable variable resistor and it doesn't work with a variable capacitor. Jun 13 '17 at 10:37
• You'll never get a digipot with a temperature stable range of 800:1. I use digipots in circuits that process signals and I won't go higher than 16:1. Using a real pot will be somewhat similar but if you are prepared for temperature induced frequency instability then that's OK. Jun 13 '17 at 13:32
• Look at the temperature coefficient graph for potentiometer mode on page 7 (fig 2-3). At 16:1 ratio the TempCo is about 20 ppm/degC. At 32:1 it's about 40 ppm/degC and getting close to be off the scale if you went to 64:1. In other words, you cannot rely on a digipot for having a big range (256:1 for the one you listed) whilst producing frequency stability. It's the same with varicaps - they have a temperature coefficient that isn't bad but aint that great either. Those who know, know that stable variable oscillators are gold-dust. Jun 13 '17 at 13:36

For a variable-frequency oscillator using resistor*capacitor time constants, it might seem natural to change the oscillator frequency by either changing the resistance and/or the capacitance. Variable resistors have limitations as you have noted. Voltage-variable capacitors have a limited capacitance range that is non-linear...mostly useful for high-frequency oscillators using a resonating inductor.
Other approaches allow frequency to be varied over a wide range. Some versions have impressive linearity. These circuits use a fixed capacitor that doesn't change value. What changes the frequency is a voltage or current that is variable. Many simple function generators use this technique. A 555-type oscillator does not - it has fixed threshold voltages (at Vcc/3 and at Vcc*2/3).
It is possible to modify the standard 555 relaxation-type oscillator by charging its fixed capacitor with a current source rather than a resistor. A variable current-source results in a variable frequency: Output frequency varies between 180 Hz to 10kHz. While a variable resistor is used to provide a control voltage, any variable input voltage source performs the same function.

• Thanks for the answer! Looks like it's much more complicated than I thought (but learnt something) Jun 14 '17 at 12:24