Introduction: Arduino Pixel Stick WS2812

Picture of Arduino Pixel Stick WS2812

This is my first instructable I got asked to put one togther for a friend but only after I had assembled it all so some pics i wasnt able to get Im sure there will be bits I have missed out I'm no code genius so I will do my best to answer any questions you have in this build there was a bit of guess work but that is the fun of it.

I will update this as much as I can if anyone spots anything missing please let me know :)

This is my variation on NeoPixel WS2812 DLW by Michael Ross Credit to Him and IS0-Mick for the code and others who contributed to code along the way.

Link to :

Test run of completed strip :

I have some early videos of it in the concept stage here:

Another one of testing :

Step 1: Step 1 : Parts Tools

I got most of my parts from Aliexpress and Ebay to keep costs down


Arduino Mega

AD Keypad

WS2812 144px/m

SD Reader

LCD 16x2

Momentary Push Button

Switch On/Off

1m Alloy Channel With Diffuser

Du Pont Wires

12v-5v converter

Project Box

Double Sided tape

1m piece of wood as wide as alloy channel for mounting

9v battery connector with DC jack end

Wire - Try to keep size same


Heat shrink Tube

Nuts & Bolts

Resistors ( a good Selection for contrasting LCD and one 470 for LED data line )

1 12v battery


Soldering Iron





Step 2: LCD and SD Card Hook Up

Picture of  LCD and SD Card Hook Up

I breadboard everything before starting you can skip this step if your confident with lcd hook up etc


Pin Guide

1 - GroundPin

2 - +5VPin

3 - Contrast AdjustmentPin

4 - H/L Register SelectPin

5 - H/L Read/WritePin

6 - H/L EnablePin

11 - DB4Pin

12 - DB5Pin

13 - DB6Pin

14 - DB7

15 - Backlight Control +

16 - Backlight Control GND

LCD Connection

Pin 1 to GND Pin

2 to 5VPin

3 to Resistor ( bit of trial and error to find right one )

4 to Arduino pin 12

Pin 5 to GND Pin

6 to Arduino pin 11

Pin 11 to Arduino pin 5

Pin 12 to pin 4

Pin 13 to pin 3

Pin 14 to pin 2

Pin 15 to Arduino Pin 10 ( This is for backlight control )

Pin 16 to Arduino GND

I ended up joining the 3 GND's into one pin solder them togther and heathrink tube over top

SD Card :


5v to 5v

CS to Arduino pin 53

MOSI to Arduino pin 51

SCK to Arduino pin 52

MISO to Arduino pin 50

Momentary Push button :

GND - Pin 44

Positive - Pin 45


LED Strip Data in needs a 470 resistor inline this is talked about in step 5

LED Data In - Arduino Pin 31

Step 3: AD Keypad

Picture of AD Keypad

Wiring :

5v to Arduino pin 5v

GND to Arduino pin GND

Signal to Arduino pin A0

I ran the Resistor Button Sketch to get the button press values

1. Sketch load

2. Open Serial Monitor

3. Press each button to get the value write these down for later to add into the code.

Video Of it in action

Step 4: Boxing Time

Picture of Boxing Time

1. Mount the the AD keypad in the middle of the top of the project box I held it down with nuts and bolts and adjusted them so the buttons just sit under flush, cut slot for the sd card ( this doesnt have to be here) . See Pic 1 & 2

2. Cut hole for LCD using a dremmel or sharp knife drill holes for nut and bolt to secure it. See Pic 3

3. Drill hole for momentary push button ( doesnt have to be on the box wherever is good for yourself ) Attach wires before mounting add another hole for the On off Switch and 1 more on the bottom for the DC panel mount jack . See Pic 4

4. Mount : SD Card, Arduino Mega, 12v to 5v converter I used double sided tape and mounted the Mega on the side of the box next to the SD card. See Pic 4

5. Wire everything up I ran the DC jack Positive to the switch then to the converter and the Ground strait to the Ground on the converter the arduino gets its power from the 12v input.


