40106 Hex Schmitt Inverter

The 40106 Hex Schmitt Inverter is an incredibly useful and popular IC in the world of DIY synthesis. It is cheap, easy to use and is central to one of the simplest oscillators around. Today I’d like to have a look at this chip, explain how and why it works and show you how you can use it to start making some noise.

A Hex Schmitt What-Now?

As the name suggests the 40106 chip is a Hex Schmitt Inverter (Or 6 Hex Schmitt Inverters) on a 14 pin chip. An Inverter is a digital component which takes an input (0 or 1) and outputs the opposite value. Typically in digital electronics these would be represented as 0V or 5V meaning if 0V is sent to the input 5V will be output by the output and vice versa. What makes a Hex Schmitt Inverter special is its capacity to take analog inputs rather than just 0 or 5V. The way this is accomplished is by setting a threshold voltage where the output changes. Looking off the datasheet for the 40106 we can see that in typical operation this happens at 0.9V when the chip is being powered with 5V or 2.3V when being powered with 10V. When the voltage on the input goes above that threshold the output turns off. When the input goes below that threshold the output a digital high voltage (usually 5V).

Dividing By Zero?

This Isn’t Going To Work

That probably all sounds as clear as mud so lets go over a simple use case to see if we can make some sense of it. We know that when you input a high voltage to an inverter it outputs a low voltage and vice versa. So what would happen if we connected the output back to the input? Now we’ve built a bit of a paradox! When the output is high it sends that high signal back to the input which makes the output low which makes the input low which makes the output high which makes the output low which makes…. you get the idea. The problem is since this is happening instantly its faster than the chip can handle and the whole thing breaks down.

Capacitor To The Rescue!

Simple 40106 Oscillator

What we need is a way to delay the signal traveling from the output back to the input so we can get a consistent oscillation. We can accomplish this by adding a capacitor between the input and the ground and a resistor between the output and input. The capacitor is initially in its uncharged state and the input is low. This low input voltage causes the output to go high, however an uncharged capacitor provides no resistance between the input and ground so all current flowing out of the output goes to ground and the voltage stays at 0V at the input.

As current flows into the capacitor it begins to charge which in turn resists more current traveling through it. This new resistance allows the voltage on the input to begin to grow proportional to the resistance provided by the capacitor. Eventually this voltage will reach the threshold voltage of the inverter and cause the output to go low. Then the whole thing happens in reverse, as the capacitor discharges the voltage drops until it falls below the threshold voltage and the output switches back to high.

The resistor functions to limit the current traveling from the output to the capacitor which slows the charging of the capacitor.

So How Do We Control This Thing?

Simple 40106 Oscillator with Control Pot

The key to taking this from a curiosity to something useful is control, we need to be able to select a frequency range and modify it in real time. Since the speed the inverter flips from high to low and back is governed by the charging and discharging of the capacitor we can control the frequency by controlling the speed the capacitor charges and discharges.

The first way to do this (as you may have guessed) is by changing the size of the capacitor. A smaller capacitor will charge quickly providing you a very high frequency while a larger capacitor will charge slower and provide a substantially lower frequency. Choosing the right capacitor is a great way to select a range of frequencies for your oscillator however as variable capacitors are rare and expensive this is not an ideal method for making real time changes to the frequency.

This leads us to the second method which is adjusting the resistance. This resistance limits the current flowing to the capacitor. The less current flowing to the capacitor the slower it will charge. Further since potentiometers (variable resistors) are common components we can add a knob to adjust the frequency of our oscillator on the go.

An easy way to calculate the approximate frequency with any resistor capacitor combination is using the equation f = 1.5/RC