Build timing circuits using a 555 timer IC
Many circuits, precooked or home made, deal with time related issues and many of those are dealt with by this IC: The *555* IC. It comes in many shapes an forms, hence the illusive name "555". The picture show a NE555N. I got myself a ICM7555CN for $1,-. The chip is everywhere you look. According to wikipedia, a billion of them are produced each year. The LMR search engine shows 10+ hits for the string "555". Google shows 5 million...
(update) Frag that: this is the chip that will make an electronicus out of you. Read the testimonials below! (update)
Many online descriptions of timing circuits will present you with a ready made solution to one particular problem. But this IC was designed to handle a whole range of problems. And then people hacked up a few more solutions for problems the designer was not even thinking of. This IC is not "programmable", unless you count adding various components in a smart circuit as programming (which I sometimes do).
I will describe some basic configurations for the 555. You should be able to implement a timing circuit by yourself after this walk through. Or at least know where to start asking questions in our forum.
The three basic modes are called: astable, monostable and bistable . All named after the number of stable states occurring in each mode (none, one or two).
The chipThe IC has eight pins. The ones you really need to know are:
V+ and GND
I will not draw schematics here that show all 8 pins. Instead I will concentrate on the ones that are relevant to learn about.
An astable application: square wave generationIn this example of an astable circuit, you see a Capacitor/Resistor "network". That is what determines how slow/fast this timer works. Compare the pendulum in a clock. [update 10 nov: green words corrected!]
When the electricity rushes or trickles into the capacitor, the voltage measured over the ends of the capacitor will rise. The value of resistor R1 determines if it is indeed a fast charge or a slow one. Once the voltage reaches a certain level, the 555 IC will respond. Or, vice versa, when the charge is escaping the capacitor, that voltage drops. And the 555 will respond when the voltage reaches below a second level. Notice that I did not draw all the pins, just the ones to consider in the Voltage/Time diagram.
The low voltage that triggers the 555 is 1/3 of V+. In my example V+ = 9V, so the IC will make the OUTPUT pin high when the TRIGGER pin reads a voltage under 3V. When the THRESHOLD pin reaches 2/3 of V+, the output goes low again. But at the same time the DISCHARGE pin will suck the charge from C1 to GND (through R2 and the chip). The capacitor will lose its voltage again until the system reaches its initial state at 3V. The DIS will stop sucking (sinking), so that the capacitor can start charging again.
The OUTPUT pin will change hard between high and low, not gradually like the input voltage at TR and THR. The time the output is high is often called the mark and the low time is called the space. Notice that the relation between mark and space is the same as the relation between R1 and R2.
Here is a complete schematic for such an application.
Notice that R1 is replaced with a variable resistor (in my case a 10 turn fine tuning pot) with a little 2200 Ohm resistor in series to protect the circuit against zero Ohm in the pot. C1 is 47 micro Farad in this example. With R1 at approx 100 kilo Ohm, this make the LED flash every 4 seconds or so. When I replace C1 with a 47 pico Farad (1000 times less), it will blink so fast (every 4 milliseconds or so), that it appears to be on all the time, but slightly dimmer. That would be a good scenario for a buzzer (producing a tone at about 250 Hz).
Included are two ways to take note of the square wave that is coming from your output pin. A simple LED that could be easily sourced from the chip and a little 45 Ohm buzzer that needs some amplification.
Monostable application: a single time pulse
When you remove R2 from the astable setup and make a separate trigger circuit, you get this.
It is now manually operated. You press the contact making switch (Normally Open = N.O.) to pull TR down, below 3V. When released, the pull up R10 (say 10k) will keep the TR high. At the trigger moment, the DIS stops sinking the current over R1. This current can now start charging C1. Once the voltage on C1 is at 6V, the THR will trip and the discharge will begin again. Note that the DIS pin on the chip will be constantly sinking current through R1 while OUT remains low. This means that R1 must not be too low, or you will fry your chip. And the 555 is not that kind of chip.
This circuit is triggered when a button is pressed. You can make it trigger on different kinds of events as well. See the links below for a falling-edge-triggered version.
This config is called bistable because both states (on or off) are stable. It is no longer time dependent. I would say, frag that! That's no timer at all! So here it goes, just for the sake of comprehensivenessability. And to point out the mistake I made before about the astable circuit...
Note that this is all user operated through two N.O. switches pulling the Trigger or the Reset (R) to GND. The Threshold is pulled low permanently. The same tricks for edge-triggered circuits apply.
Pulse Width Modulation by 555
As demonstrated on several websites, the 555 can be used to produce a PWM signal, so you don't need a micro controller for that. It's really
This time the capacitor is charged through a potmeter R1. Through the left side of it. The diodes make sure that the charging current can take only that route.
The discharge takes the other route, through the right side of R1.
The additional resistor R3 is there only to prevent the DIS pin from discharging you power supply directly. It should be large enough to prevent that, but not so large that the charge current will take forever.
This circuit is from Afromods (see below). Be sure to check out the video tutorial on the site.
The DPRG (also linked below) has an alternative version that uses the 555's output as the supply source for the charging current and also as the sink for the discharge current. The DIS pin serves as the functional output of the circuit.
Good links I found
Doctronics (very cool zoomable circuits and even protoboard layouts)
555 datasheet by Texas Instruments (decent application examples in this one)
Afromods (PWM done by 555, with cool video)
Dallas personal Robots Group (PWM done by 555 hack, written explanation)
No more continuations planned. Requests for updates will be judged on merit.