I used a 9v battery lead with DC connector for Arduino just chopped of the battery terminal

You can use a buck converter but the led strip can draw a lot of amp when under full load

Step 5: Putting It All Togther

Picture of Putting It All Togther

I started by drilling holes in the project box to attach to the wood using short grabber screws 2 should be fine

I then drilled a bigger hole in the box for the wires for the LED to come through ( See Pic 1 )

I channled out the wood enough so the hole in the project box matched the channel for the wires to sit in ( see Pic 2 I dont have a pic of the actual channel )

I drilled 3 holes to mount the channel to the wood I countersunk them so the led strip will sit level ( no pics sorry)

at one end of the channel i drilled out a big hole were the wire feeds into the channel in the wood to go to the box ( see pic 3 ) you will have to solder some more wire to make it long enough this is a good time to solder in a 470 resistor on the data line the green wire from the strip.

The Green Data line from the strip will go to pin 31 ( You can Change this in the code )

Attach your LED power wires to the 5v output of the converte

Note : I had to shorten the led strip by 2 pixels to fit in the channel

Step 6: Code

The code is included here in the Light wand.ino

You will need to edit line 84 int adc_key_val[5] ={ 30, 170, 390, 600, }; these are the numbers from the resistor sketch you will need to put them in to replace the ones in bold above. but there is a trick to this the buttons dont seem to read in order so I had to swap them round this is the combination that worked for me ( 142, 329, 0, 506, ) I only use 4 of the 5 buttons as the Momentary pushbutton works as the 5th button.

You will need to change this line as well: #73 LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

to this: LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Upload the sketch and see if everything is all go

If not check you wiring make sure all plugs are in the right socket

Note: make sure you have the AD keypad plugged in or you menu will go on a loop through

Step 7: Misc Photos and Acknowledgments

Picture of Misc Photos and Acknowledgments

Once again a big thank you to Michael Ross for his guide on this and the code he did all the hard work

Thanks to Joinerman James for the help figuring it all out

And to My Wonderful Girlfriend for putting up with the late nites and swearing

Step 8: Notes : Just a Couple of Notes

Picture of Notes : Just a Couple of Notes

1. On LED strip I had to cut 2 pixels off the strip to fit in the alloy channel so make sure in the code you change the number of pixels to suit.

2. Setting up the pictures you can use photo shop or if you want to batch convert there is also irfanview. You will need to set the longest edge to 142 pixel ( Or how many LEDS you have ) and rotate the image I have included a couple of samples above.

3. I plan on doing a 2m one down the track this project can be used for 2m but the power draw will get up there so maybe look at a higher amp converter and adjust the strip- length in the code.


volvodani made it! (author)2017-10-03

I´ve made it. I look to improve the code to get an higher frame rate. Maybe conversation to and teensy 3.1 with 92Mhz.

It works perfect. I planed it to use with a car and long time exposure. on a bridge.

Thanks for the great job

coelho69 (author)2017-07-18

Good Morning

Great project, many congratulations.

How does the movement?

Is it circular or horizontal?

Manual or with the aid of some mechanical "Motor" system?

thank you

Spicy Turtles (author)coelho692017-07-18

Its all manual hold it vertical and walk it can take awhile to get the right speed

coelho69 (author)Spicy Turtles2017-07-19

OK, it's a very interesting project, I walk with the idea of building a panel but this one will take many LED's and this is a better solution.

I'll start by creating something smaller, rotating or somehow attempting horizontal but mechanical movement.

Good work.

Thank you

TonyM56 made it! (author)2017-01-05

Okay guys, this is using the example code from Adafruit library. Can someone tell me how to load an image (matrix) directly with the compiling. Any suggestions/examples? Thanks!

MarcelloB (author)2016-12-30

Hello where can I submit source code? I have added some features to the firmware that I would like to share. I have added in a way for settings to be saved and recalled using the EEPROM. I have also made some changes to the analog button reading code that helps deal with anomalies where a buttons value floats slightly.

