Intro: RGB LED With Arduino
Hello! In this post we will see how to control a RGB LED strip with Arduino.
To power a LED strip you cannot use directly our board, because Arduino on each pin can accept a maximum current of 40mA. So to achieve our goal we will amplify this current, in my case I will use the MOSFET. After assembling the breadboard prototype I also realized the pcb due to EasyEDA website, a great online tool for helping you complete your design from schematic to the finished PCB in the shortest time and easiest way.
In the photo above you can see the printed circuit I realized with EasyEDA, connected to a 5 meters LED strip. The rgb strip is powered with 12vdc, the 3 input pin are fixed to high logic level (5v). I measured about 3 Ampere, so should be no problem to connect up to 10 meters of LEDs.
Step 1: Design the Schematic Diagram
What you see above is a printscreen of the EasyEDA editor ( it’s online and free) you can see the wiring diagram from where I started to realize the circuit board. On the left there is the panel to import the components, while on the right there is the contextual menu from which you can define the properties of the imported components.
Step 2: Convert Project to PCB
Most of the time, schematics are created with the aim of producing a PCB. When we finished with the schematic diagram, we simply have to click the top icon "Convert project to PCB" to see the screen were we have to arrange the components in our favorite way, and realize the true and proper layout of your PCB.
You can learn the detailed tutorial of how to convert your schematics to PCB easily.
Step 3: With a Little Bit of Work This Is My Final Result
With a little bit of work this is my final result. This is my project of RGB LED module for Arduino, you could easily find it and order it if you like it.
Step 4: PCB Prototype
When completing the design of the board, I hope to produce the PCB in the most convenient way. You could extract the gerber files or get the circuit directly from EasyEDA, and you just simply click on the top button "Fabrication Output." Then you will access the page PCB order to download Gerber files of your PCB. It’s also a lot easier (and cheaper) to order it directly in EasyEDA. Here you can select the quantity of PCBs, the number of copper layers, the PCB thickness, copper weight, and even the PCB color you need. After you have selected all the options, click “Save to Cart” and complete you order.
Step 5: Receive the PCB
By choosing fast shipping, my PCB arrived in a few days, here is the image of my PCB.
Step 6: Connect It to the LED Strip and to Arduino
It was enough solder a few components (bought on Ebay) to start testing the circuit. Then come to how to connect it to the LED strip and to Arduino:
Step 7: Find a Sketch to Test the Module.
This sketch is taken from the examples of Arduino, which I edited a little bit.
Upload the sketch. Then (with the Arduino connected to the USB port on your PC) you have to open the Arduino serial monitor and write the intensity of red, green and blue separated by commas. For example, typing "0,255,0" you will get the strip fully green. The range of values are from 0 to 255. You can also use the intermediate values: the project also admits the PWM, so you can mix 3 colors with 16 million different possibilities.