EDN logo


Design Ideas: September 14, 1995

Two signals easily control tricolor LED

Bob Richards,
Digital Audio Corp, Raleigh, NC

Tricolor LEDs come in two- and three-pin packages. Although the three-pin, or common-cathode, package easily lends itself to 2-bit control, wiring three crowded pins can be mechanically difficult. Also, fewer manufacturers produce the three-pin types. The two-pin package is easier to connect to a wiring harness and is readily available. However, this package requires more control overhead, because, to light the LED yellow, the device must continuously alternate between red and green. The circuit in Fig 1 allows two output-port bits to control a two-pin LED without any CPU overhead.

The figure shows a tricolor LED connected to the output of a J-K flip-flop with a series current-limiting resistor. A continuously running clock source, CLOCK, and two color select bits, SIN and RIN, from an output port drive the flip-flop. This circuit exploits the fact that driving the SET and RESET inputs of a 74xx109 low causes both flip-flop outputs to go to the same state, thus turning the tricolor LED off.

By driving the SIN and RIN inputs as in Table 1, you can light the LED in any of the three colors in addition to turning it off. For example, a low setting on both SIN and RIN asynchronously drives both flip-flop outputs high, and the LED turns off. Setting either SIN or RIN low produces red or green, respectively. When both inputs are high, the J-K input settings force the flip-flop into a toggle mode. This mode alternately drives the LED red and green at the clock rate. The clock frequency should be between 100 Hz and 500 kHz to avoid flicker and give maximum illumination time. Fig 1's circuit uses an HCT flip-flop because it can both sink and source current.

Table 1 -- LED color states
InputOutput
SINRINQQLED Color
LLHHOff
HLLHGreen
HH(Fast Toggle)Yellow
LHHLRed


| EDN Access | feedback | subscribe to EDN! |
| design features | design ideas |


Copyright © 1995 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.