Driving Relays and LED's with TTL and CMOS Outputs

 

 

 

 

         

Digital devices need to interface with mechanical relays and LED's from time to time.  Below are examples of how TTL and CMOS digital outputs are usually connected to relays and LED's.

   

 

 

 

Figure 1. A Mechanical Relay Driven by a TTL or CMOS Output

  

Figure 1 shows how a TTL or CMOS output may be used to control a mechanical relay.  Actually, the logic gate is just driving the base of the transistor, not the relay. It is the transistor that energizes the relay. A gate output of 'high' turns on the transistor, energizing the coil of the relay.  A gate output of 'low' turns off the transistor, causing the relay to deactivate. Since the relay coil is an inductor, it will generate a large voltage across the transistor if the latter turns off while current is flowing through the coil (an inductor opposes an instantaneous change in current).  This inductive kick can destroy the transistor. To protect it from damage, a diode is placed at its collector as shown in Figure 1, so that any large voltage appearing at the transistor's collector will cause the diode to conduct, shunting the energy towards the positive supply.

    

Figure 2. LED Turned 'On' by a TTL or CMOS Output of '1'

  

Figure 2  shows how a light-emitting diode (LED) may be controlled by a TTL or CMOS output. In this configuration, the LED turns on when the output of the gate is 'high'. A current-limiting resistor is placed between the LED and the gate output to protect both the LED and the output.  The lower the resistor, the brighter is the LED when it is lit.  If the output of the gate is driving just the LED, the resistor may be as low as 330 ohms for a 5V supply.  However, if the gate output will also be used to drive another gate's input, the current through the LED must be reduced significantly (by using a much higher resistor) to ensure that the gate's high output voltage will still meet the minimum level required to be recognized as a '1'. 

    

Figure 3. LED Turned 'On' by a TTL or CMOS Output of '0'

  

Figure 3 shows another way of connecting a light-emitting diode (LED) to a TTL or CMOS output. In this configuration, the LED turns on when the output of the gate is 'low'.

    

See Also:  Logic Gates; TTLThe Transistor as a Switch

See More Articles

HOME