RGB LED Controlled by Arduino




About: I'm an electronic engineer and i love to learn new stuff and also share my knowledges with everybody and make tutorials to teach about the things that i make.

Hello my friends, in this instructable i will show you how to make a basic RGB led controller with Arduino.

This control will let you to switch between seven colors, in 5 operational modes. To change the color or the mode you just have to press a button. So when you press the button the led will change the color, and after the seventh color it will change its operational mode. The order of colors and modes is the following:

  1. Manual Mode:
    1. Blue.
    2. Magenta.
    3. Red.
    4. Yellow.
    5. Green.
    6. Cian.
    7. White
  2. Automatic Faded Mode.
  3. Inverted Automatic Faded Mode.
  4. Automatic Temporized Color Change Mode.
  5. Inverted Automatic Temporized Color Change Mode.

Watch the video so you can see how it works!!!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Materials and Connections Diagram

For doing this controller you will need the following things:

  1. Arduino UNO Board.
  2. Common catode RGB LED x 1.
  3. Protoboard.
  4. Push Button normally open x 1.
  5. 10K Resistor x 1.
  6. 220 ohms Resistors x 3.

When you have all of the materials just follow the connections diagram posted here.

Step 2: Uploading the Code to Your Arduino!!

When you are done with the hardware connections, just plug your Arduino board to your PC with the USB cable, and upload the sketch that you can download in the link below:


Once you have done this, your RGB led should be shining in blue. Yayy!!!

So that's all my friends, if you have any doubt let me know on the comments and i will be happy to help you. Happy coding!!

Arduino Contest 2016

Participated in the
Arduino Contest 2016

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    2 Discussions


    2 years ago

    I only saw what code you included in the screenshot but it appears to me that you are overcomplicating the switch. Attach one side to ground, the other to a pin and set that pin to INPUT_PULLUP. No resistor needed, only one pin required. Will be HIGH when button is not pressed, and LOW when pressed.

    1 reply

    Reply 2 years ago

    Hi MaximilianK5, yes what you say it's true, i did this a long time ago, and didn't change the code, just uploaded as it was back then, and with the same hardware setup i used those days (2013), thanks for commenting. Have a nice day!