A Bi color LED is a special type of LED consists of two diodes connected in inverse direction to each other inside a package. A bi color LED generally consists of three terminals- a common pin and two separate pins. The common pin can be connected to ground if it is a common anode LED or connected to +5V supply, if it is a common cathode. However there is another type of bi color LED with two terminals. The device functions as per the positive signal given to one of the terminals. For instance for a green and red bi color LED, a positive signal at the green terminal and negative signal at red terminal ensures the green LED to be forward biased and red LED to be reverse biased. This causes the green light to flash. Same is the case for the red LED. However if both the terminals are given negative signals, neither of the diodes would conduct and the device would remain off. If positive signal is applied to both the terminals, a different color, based on the combination of the LED colors, would flash.
Related Post: Bi Color LED Dancing Lights
Here, we are designing a simple bi color LED driver circuit using a Microcontroller. The LED used here has a forward voltage drop of 2.2V and hence can be biased using a 5V supply. The control is done by the microcontroller program, based on the inputs given from two push buttons.
Principle Behind Bi-Polar LED Driver Circuit:
The circuit uses a microcontroller to drive the bipolar LED. The input command is given from the three push buttons and based on the inputs; the microcontroller is accordingly programmed to send appropriate signals to the two output pins. These output pins are connected to the terminals of the bi-polar LED.
Bipolar LED Driver Circuit Diagram:
Bipolar LED Driver Circuit Design:
It is a simple circuit and the design mainly involves designing the interfacing of Microcontroller, designing the oscillator and reset circuits for the microcontroller and selection of the LED resistor.
The microcontroller interfacing is accomplished by connecting two push button switches to port P1 and connecting the two terminals of bi color LED to port P2.
The oscillator design is done by selecting two 10pF ceramic capacitors in order to provide stability. The clock signal is generated using an 11MHz Crystal Oscillator. The reset circuit is designed by selecting an electrolyte capacitor of 10uF and a resistor of 10K to achieve a reset pulse width of 100ms. The voltage drop across the resistor is kept around 1.2V.
The first part of design involves writing the code for the microcontroller. This involves the following steps.
- Create a new project in the Keil window.
- Select the target device for the project. Here we select AT89C51 from Atmel.
- Create a new file such that a blank text field appears.
- Write the code. The code is written, keeping in mind the following algorithm,
- Assign a variable to the input and output port.
- Check if one of the inputs is active low.
- In case one of the inputs is at logic low, assign a logic high signal to one of the LED terminals.
- In case none are at logic low, make sure the LED is switched off.
- Save the code with .c extension.
- Add the code to the source folder under target folder.
- Create a Hex file by clicking the ‘Configure Flash Tools’ under ‘Flash’ menu.
The second part involves drawing the circuit on simulation software. Here we use Proteus. The circuit is drawn based on the design method described above.
The third part involves simulating the circuit. This is done by first adding the hex file to the microcontroller and then clicking on the run button.
Also Read the Related Post: 230v LED Driver Circuit
Working of Bipolar LED Driver Circuit
Once the circuit is switched on, the microcontroller continuously scans the input pins at port P1. Suppose the first button is pressed, the microcontroller receives a low logic signal at the corresponding input pin and accordingly the compiler assigns a high logic signal to pin P0.0 and low logic signal to pin P0.1. This causes the red light of the LED to glow.
Now when the second button is pressed, the compiler will accordingly assign a low logic signal to the pin P0.0 and a high logic signal to pin P0.1. This causes the green light to glow. On pressing the third button, low logic signals will be assigned to both the output pins and the LED will be switched off. In the meanwhile a low logic signal is always given to the common pin.
Bipolar LED Driver Applications:
- This circuit can be used for indication purposes.
- This circuit can be used at applications where flashing of light is required, as in beacon flashing.
Limitations of Bipolar LED Driver Circuit:
- This is a theoretical circuit and may require changes for practical implementations.
- Most of the bi color LEDs requires higher supply voltage than 5V because of their higher forward voltage rate and this circuit only provides 5V supply voltage to the LED.
- The LED resistor provides a voltage drop which decreases the biasing voltage of the LED.