andreasP47 (author)MarcelloB2016-12-31

could you send me a copy of the changed code


happy new year

TonyM56 (author)2016-12-20

Amazing! I'm thinking for building one myself! So what power consumption do you get from the led strip and the whole system? Thank you for the instructable!

thomerow (author)2016-07-25

Nice work! I'm looking into building a Pixelstick-clone myself and stumbled upon your instructable while doing some research. Is there a reason your gamma table only goes up to 127? As far as I know the WS2812 LEDs use 8 bits per color channel.

Spicy Turtles (author)thomerow2016-07-26

Hi thomerow I can really answer that it was coded by Michael Ross and Iso-mick did the gamma table from memory feel free to play with it would be interested if you get any imteresting changes.

mberns (author)2016-04-18

Can you transform the arduino code to raspberry pi code? I recently purchased a raspberry pi and the LED strip, I was interested in making a homemade pixelstick, but I don't want to have to buy an arduino to make it. Please help!

Savvas Panayiotou (author)2016-04-08

Why did you use an arduino instead of a rasberry pi?

nwoods3 (author)2015-10-16


Just tried the code on a mega 2560, but keep getting error messages.

sketch_oct16a:76: error: 'Adafruit_NeoPixel' does not name a type

sketch_oct16a.ino: In function 'void setupLEDs()':

sketch_oct16a:390: error: 'strip' was not declared in this scope

sketch_oct16a.ino: In function 'void latchanddelay(int)':

sketch_oct16a:569: error: 'strip' was not declared in this scope

sketch_oct16a.ino: In function 'void ClearStrip(int)':

sketch_oct16a:578: error: 'strip' was not declared in this scope

sketch_oct16a:580: error: 'strip' was not declared in this scope

sketch_oct16a.ino: In function 'void ReadTheFile()':

sketch_oct16a:725: error: 'strip' was not declared in this scope

Po TingC (author)2015-08-22

nice, my try my own soon,
BTW, a small trick i've found

the ws2812 strip cound use a 3.7V lithion battery as external
a single 18650 could supply stable current up to 3A or more

but the voltage will drop during usage
not sure at what voltage level drop will the strip fail

you don't even need to connect the gnds(with arduino's)
and still works most of the time
some kinda socery

tytower (author)2015-07-17

I dont get it ! What have your first 4 pictures got to do with anything ?. This is a light strip is it not?

jay019 (author)tytower2015-08-12

you dont really understand the concept of a pixelstick do you? here, this will help you understand...

Spicy Turtles (author)2015-07-22

Jiamyy1975 I'm pretty sure it's ws2812b

stringstretcher (author)2015-07-13

What is the cycle time for one of these images? Can you string together several images into a chain? I would guess it is just a code mod.Good instructions, thanks!

Off the top of my head i dont know the ws2812s are a bit on the slow side but thats the price of 144 pixels. You could prob string togther a set of images in photoshop just have black bacgrounds.

bman46 (author)2015-07-11

wow, that is so cool I want to make one eventually.

C-R-E-8 (author)2015-07-11

What also work svery awesome is a single colour or rainbow with object infront to create a vector like this...

Spicy Turtles (author)C-R-E-82015-07-11

I would like to add a rainbow effect in and maybe some color chasers. i am looking at building just a color changing stick for light painting using a buttont to cycle through different patterns

C-R-E-8 (author)2015-07-11

Wow this is very nicely done!!! I have the real pixelstick and i almost couldn't tell the difference

JonBush (author)2015-07-11

Great work, this is very impressive and I imagine it took plenty of time and troubleshooting to get it right!

Spicy Turtles (author)2015-07-10

Added Fritzing Layout

seamster (author)2015-07-10

This is so cool! Very impressive project, thanks for sharing this.

Spicy Turtles (author)seamster2015-07-10

Thanks there will still be some bits i need to sort out so if you run into any troubles please let me know :)

About This Instructable




More by Spicy Turtles:Arduino Pixel Stick WS2812
Add instructable to: