Bukit Mertajam, Penang

Lighting up RGB LED Strip – Arduino

Hello there everybody, have you ever been fascinated by the RGB LEDs on shops, houses and etc? I will be going through the basics of RGB LED Strip and how will you hook it up with an Arduino Uno. Don’t worry, it is simple and fast. This tutorial is being split into 3 sections. Hardware Introduction, Hands-on and Troubleshoot Let’s get started.



Hardware Introduction

I will being using RGB LED strip from Cytron Technologies. Bear in mind, this is not RainbowStrip, this is 1 meter RGB LED strip. The 1 meter version of the RGB LED Strip have 60 surface mounted 5060 LEDs. Although there is no coating to make it waterproof, it is possible to gain access to every single led. It is an incredible product costing only RM18.

Apart from that, the RGB LED Strip is soldered with 4-pin rounded terminal holes and pin headers. It also have a double-sided tape on the back, which will make it easier for you to stick onto anywhere you like.

Here comes the main part, this product can only be powered with 12VDC. It will draw about 1 Ampere when all red, green and blue LED are at full brightness. So you will need a high current transistor to handle this enormous current. I am using TIP31, The following are the features posted at Cytron’s website:


  • 60 RGB LEDs per meter
  • 12VDC
  • 1 meter length
  • Bare strip, non water-proof
  • Common Anode Configuration
  • Current Comsuption (1 meter-60 LEDs): Red color only will consume ~ 400mA
  • Current Comsuption (1 meter-60 LEDs): Blue color only will consume ~ 400mA
  • Current Comsuption (1 meter-60 LEDs): Green color only will consume ~ 420mA
  • Current Comsuption (1 meter-60 LEDs): White color (all RGB active) will consume ~ 1050mA

RGB pinout


Here are the list of items needed to play with RGB LED Strip.
You will need:

1 pcs of Arduino UNO, this is a microcontroller development board which you can program it using a computer. You can also consider using Cytron version of Arduino UNO, CT-UNO, it is cheaper.

1 pcs of Breadboard/prototyping board (any size), prototyping board which you can use to build circuit to avoid soldering.

3 pcs of Transistor TIP31, I use TIP31 instead of other normal transistor like 2N3904 with simple reason: Transistor like 2N3904 cannot handle high current that RGB LED strip needs. If you look at the datasheet, 2N3904 is only able to handle 200mA. RGB LED strip will consume more than that, you will burn the 2N3904 transistor if it is used. TIP31 transistor is more suitable. It is not available at cytron but you can get it from your local component store.

1 pcs of RGB LED Strip (both 1 meter or 5 meter strip will work)        

1 pcs of 12VDC power supply. If you are using 1 meter version of LED strip, I recommend this 2A 12V adapter from Cytron. You might also need the DC jack female to obtain the 12V (+ and – terminal) and connect it via to breadboard.
If you are using 5 meter version of LED strip, I would recommend this 4.2A 12V switching supply

1 pack of male to male jumper wires, these are high quality jumper wire. They won’t snap easily. There are 65 pcs in a pack, that is more than enough.


Connect 12V supply onto the breadboard.

Connect your 12 volt supply’s voltage supply pin and ground pin to  the supply lines of the breadboard.

Step 1

Connect Arduino’s Ground pin with the 12V supply’s ground

Connect your Arduino’s ground pin with the 12 volt supply’s ground pin. It is very important that you do not make wrong connection else it might fry your Arduino.

Step 2

Place transistor TIP31 onto your breadboard

Insert all of the TIP31 onto the breadboard.

Step 3

Connect TIP31

 TIP31 pinout

The connection should be as follow:
Base => Arduino’s 9, 10, 11, output pins respectively
Collector => Ground
Emitter => RGB led Strip’s red, green, blue wire respectively

Step 4

Connect RGB LED Strip’s 12V supply

Connect the 12V power supply’s positive pin to your RGB LED strip’s black colored wire.

Step 5

Upload Arduino Sketch

Here is the sketch into Arduino UNO. 


[code lang=”c” highlight=””]
void setup() {
// put your setup code here, to run once:





void loop() {
// put your main code here, to run repeatedly:
for(int fade = 0; fade <=255; fade +=5){
for(int fade = 255; fade >= 0; fade -=5){
for(int fade = 0; fade <=255; fade +=5){
for(int fade = 255; fade >= 0; fade -=5){
for(int fade = 0; fade <=255; fade +=5){
for(int fade = 255; fade >= 0; fade -=5){



Once you upload the sketch. The RGB LED strip will fade in and fade out with different colors.

Now, you turn, try modifying the sketch and show us

Try changing the delay time from 30 to 10. You should see the RGB LED fade faster. Share with us in our facebook 🙂


If it doesn’t work:

  • Check the connections.
  • Make sure that you connect the RGB LED strip’s black wire to 12 volt supply positive line.
  • Check the 12V supply’s voltage to see if it is really supplying 12 volt.
  • Check TIP31’s connection.
  • Make sure the base pin is connected to Arduino’s output pin, the collector to ground and the emitter to RGB LED strip’s color terminal respectively.

This is my first time making a tutorial, if my tutorial is unclear or have problems, just discuss in our technical forum. I will read it everyday 🙂 BTW, I am 15 years old when I write this tutorial! 



Related Posts

Comments (5)

it took just 15 mins to setup… and its work like a charm….
Thank you very much….

is it possible to mix the colours instead of just having R G and B please comment the code if you have it

Yes it is possible. Just light up those LEDs at the same time. For further technical questions, you can post at Cytron Technical Forum. Thanks.

Hi. How about if i want specific colour only flashing when in certain condition when i connecting to the sensor in arduino? i mean your coding will makes the LED lights up with different colour so how if i only want one colour light up only in certain condition?

Hi Shakirah, try the tutorial first and understand how to control the LED color.

Leave a comment