555 Timers

Embed Size (px)

Citation preview

  • 8/11/2019 555 Timers

    1/49

    Electronic Instrumentation

    1

    Experiment 7 Digital Logic Devices and the 555 Timer

    Part A: Basic Logic GatesPart B: Flip FlopsPart C: Counters

    Part D: 555 Timers

    5V

    1

    2

    +

    -14161

    345

    6

    710

    921

    141312

    11

    15

    P1P2P3P4

    PETELDCLKCL

    Q1Q2Q3Q4

    CO

  • 8/11/2019 555 Timers

    2/49

    20 March 2007 Electronic Instrumentation 2

    Part A Basic Logic Gates

    Combinational Logic DevicesBoolean AlgebraDeMorgans Laws Timing Diagrams

  • 8/11/2019 555 Timers

    3/49

    20 March 2007 Electronic Instrumentation 3

    Combinational Logic DevicesLogic Gates perform basic logic operations, such asAND, OR and NOT, on binary signals.We can model the behavior of these chips byenumerating the output they produce for all possibleinputs.In order to show this behavior, we use truth tables ,

    which show the output for all input combinations.The outputs of combinational logic gates depend onlyon the instantaneous values of the inputs.

  • 8/11/2019 555 Timers

    4/49

    20 March 2007 Electronic Instrumentation 4

    Logic Gates

  • 8/11/2019 555 Timers

    5/49

    20 March 2007 Electronic Instrumentation 5

    Logic Gate Example: XOR

    Input Input OutputA B X0 0 0

    0 1 11 0 11 1 0

    Question: Whatcommonhouseholdswitchconfiguration

    corresponds toan XOR?

  • 8/11/2019 555 Timers

    6/49

    20 March 2007 Electronic Instrumentation 6

    Boolean Algebra

    The variables in a boolean, or logic, expression can takeonly one of two values, 0 (false) and 1 (true).

    We can also use logical mathematical expressions to analyze binary operations, as well.

    http://www.play-hookey.com/digital/derived_gates.htmlhttp://www.play-hookey.com/digital/derived_gates.htmlhttp://www.play-hookey.com/digital/derived_gates.htmlhttp://www.play-hookey.com/digital/basic_gates.htmlhttp://www.play-hookey.com/digital/basic_gates.htmlhttp://www.play-hookey.com/digital/basic_gates.html
  • 8/11/2019 555 Timers

    7/49

    20 March 2007 Electronic Instrumentation 7

    The basis of boolean algebra lies in the operations oflogical addition , or the OR operation, and logicalmultiplication , or the AND operation.

    OR Gate If either X or Y is true (1), then Z is true (1)

    AND Gate If both X and Y are true (1), then Z is true (1)

    Logic gates can have an arbitrary number of inputs. Note the similarities to the behavior of the mathematical

    operators plus and times.

  • 8/11/2019 555 Timers

    8/49

    20 March 2007 Electronic Instrumentation 8

    Laws of Boolean Algebra

  • 8/11/2019 555 Timers

    9/49

    20 March 2007 Electronic Instrumentation 9

    DeMorgans Laws

  • 8/11/2019 555 Timers

    10/49

    20 March 2007 Electronic Instrumentation 10

    Timing Diagrams sequential logic

    When we deal with binary signals, we are not worried aboutexact voltages.

    We are only concerned with two things: Is the signal high or low?

    When does the signal switch states? Relative timing between the state changes of different binary

    signals is much easier to see using a diagram like this.

  • 8/11/2019 555 Timers

    11/49

    20 March 2007 Electronic Instrumentation 11

    Part B Flip Flops

    Sequential Logic DevicesFlip FlopsBy-Pass Capacitors

  • 8/11/2019 555 Timers

    12/49

    20 March 2007 Electronic Instrumentation 12

    Sequential Logic Devices

    In a sequential logic device, the timing or sequencingof the input signals is important. Devices in thisclass include flip-flops and counters.

    Positive edge-triggered devices respond to a low-to-high (0 to 1) transition, and negative edge-triggereddevices respond to a high-to-low (1 to 0) transition.

    01 positive

    edgepositive

    edgenegative

    edges

  • 8/11/2019 555 Timers

    13/49

    20 March 2007 Electronic Instrumentation 13

    Flip-Flops A flip-flop is a sequential device that can store and

    switch between two binary states. It is called a bistable device since it has two and only

    two possible output states: 1 (high) and 0 (low). It has the capability of remaining in a particular state

    (i.e., storing a bit) until the clock signal and certaincombinations of the input cause it to change state.

  • 8/11/2019 555 Timers

    14/49

    20 March 2007 Electronic Instrumentation 14

    Simple Flip Flop Example: The RS Flip-Flop

    Q = 1

    Q = 0

    Note that the output depends onthree things: the two inputs andthe previous state of the output.

  • 8/11/2019 555 Timers

    15/49

    20 March 2007 Electronic Instrumentation 15

    Inside the R-S Flip Flop

    Note that the enable signal is the clock, which regularly pulses.This flip flop changes on the rising edge of the clock. It looks atthe two inputs when the clock goes up and sets the outputsaccording to the truth table for the device.

  • 8/11/2019 555 Timers

    16/49

    20 March 2007 Electronic Instrumentation 16

    Inside the J-K Flip Flop

    Note this flip flop, although structurally more complicated, behavesalmost identically to the R-S flip flop, where J(ump) is like S(et) andK(ill) is like R(eset). The major difference is that the J-K flip flopallows both inputs to be high. In this case, the output switches stateor toggles.

    http://www.play-hookey.com/digital/jk_nand_flip-flop.html
  • 8/11/2019 555 Timers

    17/49

    20 March 2007 Electronic Instrumentation 17

    By-Pass Capacitors

    In a sequential logic device, a noisy signal can generateerroneous results.By-pass capacitors are placed between 5V and 0V to filterout high frequency noise.A by-pass capacitor should be used in any circuit involving asequential logic device to avoid accidental triggering.

    V+

    GND

  • 8/11/2019 555 Timers

    18/49

    20 March 2007 Electronic Instrumentation 18

    Part C: Counters

    Binary NumbersBinary Counters

  • 8/11/2019 555 Timers

    19/49

    20 March 2007 Electronic Instrumentation 19

    Binary Decimal -- Hexadecimal Conversion10110101110001011001110011110110 binary number

    11 5 12 5 9 12 15 6

    B 5 C 5 9 C F 6

    equivalent base 10 value foreach group of 4 consecutive

    binary digits (bits)

    corresponding hexadecimal(base 16) digit

    B5C59CF6

    equivalent hexadecimal

    number

    Decimal 8 = 1x2 3 + 0x2 2 + 0x2 1 +0x2 0 = 01000 in BinaryCalculator Applet

    http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.htmlhttp://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html
  • 8/11/2019 555 Timers

    20/49

    20 March 2007 Electronic Instrumentation 20

    Binary CountersBinary Counters do exactly what it sounds like they should.They count in binary.Binary numbers are comprised of only 0s and 1s.

    Decimal QD QC QB QA

    0 0 0 0 01 0 0 0 12 0 0 1 03 0 0 1 1

    4 0 1 0 05 0 1 0 1

  • 8/11/2019 555 Timers

    21/49

    20 March 2007 Electronic Instrumentation 21

    Binary Counters are made with Flip Flops

    Each flip flop corresponds to one bit in the counter.Hence, this is a four-bit counter.

    DC BA = 1100

    DCB A = 1111

    http://www.play-hookey.com/digital/synchronous_counter.htmlhttp://www.play-hookey.com/digital/synchronous_counter.htmlhttp://www.play-hookey.com/digital/synchronous_counter.htmlhttp://www.play-hookey.com/digital/synchronous_counter.html
  • 8/11/2019 555 Timers

    22/49

    20 March 2007 Electronic Instrumentation 22

    Typical Output for Binary Counter

    Note how the Q outputs form 4 bit numbersDCBA = 1111DCBA = 1100

    1100=12

  • 8/11/2019 555 Timers

    23/49

    20 March 2007 Electronic Instrumentation 23

    Part D: 555-Timers

    The 555 TimerInside the 555-TimerTypes of 555-Timer CircuitsUnderstanding the Astable Mode CircuitModulationPulse Width Modulation

  • 8/11/2019 555 Timers

    24/49

    20 March 2007 Electronic Instrumentation 24

    The 555 Timer is one of the most popularand 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 widevariety 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

    The 555 Timer

  • 8/11/2019 555 Timers

    25/49

    20 March 2007 Electronic Instrumentation 25

    555 Timer

    Each pin has a function Note some familiar components inside

    NE555

    2

    5

    3

    7

    6

    4 8

    1

    TR

    CV

    Q

    DIS

    TH R

    R

    V C C

    G N D

  • 8/11/2019 555 Timers

    26/49

    20 March 2007 Electronic Instrumentation 26

    Inside the 555 Timer

  • 8/11/2019 555 Timers

    27/49

    20 March 2007 Electronic Instrumentation 27

    The voltage divider (blue) has three equal 5Kresistors. It divides the input voltage (Vcc) intothree equal parts.

    The two comparators (red) are op-amps thatcompare the voltages at their inputs and saturatedepending upon which is greater.

    The Threshold Comparator saturates when the voltageat the Threshold pin (pin 6) is greater than (2/3)Vcc.

    The Trigger Comparator saturates when the voltage atthe Trigger pin (pin 2) is less than (1/3)Vcc

    Inside the 555 Timer

  • 8/11/2019 555 Timers

    28/49

    20 March 2007 Electronic Instrumentation 28

    The flip-flop (green) is a bi-stable device. Itgenerates two values, a high value equal to Vccand a low value equal to 0V.

    When the Threshold comparator saturates, the flip flop isReset (R) and it outputs a low signal at pin 3.

    When the Trigger comparator saturates, the flip flop is Set

    (S) and it outputs a high signal at pin 3. The transistor (purple) is being used as a switch, it

    connects pin 7 (discharge) to ground when it isclosed.

    When Q is low, Qbar is high. This closes the transistorswitch and attaches pin 7 to ground.

    When Q is high, Qbar is low. This open the switch and pin 7 is no longer grounded

  • 8/11/2019 555 Timers

    29/49

    20 March 2007 Electronic Instrumentation 29

    Types of 555-Timer Circuits

    Astable Multivibrator puts out a continuoussequence of pulses

    5V

    Ra

    C 0

    . 0 1 u

    F

    LED

    NE555

    2

    5

    3

    7

    6

    4 8

    1

    TR

    CV

    Q

    DIS

    THR

    R

    V C C

    G N D

    Rb

    5V

    1

    2

    1K

    0 . 0

    1 u

    F

    C

    R

    LED

    NE555

    2

    5

    3

    7

    6

    4 8

    1

    TR

    CV

    Q

    DIS

    THR

    R

    V C C

    G N D

    Monostable Multivibrator(or one-shot) puts out one

    pulse each time theswitch is connected

  • 8/11/2019 555 Timers

    30/49

    20 March 2007 Electronic Instrumentation 30

    Monostable Multivibrator (One Shot)

    +V

    -V

    -

    +

    +V

    -V

    -

    +R

    S

    Q

    Q

    3

    4

    1

    7

    2

    6

    8

    R

    R

    R

    Control Flip-FlopTrigger Comparator

    Threshold Comparator

    Output

    ResetVcc

    Trigger

    Monstable Multivibrator One-Shot

    C

    R acc

    2V

    3

    cc1

    V3

  • 8/11/2019 555 Timers

    31/49

    20 March 2007 Electronic Instrumentation 31

    Behavior of the Monostable MultivibratorThe monostable multivibrator is constructed by adding anexternal capacitor and resistor to a 555 timer.The circuit generates a single pulse of desired durationwhen it receives a trigger signal, hence it is also called aone-shot.

    The time constant of theresistor-capacitorcombination determinesthe length of the pulse.

  • 8/11/2019 555 Timers

    32/49

    20 March 2007 Electronic Instrumentation 32

    Used to generate a clean pulse of the correctheight and duration for a digital system

    Used to turn circuits or external componentson 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 ofrelated operations.

    Uses of the Monostable Multivibrator

  • 8/11/2019 555 Timers

    33/49

    20 March 2007 Electronic Instrumentation 33

    Astable Pulse-Train Generator (Multivibrator)

    +V

    -V

    -

    +

    +V

    -V

    -

    +R

    S

    Q

    Q

    3

    4

    1

    7

    2

    6

    8

    R

    R

    R

    Control Flip-FlopTrigger Comparator

    Threshold Comparator

    Output

    Vcc

    Astable Pulse-Train Generator

    C

    R 1

    R 2

  • 8/11/2019 555 Timers

    34/49

    20 March 2007 Electronic Instrumentation 34

    Behavior of the Astable MultivibratorThe astable multivibrator is simply an oscillator. The astablemultivibrator generates a continuous stream of rectangular off-o

    pulses that switch between two voltage levels.The frequency of the pulses and their duty cycle are dependentupon the RC network values.

    The capacitor C charges through the series resistors R 1 and R 2with a time constant(R 1 + R 2)C.The capacitor dischargesthrough R 2 with a timeconstant of R 2C

  • 8/11/2019 555 Timers

    35/49

    20 March 2007 Electronic Instrumentation 35

    Flashing LEDs Pulse Width Modulation Pulse Position Modulation

    Periodic Timers

    Uses of the Astable Multivibrator

  • 8/11/2019 555 Timers

    36/49

    20 March 2007 Electronic Instrumentation 36

    Flashing LEDs

    40 LED bicycle light with 20 LEDs flashingalternately at 4.7Hz

  • 8/11/2019 555 Timers

    37/49

    20 March 2007 Electronic Instrumentation 37

    Understanding the Astable Mode Circuit

    555-Timers, like op-amps can be configured in different ways tocreate different circuits. We will now look into how this onecreates a train of equal pulses, as shown at the output.

  • 8/11/2019 555 Timers

    38/49

    20 March 2007 Electronic Instrumentation 38

    First we must examine how capacitors charge

    Capacitor C1 is charged up by current flowingthrough R1

    As the capacitor charges up, its voltage increasesand the current charging it decreases, resulting inthe charging rate shown

    VV V

    R1

    1k

    U2

    TOPEN = 0

    1

    2C1

    1uF

    U1

    TCLOSE = 0

    1 2

    0

    V110V

    I V V

    RV

    k CAPACITOR CAPACITOR

    11

    101

    T i m e

    0 s 1 m s 2 m s 3 m s 4 m s 5 m s 6 m s 7 m s 8 m s 9 m s 1 0 m s

    V ( U2 :1 ) V ( R1 :2 ) V (V 1 :+ )

    0V

    2V

    4V

    6V

    8V

    10 V

    C a p a c i t o r V o l t a g e

  • 8/11/2019 555 Timers

    39/49

    20 March 2007 Electronic Instrumentation 39

    Capacitor Charging Equations

    Capacitor Current

    Capacitor Voltage

    Where the time constant

    T i m e

    0 s 1 m s 2 m s 3 m s 4 m s 5 m s 6 m s 7 m s 8 m s 9 m s 1 0 m s

    I (R 1) I (C 1)

    0A

    2m A

    4m A

    6m A

    8m A

    1 0 m A

    C a p a c i t o r a n d R e s i s t o r C u r r e n t

    T i m e

    0 s 1 m s 2 m s 3 m s 4 m s 5 m s 6 m s 7 m s 8 m s 9 m s 1 0 m s

    V (U 2: 1) V (R 1: 2) V (V 1: +)

    0V

    2V

    4V

    6V

    8V

    10 V

    C a p a c i t o r Vo l t a g e

    I I eot

    V V eot

    1

    RC R C ms1 1 1

  • 8/11/2019 555 Timers

    40/49

    20 March 2007 Electronic Instrumentation 40

    Understanding the equations

    Note that the voltage rises to a little above 6Vin 1ms.

    T i m e

    0 s 1 m s 2 m s 3 m s 4 m s 5 m s 6 m s 7 m s 8 m s 9 m s 1 0 m s

    V ( U 2 : 1 ) V ( R 1 : 2 ) V ( V 1 : + )

    0 V

    2 V

    4 V

    6 V

    8 V

    1 0 V

    C a p a c i t o r Vo l t a g e

    ( ) .1 6321 e

  • 8/11/2019 555 Timers

    41/49

    20 March 2007 Electronic Instrumentation 41

    Capacitor Charging and Discharging

    There is a good description of capacitor chargingand its use in 555 timer circuits athttp://www.uoguelph.ca/~antoon/gadgets/555/555.html

    http://www.uoguelph.ca/~antoon/gadgets/555/555.htmlhttp://www.uoguelph.ca/~antoon/gadgets/555/555.html
  • 8/11/2019 555 Timers

    42/49

    20 March 2007 Electronic Instrumentation 42

    555 Timer At the beginning of thecycle, C1 is charged throughresistors R1 and R2. Thecharging time constant is

    The voltage reaches

    (2/3)Vcc in a time

    1)21(693.01arg C R RT t ech

    1)21(arg C R Rech

  • 8/11/2019 555 Timers

    43/49

    20 March 2007 Electronic Instrumentation 43

    555 Timer

    When the voltage on thecapacitor reaches (2/3)Vcc,a switch (the transistor) isclosed (grounded) at pin 7.

    The capacitor is dischargedto (1/3)Vcc through R2 toground, at which time theswitch is opened and thecycle starts over.

    1)2(arg C Redisch

    1)2(693.02arg C RT t edisch

  • 8/11/2019 555 Timers

    44/49

    20 March 2007 Electronic Instrumentation 44

    555 Timer

    The frequency is then given by

    f R R C R R C

    10 693 1 2 2 1

    1441 2 2 1. ( )

    .( )

    A i i

  • 8/11/2019 555 Timers

    45/49

    20 March 2007 Electronic Instrumentation 45

    Output voltage highturns off upper LEDand turns on lowerLED

    Capacitor is charging through R a and R b

    Output is high for0.693(R a+R b)C

    555 Animation

    http://www.williamson-labs.com/pu-aa-555-timer_slow.htm

    555 A i i

    http://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htmhttp://www.williamson-labs.com/pu-aa-555-timer_slow.htm
  • 8/11/2019 555 Timers

    46/49

    20 March 2007 Electronic Instrumentation 46

    Output is lowso the upperLED is on andthe lower LEDis off

    Capacitor is dischargingthrough R b

    Output is low for0.693(R b)C

    555 Animation

  • 8/11/2019 555 Timers

    47/49

    20 March 2007 Electronic Instrumentation 47

    PWM: Pulse Width Modulation

    Signal is compared to a sawtooth wave producing a pulse width proportional toamplitude

  • 8/11/2019 555 Timers

    48/49

    20 March 2007 Electronic Instrumentation 48

    What Can Be Done With PWM?

    Question: What happens if voltages like the

    ones above are connected to a light bulb?Answer: The longer the duty cycle, thelonger the light bulb is on and the brighter

    the light.

    LowDuty Cycle

    Medium

    Duty Cycle

    High

    Duty Cycle

  • 8/11/2019 555 Timers

    49/49

    What Can Be Done With PWM?

    Average power can be controlledAverage flows can also be controlled by fully openingand closing a valve with some duty cycle