How to control WS2811 LED-Strip with an Arduino Part 1

Oct 26, 2020 09:15 · 459 words · 3 minute read 2 seconds subscribe like connect

Hey guys and welcome back to another video on my channel. I am Jan and in this video series, you will learn how to control a WS2811 LED-Strip with an Arduino. Let’s get started. First, you have to set up the hardware. For this tutorial, you need an Arduino. In my case, it is an Arduino Nano but you can also use every other Arduino. You also need a 12 Volt power supply for the WS2811 LED-Strip. Besides this, you need a 220 Ohm resistor and some wires.

00:39 - First, you have to connect 12 V of the LED-Strip to Plus of the power supply. Next, you have to connect GND of the LED-Strip to Minus of the power supply. After this, you connect Din of the LED-Strip to the 220 Ohm resistor. The resistor must be connected to a PWM Pin. In this video series, I will use Pin 6. Now you have to connect GND of the Arduino to Minus of the power supply. Last but not least you have to connect the Arduino via USB to your computer. Second, you have to download FastLED on fastled-io. In the video description, you will find a link to the website. Let’s write a first demo program to learn how to control the WS2811 LED-Strip with an Arduino. In the video description, you will find a link to download the demo program. First, you have to include the FastLED library.

After that, you have to define how many LEDs your 01:45 - strip has. Next step is to set up an array that you can manipulate to set led date. After that, you create three variables. The first called colour, the second called fading und the third called brightness. In the setup, we activate the serial monitor at 9600. Then we define the port the LED-Strip is connected to. In my case, it is Pin 6. In the loop you first output “colour” in the serial monitor. Next, you write a for loop that changes the value of the variable colour from 255 to 0. For that, you have to tell the Arduino that the LED 0 of Strip1 has these values. With Fastled.show you tell the Arduino that you want to display the new values on the LED-Strip. After that step, you output the value of the variable colour and wait for 2 seconds.

02:45 - The next for loop is to change the value of colour from 0 to 255. In the end, you have to do this for the next two variables too, as I did it. Thanks for watching. Don’t forget to like the video and subscribe to my channel for free. Please comment down below if you have any questions or ideas. .