Simple Circuit for Controlling LED Strip using Arduino Mega and ULN2803

<<<<  Previous : 3 Digit Seven Segment Display Counter with EEPROM using Arduino Mega

LED strips are the most recent trend in interior as well exterior designing. LED strips are amazing by it’s availability in various colors and simplicity in handling. Controlling LED strips using Arduino is an interesting task. Arduino is not capable of supplying enough current to turn an LED strip directly. So, a driver IC should be installed in between arduino and LED strip. Circuit is done as shown in the following diagram.

Simple Circuit for Controlling LED Strip using Arduino Mega and ULN2803

Simple Circuit for Controlling LED Strip using Arduino Mega and ULN2803

ULN2803 is the commonly used driver IC. It is a high voltage, high current darlington transistor array ideally suited for interfacing low logic level digital circuits and high voltage/current circuits such as relays, motors, lamps etc.

Pin out diagram of ULN2803

Pin out diagram of ULN2803

Pin out diagram of ULN2803

Connection between arduino mega and ULN2803 can be summarized as:

  • 13th digital pin of arduino is connected to the 1st pin of ULN2803.
  • 12th digital pin of arduino is connected to the 2nd pin of ULN2803.
  • 11th digital pin of arduino is connected to the 3rd pin of ULN2803.

Connection between ULN2803 and LED strips can be summarized as:

  • 18th pin of ULN2803 is connected to the cathode terminal of 1st LED strip.
  • 17th pin of ULN2803 is connected to the cathode terminal of 2nd LED strip.
  • 16th pin of ULN2803 is connected to the cathode terminal of 3rd LED strip.

Anode terminals of all the LED strips are connected to the positive terminal of 12V voltage source. Ground terminal of ULN2803 should be connected to the Gnd pin of arduino mega.

  1. If 13th digital pin of arduino is HIGH, LED strip 1 will turn on.
  2. If 12th digital pin of arduino is HIGH, LED strip 2 will turn on.
  3. If 11th digital pin of arduino is HIGH, LED strip 3 will turn on.

Now upload the following program to your arduino board.

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
  // initialize digital pin 12 as an output.
  pinMode(12, OUTPUT);
  // initialize digital pin 11 as an output.
  pinMode(11, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  // Turn on LED strip 1
  digitalWrite(13, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);  
  delay(1000);

  // Turn on LED strip 2  
  digitalWrite(13, LOW);
  digitalWrite(12, HIGH);
  digitalWrite(11, LOW);  
  delay(1000);
  
  // Turn on LED strip 3
  digitalWrite(13, LOW);
  digitalWrite(12, LOW);
  digitalWrite(11, HIGH);  
  delay(1000);  
}

If the uploading is successful, LED strips will turn on one after another in one second delay. Only one strip will be on at a time.

Next : Video Demonstration of Controlling LED Strip using Arduino Mega and ULN2803 >>>>

(Visited 6,214 times, 1 visits today)
paulpp644
A deep electronic enthusiast who spent most of my time for electronic experiments. I am also interested in publishing my experiments in my blog for helping other electronics enthusiasts.