HTE - WS2812 RGB LED Strip

Overview

For Fullscreen: https://www.youtube.com/watch?v=MaEMnRfTYAY

This tutorial will show you how to use an WS2812 RGB LED Strip, connect it to the Quantum system, and create a simple demo using it.


What is a WS2812 RGB LED Strip?

The WS2812 drivers can drive LEDs connected in series which are supporting the WS2812 protocol. The drivers implementation allows to drive up to 135 LEDs. For more information have a look at . We will use a bigger version of a WS2812 RGB LED Strip:


Assemble the Circuit

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

WS2812 RGB Led Strip

1

Included in Component Kit

Or you can purchase it here

Q-Client Builder Base

1

Q-Client

If you have all the parts listed above, we can go ahead and build the circuit. It should look like this:

The red wire is the power which is connected to the 5V socket of the Builder Base. The green wire is the signal wire. It will send the signals like which colour is used for the LED strip. The white/green wire is the ground wire. It is connected to the GND channel off the Builder Base. As you can see there are two additional wires we are not using, another red wire and a white wire. The red wire is used for additional power supply connection and the white for the extra ground connection of the second power input. We wont need this but keep in mind that the Builder Base can only support up to 135 LEDs at the moment.


Pair the Builder Base

Now we want to pair the Builder Base with our Q-Server. In order to do so, go to the Homescreen of your Q-Server.

Next click on the lift side symbol labeled “Clients”. Switch to the “Unpaired” tab at the top middle of the screen.

You should see your unpaired Builder Base. If not, check if you have plugged in the power supply for the Builder Base. Now move to the three dots below “Actions” and click “Pair”.

Once your Client is paired, click the “Setup” button.

Now you can edit your Client. Give him a Name you want and also a location where you are going to use it. Hit “Save” when you finished.


Build the Firmware

So once the Builder Base is paired and set up, we can start building our firmware. Move to the “Firmware” tab on the left side of your Q-Server interface. Hit “+ Create New”.

You will be prompted to give your new firmware a name. We named ours “WS2812”.

Once you created the new firmware, hit the “+ Add Hardware” button on the top, next to the “Actions” button.

We are going to search for LED smart. You can use the search bar or scroll down till you find it. After this, you can give it a name and then click on “Add Hardware”. We named ours “LED Strip”. Next we need to configure the firmware. Click on the LED Strip bar:

For the “Driver” we use the WS2812 and the Pin we set to GP6 because this is the pin we connected the green signal wire of the RGB LED Strip to. For “Count” we set 135. “Count” is the amount of LEDs you want to be connected to the Builder Base. You can set a value between 1 and 135 which at the end determines how many LEDs will light up. One Builder Base can only support 135 LEDs at the moment, so if you have more attached you cant use them and will need to split them up.

Next we have to upload the firmware file to our Builder Base. Click on the three dots below “Actions” and click on “Upload”:

Choose the correct Builder Base in our case we named it “WS2812” and hit “Upload”. You should see a progress bar pop up at the right side of your screen.


Build the App

While the firmware is uploading, we can build the application for our Button. Move to the “Apps” tab on the left side. Click on “Create New” and give it a name you want. We named ours again “LED Strip”. Hit “Create”.

You will find yourself on the Canvas.

For this tutorial we will need a “LED Smart” hardware object and a “Color Picker” interface objects.

Connect the Color output of the “Color Picker” interface object with the Color String input of the “LED Smart” hardware object.

Click “Save App” on the top right. You will return to the first screen of the “Apps” tab. Now click the play button on the bar located at the right side.

Now we have to map the hardware and interface objects we have put together before to the actual hardware of the circuit. Click on the “LED Strip” tab and choose the Client, which is connected to the Ultrasonic Distance Sensor.

Once you done click “Save + Run”.


Run the App!

Click on the “Dashboard” icon in the top right corner.

Select the LED Strip app.

As you can see the initial color is set to white. To change the color click on “Edit”.

Now you can choose any color you like.

In the next picture you can see that after 135 LEDs the next LEDs will not light up.

This is how you connect and use a WS2812 RGB LED Strip with the Quantum System. We also learned that we can only connect 135 LEDs to the Builder Base.

Happy Making!