In this project, I will show you how to implement a Bipolar LED driver using 8051 microcontrollers. A Bipolar LED is totally different from a regular Bi-colour LED. A regular Bi-colour LED has three leads whereas a Bipolar LED has only two leads.
What is a Bi-Colour LED?
A Bi-color LED is a special type of LED that consists of two diodes connected in inverse biased to each other inside a package. A bi-colour LED generally consists of three terminals (a common pin and two separate pins). The common pin can be connected to the ground if it is a common cathode LED or connected to a +5V supply if it is a common anode. However, there is another type of bi-colour LED with two terminals called the Bipolar LED.
The device functions as per the positive signal given to one of the terminals. For instance, for a green and red bi-colour LED, a positive signal at the green terminal and a negative signal at the red terminal ensures the green LED is forward biased and the red LED is reverse biased. This happens the green light glow. Also the same for the red LED.
However, if both the terminals are given negative signals, neither of the diodes would conduct and the LED would remain off. If a positive signal is applied to both terminals, a different colour, based on the combination of the LED colours, would glow.
In this project, we are establishing a simple Bipolar LED driver circuit using an 8051 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 8051 microcontrollers, based on the inputs given from two push buttons.
Must Read Automatic Emergency Light
Principle of Bipolar LED Driver
The circuit uses here an 8051 microcontroller to drive the bipolar LED. The input command is given from the two pushbuttons and based on the inputs; while the microcontroller is configured to send appropriate high or low signals to the two output pins. These output pins are connected to the terminals of the bipolar LED respectively.
Project

Circuit Diagram

Components Required
- 8051 Microcontroller (AT89C51)
- Programmer for 8051 Microcontroller
- 11.0592 MHz Crystal
- Capacitors (33pF, 10µF/25V)
- Resistors (150Ω, 10KΩ)
- Push Buttons
- Bipolar LED
- Connecting Wires
- Breadboard
- 5V Power Supply
Circuit Connection
First, we need to connect the infrared transmitter in series with a 220 Ω resistor as follows. The cathode(+) of the led to the plus, and the anode(-) of the led with resistance and the resistance to the ground.
Next, we will connect the receiver in reverse-biased mode and in parallel with the transmitter. The anode(-) will be connected to plus and the cathode(+) in series with the 10 KΩ resistance and the resistance to the ground.
At the point when the infrared sensor doesn’t capture infrared radiation, it has an extremely high internal resistance and the output voltage will be little. Also, when it begins to capture the radiation, its internal resistance will be exceptionally low and the output voltage will get higher.
At this point, the sensor is functioning and we will add a 1 KΩ resistance in series with the LED. The resistor is connected to pin 1 and in series with the led that is grounded.
Software for The Microcontroller
The following steps for the microcontroller are below.
- Create a new project in the Keil µVision IDE window
- Select the target device for the project. Here, we are using AT89C51 from Atmel
- Create a new file such that a blank text field appears
- Write the code using the following algorithm
- Assign variables 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 the .c extension
- Add the code to the source folder under the target folder
- Create a Hex file by clicking the ‘Configure Flash Tools’ under the ‘Flash’ menu
Working of Bipolar LED Driver
When the whole circuit is switched on, the microcontroller continuously scans the input pins at port P0. Suppose the first button (P0.6) is pressed, the microcontroller receives a low logic signal at the corresponding input pin. Accordingly, it assigns a high logic signal to pin P0.0 and low logic signal to pin P0.1. This happens to the red LED to glow.
Now when the second button is pressed, the microcontroller will accordingly assign a low logic signal to pin P0.0 and a high logic signal to pin P0.1. This happens to the green LED to glow.
The LED stays on until the button is released.
Must read 230v LED Driver Circuit
Microcontroller Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include<reg51.h> sbit red = P0^0; sbit green = P0^1; sbit red_switch = P0^6; sbit green_switch = P0^7; unsigned char i=0; void delay (int); void main() { red=0; green=0; while(1) { if(red_switch==0) { green=0; red=1; while(red_switch==0); } else if(green_switch==0) { green=1; red=0; while(green_switch==0); } } } |
Application of Bipolar LED Driver
- This circuit can be used for indication purposes.
- This circuit can be used in applications where the flashing of light is required, as in the case of police or ambulance siren lights.