1 Electronic Instrumentation Experiment 7 555 Timer Part A: Controlling Oscillation Frequency with Capacitors and Resistors Part B: Diodes and Light 555 Timer The 555 Timer is one of the most popular and versatile integrated circuits ever produced! It is 30 years old and still being used! It is a combination of digital and analog circuits. It is known as the “time machine” as it performs a wide variety of timing tasks. Applications for the 555 Timer include: • Bounce-free switches and Cascaded timers • Frequency dividers • Voltage-controlled oscillators • Pulse generators and LED flashers 2 7 DIS 8 V CC R 4 555 Timer 6 2 5 THR TR CV 3 GND Q 1 NE555 Each pin has a function, the meaning of which will become clearer later. Note some familiar components inside 3 Inside the 555 Timer 4 Inside the 555 Timer You will learn more about these components later in the course, for now just understand the following: • The voltage divider has three equal 5K resistors. It divides the input voltage (Vcc) into three equal parts. • The two comparators are op-amps which compare the voltages at their inputs and saturate depending upon which is greater. • The flip-flop is a bi-stable device. It generates two values, a “high” value equal to Vcc and a “low” value equal to 0V. • The transistor is being used as a switch, it connects pin 7 (discharge) to ground when it is closed. 5 Periodic Pulse Train from a 555 Timer 555-Timers, like op-amps can be configured in different ways to create different circuits. We will now look into how this one creates a train of equal pulses, as shown at the output. 6 First we must examine how capacitors charge 10V TCLOSE = 0 1 U1 R1 2 8V V V 1 V 1k 6V U2 V1 TOPEN = 0 Voltage C1 4V 2 10V Capacitor 1uF 2V 0V 0 0s 1ms V(U2:1) V(R1:2) 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms V(V1:+) Time Capacitor C1 is charged up by current flowing through R1 V1 V 10 V I CAPACITOR R1 CAPACITOR 1k As the capacitor charges up, its voltage increases and the current charging it decreases, resulting in the charging rate shown 7 Capacitor Charging Equations 10mA 10V 8mA 8V 6mA Capacitor and Resistor 6V Current Capacitor 4mA 4V 2mA 2V 0A Voltage 0V 0s 1ms I(R1) 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms I(C1) 0s 1ms V(U2:1) 2ms V(R1:2) 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms V(V1:+) Time Time I Ioe t Capacitor Current Capacitor Voltage V Vo 1 e Where the time constant t RC R1 C1 1ms 8 Understanding the equations 10V 8V 6V Capacitor Voltage 4V 2V 0V 0s 1ms V(U2:1) V(R1:2) 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms V(V1:+) Time Note that the voltage rises to a little above 1 6V in 1ms. (1 e ) .632 9 Capacitor Charging and Discharging There is a good description of capacitor charging and its use in 555 timer circuits at http://www.uoguelph.ca/~antoon/gadgets/555/555.html 10 555 Timer At the beginning of the cycle, C1 is charged through resistors R1 and R2. The charging time constant is ( R1 R2)C1 The voltage reaches (2/3)Vcc in a time 0.693( R1 R2)C1 11 555 Timer When the voltage on the capacitor reaches (2/3)Vcc, a switch (the transistor) is closed at pin 7 and the capacitor is discharged to (1/3)Vcc, at which time the switch is opened and the cycle starts over 12 555 Timer The capacitor voltage cycles back and forth between (2/3)Vcc and (1/3)Vcc at times and 1 0.693( R1 R2)C1 2 0.693( R2)C1 13 555 Timer The frequency is then given by 1 144 . f 0.693( R1 2 R2)C1 ( R1 2 R2)C1 14 555 Animation Output is high for 0.693(Ra+Rb)C Output voltage high turns off upper LED and turns on lower LED Capacitor is charging through Ra and Rb http://www.williamson-labs.com/pu-aa-555timer_slow.htm 15 555 Animation Output is low for 0.693(Rb)C Output is low so the upper LED is on and the lower LED is off Capacitor is discharging through Rb 16 Types of 555-Timer Circuits 5V DIS DIS 8 4 R 8 7 V CC 7 R V CC R 4 Ra 5V 1K C NE555 Astable Multivibrator puts out a continuous sequence of pulses CV GND 5 THR TR 3 LED NE555 1 LED 0.01 uF CV Q 6 2 1 C 0.01 uF 5 THR TR 3 1 6 2 GND Q 2 Rb Monostable Multivibrator (or one-shot) puts out one pulse each time the switch is connected 17 Monostable Multivibrator (One Shot) 8 Vcc Reset R Threshold Comparator Ra 2 Vcc 3 6 - R Q S Q Output 3 -V R - 2 1 Vcc 3 7 +V + Trigger C 4 +V + -V Trigger Comparator Control Flip-Flop R 1 Monstable Multivibrator One-Shot 18 Behavior of the Monostable Multivibrator The monostable multivibrator is constructed by adding an external capacitor and resistor to a 555 timer. The circuit generates a single pulse of desired duration when it receives a trigger signal, hence it is also called a one-shot. The time constant of the resistor-capacitor combination determines the length of the pulse. 19 Uses of the Monostable Multivibrator • Used to generate a clean pulse of the correct height and duration for a digital system • Used to turn circuits or external components on or off for a specific length of time. • Used to generate delays. • Can be cascaded to create a variety of sequential timing pulses. These pulses can allow you to time and sequence a number of related operations. 20 Astable Pulse-Train Generator (Multivibrator) Vcc 8 R R1 R2 4 Threshold Comparator - 6 +V + R Q S Q Output 3 -V R - 2 +V + -V Trigger Comparator 7 C Control Flip-Flop R 1 Astable Pulse-Train Generator 21 Behavior of the Astable Multivibrator The astable multivibrator is simply an oscillator. The astable multivibrator generates a continuous stream of rectangular off-on pulses that switch between two voltage levels. The frequency of the pulses and their duty cycle are dependent upon the RC network values. The capacitor C charges through the series resistors R1 and R2 with a time constant (R1 + R2)C. The capacitor discharges through R2 with a time constant of R2C 22 Uses of the Astable Multivibrator • • • • Flashing LED’s Pulse Width Modulation Pulse Position Modulation Periodic Timers (see mushroom timer in the experiment). 23 Flashing LED’s 40 LED bicycle light with 20 LEDs flashing alternately at 4.7Hz 24 PWM: Pulse Width Modulation Signal is compared to a sawtooth wave producing a pulse width proportional to amplitude 25 What Can Be Done With PWM? Low Duty Cycle Medium Duty Cycle High Duty Cycle Question: What happens if voltages like the ones above are connected to a light bulb? Answer: The longer the duty cycle, the longer the light bulb is on and the brighter the light. 26 What Can Be Done With PWM? Average power can be controlled Average flows can also be controlled by fully opening and closing a valve with some duty cycle 27 Pulse Position Modulation This is an optical transmitter. Astable is used to produce carrier pulses at a frequency we cannot hear (well above 20kHz) 28 Behavior of the Pulse Position Modulator This application generates a continuous stream of rectangular off-on pulses that switch between two voltage levels, BUT they vary in width. The frequency of the pulses and their duty cycle are dependent upon the RC network values AND the value of the input signal. When a signal is encoded like this, it can be transmitted and then decoded with a receiver. 29 Optical Receiver Circuit The receiver takes the optical pulses, reconstructs the signal, amplifies it, and plays it on a speaker. You will build this circuit in project 2. 30 Part B: Diodes and Light • The Light-Emitting Diode (LED) is a semiconductor pn junction diode that emits visible light or nearinfrared radiation when forward biased. • Visible LEDs emit relatively narrow bands of green, yellow, orange, or red light. Infrared LEDs emit in one of several bands just beyond red light. 31 Facts about LED’s • LEDs switch off and on rapidly, are very rugged and efficient, have a very long lifetime, and are easy to use. • They are current-dependent sources, and their light output intensity is directly proportional to the forward current through the LED. • Always operate an LED within its ratings to prevent irreversible damage. • Use a series resistor (Rs) to limit the current through the LED to a safe value. Usually a 330 Ω resistor is used in series with an LED when used with a 5V supply. • VLED is the LED voltage drop. It ranges from about 1.3 volts to about 2.5 volts. Vin VLED Rs • ILED is the specified forward current. I LED 32 33 34 Photodiodes and Phototransistors • Photodiodes are designed to detect photons and can be used in circuits to sense light. • Phototransistors are photodiodes with some Photodiode Light-detector internal amplification. Circuit Note: Reverse current flows through the + photodiode when it is sensing light. If photons excite carriers in a reverse- V biased pn junction, a very small current proportional to the light intensity flows. The sensitivity depends on the wavelength of light. I R 35