The rise of LED lighting has been stratospheric and it’s easy to see why. They are cheap to manufacture, use significantly less energy than other lighting options, and do not heat up in most cases, making them safe for a variety of applications.
One of the most common LED products is the LED strip. In this article, we will cover how to set up the two most common types with Arduino. These projects are very simple and even if you are new to Arduino: or DIY electronics you can do it.
We will also use the Arduino IDE to control them. This project uses an Arduino Uno, although you can use just about any compatible board (e.g. NodeMCU.).

Choose your lane
When shopping for LED strips, there are a few things to consider. First, it’s functionality. If you plan to use the strips primarily for ambient lighting, then a simple LED band RGB 12V ( SMD5050 ).
Many of these strips come with an infrared remote to control them, although for this project we will be using an Arduino instead. Spend some time shopping, at the time of writing you could get these strips for as little as $1 a meter.

If you want something a little higher, consider WS2811 / 12 / 12B . These bands (sometimes called neopixels ) have built-in chipsets that allow them to be accessed individually. This means that they are capable of more than just ambient lighting.
You can use them to make a cheap LED pixel display from scratch. You can even use them to make your own storm cloud light fixture.
These strips only require 5V to power them. Although they can be powered in small portions directly from the Arduino board, it is generally recommended to use a separate 5V power supply to keep yourself from the smell of a fried Arduino. If you are looking for individually programmable LEDs, these are for you. At the time of writing, they are available for about $4 per meter.
Another thing to consider is where these bands can be used. Both types of strips come in different lengths, LED densities (number of LEDs per meter) and varying degrees of weather protection.
When looking at LED strips, pay attention to the numbers in the listing. Usually the first number is the number of LEDs per meter, and the letters IP and numbers are weather protection. For example, if the list says 30 IP67 this means that the meter will account for thirty LEDs. 6 means that it is completely sealed from dust, and 7 means that it is protected from temporary immersion in water. Let’s start with SMD5050.
In touch
To connect a 12V LED strip to an Arduino, you will need a few components:
- 12v RGB led strip ( SMD5050 )
- 1 x Arduino Uno (any compatible board will do)
- Resistors 3 x ten kOhm
- 3 x N-channel MOSFETs with logic level
- 1 x breadboard
- Connecting wires
- 12v power supply
Before setting up the schema, let’s talk about MOSFETs .
Whenever you are driving something that is at a higher voltage than your microcontroller, you need something in between to keep your board from frying. One of the easier ways to do this is to use a MOSFET. By sending pulse width modulation signals ( PWM ) per branch shutter you can control how much energy passes between the branches runoff and source . By passing each of the LED strips through a MOSFET, you can control the brightness of each individual color on the LED strip.
When using microcontrollers, it’s important to use logic level components to ensure everything works the way you want. Make sure your MOSFETs are logic level and are not standard .
Set up your schema like this:
- Connect Arduino Pins 9 , 6 and 5 to gate branches three MOSFETs and connect a resistor ten kOhm on the line of each to the ground bus.
- Connect the legs source to the ground bar.
- Connect drain legs to green , red and blue connectors on the LED strip.
- Connect the power rail to the connector + 12V led strip (note that the power wire is black in this image to match the colors of the connectors on my led strip).
- Connect the Arduino ground to the ground rail.
- Connect a 12V power supply to tires nutrition.
Most LED strips have Dupont connectors that are easy to connect to. If you don’t, you may need to solder wires to the LED strip. Don’t panic if you are new to soldering, it’s an easy job and we have a guide to getting started with soldering. if you need it.
We will be powering our Arduino board via USB for this project. You can power up your board using the VIN pin, but before doing so, make sure you know the power limits for your board.
When your circuit is complete, it should look something like this:
Now that you’ve got everything connected, it’s time to make a simple Arduino sketch to control it.
fade it up
Connect the Arduino board to your computer via USB and open the Arduino IDE. Make sure you have the correct board and port number selected for your board in menu Tools> Fee and Tools> Menu ports . Open a new sketch and save it with an appropriate name.
This sketch will fade the lights out one color at a time, keep them on for a few seconds, and then fade out until they turn off again. You can go here and sketch it yourself, or just download the full code from GitHub.
Start by determining which contacts will be used to drive the MOSFETs.