Arduino Nano - Dotstar LED Strip
In this tutorial, we are going to learn how to use Arduino Nano to control DotStar RGB LED strip. In detail, we will learn:
- How to connect Arduino Nano to the DotStar LED Strip
- How to program Arduino Nano control the color and brightness of each individual LED on the led strip
- How to program Arduino Nano to create the comet effect for the DotStar LED strip
Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of DotStar RGB LED Strip
Pinout
The DotStar RGB LED Strip has four pins:
- GND pin: needs to be connected to GND (0V)
- CI pin: Clock pin that receives the clock signal. It should be connected to an Arduino Nano pin.
- DI pin: Data pin that receives the control signal. It should be connected to an Arduino Nano pin.
- 5V pin: needs to be connected to 5V of external power supply

Wiring Diagram

This image is created using Fritzing. Click to enlarge image
You can also build this circuit without a breadboard. Here is the same wiring:

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Nano and other components.
How To Program For DotStar RGB LED Strip
- Include a DotStar library
- Declare a DotStar object
- Initializes the DotStar
- Set color (g, r, b) of each individual LED (called pixel).
- Set brightness of all strip.
※ NOTE THAT:
- DotStar.setBrightness() is used for all pixel on LED strip. To set the brightness for each individual pixel, we can scale the color value.
- The values set by DotStar.setBrightness() and DotStar.setPixelColor() only take effect when DotStar.show() is called.
Arduino Nano Code
The below code turns pixels to red one by one with a delay between each pixel
Detailed Instructions
- Wire the components according to the provided diagram.
- Connect the Arduino Nano board to your computer using a USB cable.
- Launch the Arduino IDE on your computer.
- Select the Arduino Nano) board and its corresponding COM port.
- Open the Library Manager by clicking on the Library Manager icon on the left navigation bar of Arduino IDE
- Search “Adafruit DotStar”, then find the DotStar library by Adafruit
- Click Install button to install DotStar library.

- You will be asked to install the dependency. Click Install All button.

- Copy the above code and open with Arduino IDE
- Click Upload button on Arduino IDE to upload code to Arduino Nano
- See the LED effect
Arduino Nano Code - LED Strip Comet Effect
The below code provides the comet effect for the DotStar LED strip
※ NOTE THAT:
For any other LED effects, we offer the paid programming service