- Getting Started with Electronic Projects
- Bill Pretty
- 645字
- 2021-08-06 19:46:12
What is a 555 timer and how does it work?
The integrated circuit that we will be using in this chapter has been around since the 1970s and is still going strong today. You can see the 555 timer circuit in the following diagram:
The LM555 has two modes of operation. For this project, we will be using it in astable mode. The word astable means unstable, basically with respect to an oscillator. Now, in some cases we do not want the circuit to be astable, for example an amplifier. In this case, astable is a good mode.
The pins have various functions, depending on the mode in which we are using the device. The functions are as follows:
- Pins 8 and 1 are always power and ground respectively.
- Pin 3 is always the output pin that we will use to turn the LEDs ON and OFF.
- Pin 4 is the reset pin. Pulling this pin low (to ground) disables the oscillator in astable mode. Essentially the output goes low and stays low.
- Pin 5 is the control voltage pin. By applying a voltage to this pin, we can change the frequency in astable mode. By applying various signals to this pin, we can simulate UFO sounds from old science-fiction movies.
- Pin 6 is the threshold input to the on-chip comparator.
- Pin 7 is the discharge pin, used to discharge the timing capacitor.
- Pin 2 is the trigger input to a second on-chip comparator.
For those unfamiliar with how comparators work, a comparator compares the signals at its plus and minus inputs. If the positive input is higher than the negative input, then the output goes high. If it is lower than the negative input, then the output goes low.
For those of you who don't know what an R-S flip-flop is, it's the simplest of all memory devices. It's called a flip-flop because it has two complementary outputs that flip and flop back and forth, depending on the input. They are labeled Q and Q/ because Q/ is always the opposite of Q. Hence the name flip-flop.
When a high level (logic 1) is applied to the Set (S) input, the Q output goes high and the Q/ output goes low. When a high level is applied to the Reset (R) input, the Q output goes low and the Q/ output goes high.
The R-S flip-flop truth table as follows:
The schematic for the circuit is shown in the following diagram:
In our flasher circuit, timing resistors R1 and R2 and capacitor C1 control the flash rate. The two comparator inputs, pin 2 and pin 6, are connected together.
When the output is high, the internal discharge transistor is turned off and the voltage across C1 increases until it reaches two-thirds of the Vcc, at which time the comparator output on the trigger terminal becomes high. This resets the flip-flop, which causes the timer output to go low.
This turns on the discharging transistor and the capacitor is discharged through the transistor and R2. Once the voltage across C1 falls below two-thirds of the Vcc, the comparator output on the trigger terminal goes high, as does the timer output. The discharging transistor turns off and the voltage across C1 begins to rise again.
The time that the output is high is approximately: Th = 0.693(R1+R2)xC1.
The time that the output is low is approximately: Tl = 0.693xR2xC1.
Since R2 has the most effect on the timing, if we make it a lot larger that R1, we will get a square wave output. That is, the on and off times will be the same.
You can vary the on and off times by playing with various combinations of R1 and R2. For example, you can have a one long or one short flash rate.