So you know how you have an idea for a project but you don’t quite how to execute it. I wanted to make an electronic glow stick using ws2812, I wasn’t sure how I was going to do the ws2812 part because normally they come on a PCB or in a 5050 SMD package. This is when I found the ws2811 8mm LED’s. Follow long with me on how I came to make a light saber and not an electronic glow stick
- Arduino pro mini
- GX12 5pin socket
- Power bank board
- 18650 lipo battery
- Rotary switch
- Push button switch
- Micro usb mount
- 40mm PVC push fit pipe
- Push fit pipe connectors and end caps
To make this whole project work I needed to use ws2811, They work with ws2812 Libraries from adafruit. To mount the LED’s I used 2 solid core wire you find in UK mains twin and earth gray flat cable for the VCC and GND. Then all I did was connect up the data in and data out pins respectively. At first I ordered some 5 mm LED’s and made up a short 10cm long stripe because that’s about as long as a glow stick is.
My next problem to solve was what I was going to house the LED’s. I found some conduit adapter that would allow me to attach a pipe to an enclosure. The conduit adapter would take a 20mm diameter pipe so I found a clear acrylic pipe on eBay that was 20mm external diameter. I then used blanking end caps to seal up the other end.
Next up I needed an enclosure to house the battery and Arduino. I was going to get an expensive aluminum enclosure but then I had a brain wave, Why don’t I just use a bit of PVC pipe. This seamed like a great idea at the time but ended up not really saving me much money and made it more complicated to put together. I found that there are two types of PVC pipe, push fit and solvent weld. I was planning on using a mixer of push fit and solvent weld ends and attachments but I didn’t realise that the diameter is different for each. I ended up going with the push fit and gluing the end caps that the clear pipe attached to the PVC pipe. Also this is when I found out I had accidentally made a light saber instead of an electronic glow stick.
For the power I just decided to go with a pound shop power bank that I striped down. I used a female micro usb mount adapter for charging and I also broke out the charging LED and mounted that above the usb mount
So with using the PVC pipe I only had one end that was going to be flat, that was where I was going to put the charging usb port. I also needed some way of programming the arduino, I didn’t have enough space to add a second female micro USB port. I decided to switch to using a arduino pro mini instead of a arduino leonardo, This way I could use a FTDI board to program it. Why would this be any better you ask well that’s when I found the GX12 5pin socket. I had to make up a custom cable that went from the FTDI board to the female GX12 socket pictured below. I think it give a cool industrial look to the project
My only bug with WS2811/WS2812 LED’s is that they are really time sensitive and everyone uses delays in their libraries. This makes it a nightmare when you want to be able to switch between different patterns. I came up with a great idea to tackle this problem. On boot up I was going to get the arduino to check the status of a few different switches, so that depending on which switch was flicked would depend on what pattern mode the WS2811 were going to be in. My first idea was to use dip switches but then I decided to use a 4 position rotary switch because it could be panel mounted. The only down side to this is you need to power it off and on to change the mode.