Introduction: RGB LED Controled With Arduino
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.
Step 1: Do the Circuit
You will need :
-Arduino : I use an UNO R3 copy,
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.
Step 2: The Code
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