The 555 was designed back in the early 1970s by Hans Camenzind at the semiconductor company Signetics. It quickly became one of the most popular and used ICs of all time. Data from 2004 shows that it was selling about a billion chips per year and has been used in products ranging from toys to spacecraft.
There are a few things we will be talking about in our discussion of the 555 that you might not have run into before. To make sure you all have the background, the next few pages will cover some of the basics.
Resistors are inserting components. If you put a voltage across a resistor, a current will flow through it. These three values: voltage, resistance, and current are related by an equation known as "Ohm's Law":
- V is the voltage in volts
- I is the current in amps
- R is the resistance in ohms
This is a very useful equation, mostly because you can manipulate it to help you compute the difference values depending on the situation.
Let's say you are connecting an LED. You're using a 5v supply and know you need a currently limiting resistor to keep the LED from frying. An LED will have a specific and well known voltage drop across it. The manufacture's datasheet will have the specific value, but typically a red LED will have a voltage drop of around 1.8 volts. As the frequency of the emitted light increases, so does the voltage drop so a blue LED might have a voltage drop of closer to 3.3 volts. So if we have a red LED, it will have a 1.8v drop. The other 3.2v has to be across a resistor in series with the LED. What size resistor? If we make the assumption (that's always worked fine in my experience) that you want 20 milliamps flowing through the LED, then we use
R = V/I
That is, R = 3.2/0.020 = 160
You will want a 160 ohm resistor. More or less. In this case it's safer to use a higher valued resistor. The LED might be a bit dimmer than it could be, but if you let too much current flow through it (by using too small of a resistor) it could self-destruct.
Aside: I've generally found that 220 ohm resistor is a good value to use... so I bought 1000 of them. I've also gone with 330 ohms for red LEDs and 150 ohms for green and blue.
That brings us to voltage dividers. If we connect multiple resistors in series and apply a voltage across them, each one will take a portion of the voltage proportional to it's share of the total resistance.
Assuming the resistances are equal, the point between the resistors will measure as half the voltage across the pair and each resistor will have half the voltage across it. If we do this with three resistors, the points between the resistors will be at 1/3 and 2/3 of the overall voltage; each resistor will have 1/3 of the total voltage across it.
This is worth noting as this is exactly what is inside the 555, as we will see later.
Before we can understand much about the operation of the 555 we need to understand resistor-capacitor circuits, commonly called rc circuits.
Resistors resist the flow of electrons through them. Capacitors store electrons. That's about it. If we place a voltage across a resistor a current (i.e. a flow of electrons) will flow through it. The greater the voltage, the greater the current. The greater the value of the resister (it's resistance) the lower the current.
Things get interesting when we put resisters and capacitors together. You'll find them working together in various ways in all kinds of circuits. For the purpose of this guide, we're interested in a specific way of combining them.
Consider this simple circuit.
If C is fully discharged (i.e. is empty) when the power is applied, the voltage V will be 0 and C will start to charge through R. As it charges, V will increase. As this happens the voltage across R will get smaller. In turn this will lower the current flowing through it and this will slow the charging of C. In fact, V will follow a well defined logarithmic curve.
Similarly, if we now connect the top end of R to ground instead of Vcc, C will discharge and V will go back to 0, again on a logarithmic curve.
The timing of C's charging and discharging (and V) is dependent on the values of R and C. If we make the value of C larger it will charge more slowly. Likewise if we make the value of R larger.
This might make more sense if we use an analogy. Let's represent C by a swimming pool and R by a hose. If we try filling an Olympic swimming pool using a garden hose it will take a long time. If we make the pool smaller by replacing it with a kiddie wading pool (i.e. a lower capacitance) or the hose bigger by replacing it with a fire hose (a lower resistance) it won't take as long to fill.
When we have a circuit like this a handy number is the RC time constant. The value of C in farads multiplied by the value of R in ohms yields the RC time constant in seconds. For example the RC time constant of a 1k ohm resistor and a 1 microfarad capacitor is:
1000 ohms * 0.000001 farads = 0.001 seconds, i.e. 1 mS
As mentioned, the charging of the capacitor follows a logarithmic curve rather than a linear, so the rate of charger/discharge changes over time. The RC time constant is quite handy. V will be within 1% of Vcc in 5RC seconds. Furthermore, it will be at 63% of Vcc in RC seconds. The usefulness of this will become apparent later.
A flipflop is a digital circuit that can be used to store a single bit of information. They come in a variety of types that all work slightly differently. Flipflops will be discussed in detail in a later guide. For this guide we just need to know about the RS flipflop.
The "RS" stands for Reset-Set. The way this flipflop works is that it can be set (making its state high) and reset (making it's state low) by using its two inputs: S and R, respectively. It also has an output that reflects its internal state. Flipflops typically also have an inverted output which will be the logical negation of the output (i.e. low if the output is high, high if it's low).
We won't worry about the internal details at this point. A later guide dedicated to flip flops will develop the idea of a flipflop from the inside-out. R is the reset input, S is the set input, and Q is the output. It's something of a standard to use Q to denote the output. This was tradition even when I got started. The Q with a bar over it is the inverted output. We'll call this Q-bar. If Q is high, Q-bar will be low, and the opposite. On the flipflop this is denoted by the small circle at the Q-bar output. A small circle like this in digital logic diagrams means inversion.
If both R and S are low, then the flipflop is stable and nothing changes. If S goes high briefly, Q becomes high, regardless what it was previously. If R goes high briefly, Q becomes low. Both R and S being high at the same time is not usually an interesting case, but if it happens, Q will go high.
In practice both R and S will normally be low, one of them can be made high for some reason to cause Q to go high or low and stay that way until R or S goes high again. As such, an RS flipflop is a basic unit of memory, able to store a single bit of information.
Transistors are a basic building block of electronics. You know how electrons, protons, etc are the building blocks of matter? Transistors are like that for electronics. All digital electronics are made of transistors. They have numerous uses but for understanding the operation of the 555 we just need one: a switch.
The 555 uses a transistor as a switch to connect part of the circuit to ground:
When the line labelled
controlgoes high, the transistor turns on and connects the circuit it's connected to, to ground.
In the 555 this is used as the mechanism to discharge the timing capacitor.
Here is the internal block diagram of the 555.
On the left we can see a voltage divider as described earlier. The values of the resistors aren't relevant to this discussion, other than that they are all the same. That gives us 1/3 and 2/3 of Vcc at the points between resistors. The rest of the behaviour of the circuit is driven by this divider. One of the benefits of this is that the operation is independent of Vcc.
There is a bit of an urban legend that claims the 555 got it's name from these 3 resistors each being 5K. This is officially not true from what I have found from some research. In fact the part number "555" was arbitrary. See this interview.
Moving right we find two voltage comparitors. The top one compares the voltage on the threshold pin (6) with the 2/3 Vcc value. Then the threshold voltage is above 2/3 Vcc the output of the comparitor goes high. The lower comparitor compares the voltage on the trigger pin (2) to 1/3 Vcc. Note that the trigger input is connected to the comparitor input annotated with a negating circle. This indicates the input that should be lower that the other input for the comparitors output to be high. On the top comparitor the negating input was connected to the 2/3 Vcc voltage so the threshold value had to be the higher of the two for the comparitor output to be high. In the bottom comparitor the trigger voltage has to be below the 1/3 Vcc voltage for the comparitor output to be high.
Next we have the RS flipflop. The trigger comparitor output is used to set the flipflop (making its Q output high and, more importantly here, it's Q-bar output low. The threshold comparitor output is used to reset the flipflop, making the Q-bar output high. Notice that there is an active low (meaning that it is normally high and brought low to do something) reset pin (4) that can be used to reset the flipflop (and thus the 555) to a known state, with Q-bar high (which drives output low and discharge grounded, as we will see momentarily).
The Q-bar output of the flipflop is inverted and buffered (to be able to supply more current to whatever circuit is connected). This buffered signal is connected to the output pin (3).
The Q-bar output of the flipflop is also used to control a transistor switch that, when on, connects the discharge pin (7) to ground (when the not Q is high, i,e, when the flipflop is in the reset state).
Finally there is the control voltage pin (5) which can be used to override the operation of the voltage divider by setting the 2/3 point of the divider (the voltage that the threshold input is compared to) to an external voltage. Note that this also effects the voltage the input signal is compared to (it is now 1/2 of the control voltage)
As you can see this is a very simple and elegant circuit. The 555 doesn't do much other than compare some voltages (the divider and comparitors), keep some state (the flipflop), and ground a pin (the transistor). This is what makes it so versatile: with a few external components connected in various configurations, this little chip can do all manor of interesting and useful things.
We will be referring to the above diagram throughout the rest of this guide, so it's a good idea to have a pretty solid grasp on the material up to this point.
If you really want to understand the 555, you can grab the "Three-Fives" kit and poke around inside the circuit with an oscilloscope or multi-meter. It's a fully functional version of the 555 made from transistors and resistors, just like inside the real chip.
Now that we understand what the 555 is, and how it operates, it's time to explore what it can be used for.
The 555 has 3 basic modes of operation:
- Monostable/one-shot: The trigger input is used to make the output high for some amount of time, after which is goes low until it is triggered again.
- Astable/free-running: The output switches between high and low at a specific frequency and duty cycle.
- Bistable: The output is controlled by two inputs. This basically just exposes the internal flip-flop.
The monostable, aka one-shot, configuration generates a single pulse of a predetermined length in response to a trigger.
At rest, the trigger input will be high (in this case that means > 1/3 Vcc) and the output will be low. This means that the Q-bar output from the flipflop will be high, which turns on the discharge transistor keeping C1 empty and the threshold voltage at 0v.
When the trigger input goes low briefly (i.e. falls below 1/3 Vcc) the trigger comparitor sets the flipflop, making its Q-bar output low. This turns off the discharge transistor allowing C1 to charge through R1. It also causes the output to go high.
C1 charges through R1 until the threshold voltage reaches 2/3 Vcc. Recall that this will take RC seconds. When it gets to that point, the threshold comparitor resets the flipflop, making Q-bar high. This makes the output low, and turns on the discharge transistor which grounds the discharge pin. Since this is connected directly to the point between the capacitor and resistor, the capacitor discharges essentially instantaneously. This also causes the threshold voltage to go to zero, and the flipflop's reset input to go low. Now both the set and reset inputs to the flipflop are low and the circuit is again in a stable state with the output low.
In summary, taking the trigger low briefly causes the output to go high for the length of time defined by RC. Below is a diagram showing the temporal relationship between these various signals.
The astable configuration generates an ongoing stream of pulses of fixed length and frequency. It's called astable since it has no stable state, continually toggling back and forth.
This is very similar to the monostable circuit with two seemingly minor differences:
- There's a second resistor (R2) between discharge and the capacitor/threshold.
- Trigger is connected to threshold, rather than being an external input.
Because of these differences, the operation is quite different.
As before, C1 charges, but this time it's through the combination of R1 and R2. Since the trigger input is the voltage on C1, the 555 triggers when C1 discharges to 1/3Vcc, at which point the flipflop gets set and C1 starts charging again. This means that C1 never discharges to 0v so when it charges isn't not charging from 0v, it's changing from 1/3Vcc. The practical effect of this is that the charge time isn't a full (R1+R2)C. Instead it takes 0.693(R1+R2)C1 seconds. Why 0.693? Math.
When the discharge pin gets grounded in response to the capacitor/threshold voltage reaching 2/3Vcc, C1 discharges through R2. This takes some amount of time determined by R2 and C1. Once again C1 is discharging from 2/3Vcc to 1/3Vcc so the time will be 0.693(R2C1).
Here's an actual scope trace of the threshold (green) and output (yellow) pins.
This circuit is called astable because it doesn't have a stable state that it needs to be bumped out of like the monostable. Rather, it's continuously alternating between charging C1 from 1/3Vcc to 2/3Vcc and discharging it back to 1/3Vcc. The output is correspondingly high while C1 charges and low while it discharges.
- The time the output is high is 0.693(R1+R2)C1.
- The time the output is low 0.693(R2)C1.
- The total cycle time is the sum of these: 0.693C1(R1+2R2).
- This means that the frequency is the reciprocal of that: 1.44/((R1+2R2)C1).
Because the charge time depends on R1+R2 and the discharge depends on R2, the two times can not be equal, so you can't get a 50% duty cycle. This, however is seldom a real issue. In those cases where it is, you can achieve it by doing some tricks using the CMOS version of the 555.
The bistable configuration is stable in both states, staying where you put it.
In this configuration the 555 is being used as an RS flipflop. It simply exposes the operation of the internal flipflop.
Making the trigger low briefly sets the flipflop, making the output high. When reset is made low briefly, the flipflop is reset, making the output low. In this configuration, discharge is not used and left unconnected. Similarly threshold is not used, but it needs to be connected to ground to make sure it stays well below 2/3 Vcc.
While this may seem like overkill, it does give you an RS flipflop in a small, 8 pin package with a very flexible supply voltage. Alternatives would be using a 14 pin chip or building a flipflop from gates or transistors, both of which would take considerably more space and likely have supply voltage restrictions.
The previous sections cover the basic operating modes of the 555. Beyond this there are a staggering variety of uses this little chip has found since it was released in 1972. There are some sources of projects in the References section.
One place 555s (actually a 558: 4 555s on a single 16-pin chip) were used in early microcomputers (notably the Apple ][ and the IBM PC) was the game controller interface. By using a 555 in monostable mode and using a potentiometer in place of the timing resistor, software could trigger the timers and measure the length of the output pulses. The pulse length was proportional to the value of the resistor, and thus the position of the paddle/joystick.
The Art of Electronics by Paul Horowitx and Winfried Hill, especially sections 1.4, 2.2.1, and 7.1.3.
Engineer's Mini-Notebook: 555 Circuits by Forrest M. Mims, III
The Ultimate Beginner's Guide to the 555 Timer by Jesse Rutherford
The 555 Timer Applications Sourcebook by Howard Berlin