RGB LED Controled With Arduino

by FazilM2 in Circuits > LEDs

845 Views, 12 Favorites, 0 Comments

RGB LED Controled With Arduino

20151009_203721.jpg

Hi,

This is a little instructable to show how to do RGB (Red Green Blue) Led controled with arduino. It contains schematics of the circuit and a little C# program that allows to change the color of the Led.

Do the Circuit

20151009_205449.jpg
20151009_210754.jpg
20151009_212204.jpg
20151009_212137.jpg

You will need :

-Arduino : I use an UNO R3 copy,

-Some wires,

-Simple MOSFET,

-RGB Led,

Do the circuit like this :

First connect your wire from the PWM of your arduino to the left dought of the MOSFET, after connect the GND of your arduino to the right dought of the MOSFET.

After that you can connect the middle dought of the MOSFET to the LED.

Finaly there is another wire that goes from the RGB LED, this one is for the alimentation of the LED, personnaly i connect it to the alimentation of my computer, if you're not going to use the LED like i do you will have to connect the RGB LED to a 12v alimentation.

You will see later in my code that the pin 3 is for the blue, the 5 is for green and 6 for red.

The Code

code_LED.JPG
Code_Arduino.JPG

We have two code to write. The first is the code that is going on the arduino, in general this code is here to read the information comming from the usb port and do the write signal on the wright PIN. To make it work download the arduino aplication on their web site paste it there and do compile when your arduino is connected.

The second code to write is the C# code that is going to be a graphique interface were you can scroll a bar to enter the color you want to apply. Basicly you have to do a new WCF project on visual studio. Add 3 scrollbar on your interface, an apply button, and finally a serial port (you can find it on the toolbox on the left) . After that you can paste the code on the picture.

After that compile everything, connect the circuit and TADAAM it work :D