Arduino Pixel Stick WS2812

26,403

191

39

Posted

Introduction: 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 : http://mrossphoto.com/wordpress32/neopixel-ws2812-...

https://www.facebook.com/spicyturtlesphotography

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

Parts:

Arduino Mega

AD Keypad http://bit.ly/1L4eGWH

WS2812 144px/m http://bit.ly/1CutXyK

SD Reader http://bit.ly/1Gd4d4A

LCD 16x2 http://bit.ly/1LX1N1j

Momentary Push Button http://bit.ly/1Mlo86U

Switch On/Off

1m Alloy Channel With Diffuser http://www.ecolocityled.com/product/black-thin-fro...

Du Pont Wires http://bit.ly/1NZW36e

12v-5v converter http://bit.ly/1HTQntx

Project Box http://bit.ly/1M0K7D9

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

Handle http://bit.ly/1NZWSMb

Heat shrink Tube

Nuts & Bolts

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

1 12v battery

Tools:

Soldering Iron

Tweezers

Screwdrivers

Dremmel

File

Step 2: LCD and SD Card Hook Up

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

LCD:

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 :

GND to GND

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:

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

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

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.

Notes:

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

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

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

http://mrossphoto.com/wordpress32/neopixel-ws2812-...

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

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.

3 People Made This Project!

Recommendations

  • Space Challenge

    Space Challenge
  • Microcontroller Contest

    Microcontroller Contest
  • Spotless Contest

    Spotless Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

As a power source for this project mobile power bank can be used. It gives 5V output.. hence perfect to power Arduino board as well as LED strip. (Use power bank with 2 USB outputs) - I used 20000 mAh power bank and it worked perfectly.

1 Questions

Hello!
I am facing a problem in probably the last step of this instructable! I built the wand succesfully but I am not able to light up the strip due to some reason! I am pretty sure the connections are alright since I was able to run the example code for the WS2812 strip and the strip works just fine with this setup but loading the images it simply doesn't work.

I am using a 32gb memory card along with MS Paint to convert it to Bitmaps of width 144 pixels and the files are displayed on the screen but the led strip simply won't turn on! I also tried using the images in this instructables after converting them to Bitmap ofc but still no luck!

Can you probably mail me a sample file so I know that maybe I am making a wrong file?

I was facing similar issue and spent couple of hours troubleshooting. Problem was with GND. We need to connect LED strip GND to Arduino GND. I connected both GND common and everything stared working... may be this is one of the reason in your case.

27 Comments

Thank you so much. I was able to build this PixelStick by following this tutorial.

I used 1 meter 144 LED ws2813 LED strip and 2813 worked just fine without any code change. As a power source I used mobile power bank of 20000 mAh capacity - which has 2 USB outputs; 1 used to power Arduino mega board and 2nd used to power the LED strip.

Attached is the first test shot.... tried to light paint Monalisa

mona1.jpg

I have tried this method, but there is a problem for interrupting me ,the sd card can not recognized the bmp files, and the LCD print that " not a bitmap", i do not know why,who can tell me?

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

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

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

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.

could you send me a copy of the changed code

please.

happy new year

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!

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.

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.