Build timing circuits using a 555 timer IC

Introduction

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 chip

The IC has eight pins. The ones you really need to know are:

V+ and GND
Trigger (TR) and Threshold (THR)
Discharge (DIS) and Output (Q or OUT)

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 generation

In 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!]

astable3_flash.jpg

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.

astable_circuit_mono500.png

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.

monostable3_flash.jpg

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.

Bistable configuration

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...

true_bistable.jpg

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 a bistable an astable oscillator with adjustable mark/space.

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.

astable_pwm_afromods.jpg

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

The electronics club

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.

www.metacafe.com/watch/2040364/pwm_tutorial

Nostalgia
My second ever "chip." I never really understood it. I was 11 the first time I bought one. I used them to make Knight Rider lights.

Wewt, my first chip! All

Wewt, my first chip! All thanks to Radioshack Learning Lab (28-280)

I’m well on my way to making some uber robots, I hope 8)


Thanks for the tutorial, I say post more!

Me too!

This was my first chip as well! I made a little "piano" each key having a different resistor attached. Man, that piano produced the most obnoxious shrill sounds…

Nice walk-through, yo.

Omg, it was my first chip
Omg, it was my first chip too. it is so useful, this is one mighty chip.

Hey, perhaps I should try
Hey, perhaps I should try this chip :smiley:

I guess this was my "first
I guess this was my “first chip,” too, but that was only a month ago. :stuck_out_tongue:

Heh, so did I! I’m assuming

Heh, so did I! I’m assuming you used a 4017 to do that, right?

This topic should have the wonderful 556 (dual 555) and 558 (quad) timers too :stuck_out_tongue:

Second chip
Everyone says “that was my first chip”. Why has no-one asked me what my first chip was?

Aight, I’ll bite…What was

Aight, I’ll bite…

What was your first chip? - Was it the Potatoe variety?, no… you have Crisps… Chocolate?? Possibly a poker? Or maybe a buffalo or cow chip?

Sulking
Now I’m not telling you.

Things I learned with this chip

1) Polarity to the chip cannot be reversed like on a light bulb.

2) Reversed polarity can heat the chip to the point of melting a breadboard.

3) A chip that is melting plastic will burn you if you touch it to see how hot it is.

4) The markings on a chip will transfer to the finger in the burn, making it easy to know the replacement part to pick up at Radio Shack.

replacement shopping
use any of the shiny merchandise to help you read the inverted text (or hold it up behind the eyes in the back of your head)

LOL
LOL

my first chip
my first chip was a picaxe 28x1. About 2 months ago. And i’m not really a kid so much.

The 555 still in action!!

Today on boing boing, the 555 audio pencil!!

http://www.boingboing.net/2008/11/11/drawdio-kit.html

Another 555 project on Make, Optical Theremin

http://blog.makezine.com/archive/2008/11/beepit_optical_theremin.html

http://createdigitalmusic.com/2008/11/12/beep-it-portable-open-diy-optical-theremin/

update 18 nov 2008

I found this cool video tutorial today. So I decided to finally add the PWM circuit to the list. Almost forgot about the whole thing.

8ik

2008_fundraiser_micro_button-en.png

update

removed some spurious whitespace

[and incidently pushed one polulu picture off the front page]

Just remembered about the
Just remembered about the Radio shack Learning Lab, i still have one of those in storage ! sure wish i had it now to help building circuits !!!