Introduction: Under Table LED Lighting (with WS2821b LEDs)
I built a new 8' workbench/computer desk/homework desk before school started this year. Before that there were a couple of smaller desks but it looked bad and I wanted them out. Once the desk had all the stuff I need on it, I was thinking of ways to make it a little cooler. I'm a huge fan of LEDs, and had a strip of those WS2821b that was laying around for a different project.
If you don't know what those are, they're basically RGB LEDs that run on 3 wires and can be individually addressable throughout the strip. That means only one pin on a micro controller (I'm using an arduino nano) with no additional circuits, And that is awesome.
(I made this Instructables after building it, sorry for the lack of photos)
Let's get started!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Get Your LEDs!
There are 2 ways you can go with this.
1. Go on eBay, order the right length of strip you'll need, little soldering. Price is higher, less time needed, a lot brighter but current consumption is higher.
2. Order a shorter strip, LOTS of soldering. Price is more affordable, more time needed, brightness is lowered and the current consumption is lower.
Now buying these things off of eBay is not expensive compared to adafruit or other retailers, a 16 footer is maybe $20 and can be shortened.
I had the 1 meter, 60 led strip, so it took me about 4 hours or so to solder all those small wires, but it was well worth it.
Step 2: Parts List
things you will need and probably have:
1. Soldering iron
4. Hot glue
5. Computer with arduino software
Things you will probably buy
1. Some 22-20 gauge copper wire no insulation (or enamel) (for the shorter strip)
2. Your WS2821b led strip
3. A 300-500 ohm resistor
4. A 1000 microfarad capacitor
5. A piece of perf board (preferably(pun intended) 3x6 cm)
6. A 5V at whatever amp power supply (amps will depend on how many LEDs used. More on this below)
7. An arduino nano with usb cable
I'm not going to provide a programming tutorial, you'll find examples all over the Internet for ether the adafruit neopixel library, or fast led library. I'll leave links at the end.
Now is the time to talk amps. Each led can draw about 20 milliamps, so multiplying the number of LEDs you'll use by 20, then dividing the result by 1000, will give you the amps the strip will need. Unless the number is really close to a whole amp, round it up one more (ex 3.4 amps needed, just get 4. It's safer for the LEDs so there is no overdischarge.)
Step 3: Mount the Strip
1. Hot glue
2. Your led strip
If you bought a strip that will fit your space, use a box cutter to cut the plastic protector on the strip (if there is) then do one of these:
1. If it has adhesive tape on it, peel the paper and stick it accordingly
2. If there's no adhesive, use drops of hot glue every 6" or so.
If you bought a shorter one:
1. There should be a cut line every led, cut it there. (If the strip comes with the fist led connected to some wires, leave those attached, this will come in handy.)
2. Get out your soldering iron and tin all the copper pads.
3. Then measure the total length of the surface in inches or cm and divide it by how many LEDs you have. This will give you the spacing.
3. Mark all the points and glue each led on.
PAY ATTENTION TO THE ARROWS ON THE LEDS!!!!! MAKE SURE THEY WILL POINT AWAY FROM THE MICROCONTROLLER!!!
they will not work otherwise and then you would undo everything and you would feel bad. I'm not here to make you feel bad.
Step 4: Solder!
This step is for short strip people, so if your not that go to the next step.
2. The pre cut and tinned LEDs
3. Soldering iron and solder
4. The bare copper wire
Now is the fun part! You get to solder for about 4 hours!
This is good though, your getting some practice.
Just take the pliers or a cutter if the pliers doesn't have one, and cut about how long each piece needs to be. DO NOT get one piece right and make a bunch more based of that one piece, because the LEDs never glue right, and the spacing will be different. If the wire gets to long, it might short out and that would be bad. Then take the pliers and hold the piece of wire so it touches the two pads you'll solder, and solder it. MAKE SURE IT DOESNT TOUCH THE WIRE NEXT TO IT! Repeat this for all connections.
Step 5: Make the Circuit
Now we will make the driver board to control the strip.
1. Arduino nano
2. Perf board
3. 1000 microfarad capacitor
4. The 300-500 ohm resistor
5. Some wire to connect the first led to the circuit (if no wires were attached to the fist led)
6. Soldering iron and solder
Now using the diagram above, wire and solder the circuit together.
-I didn't make a layout, it's not hard with the minimum amount of components
-Note: if your strip came with a red wire, a black wire and a white/black wire connecter, cut that connecter off, and wire the white to the data line, the combined black wire to the ground of the arduino and the big black and red wires to the positive and negative wires of the power supply.
-In my finished circuit I also added screw terminals to all external wiring, including a switch that interrupts the positive voltage of the strip to turn it off.
-I didn't use the power supply voltage to power the arduino, one of the chips got hot. I think it's a defective chip since it's a knockoff. If you choose to do this you must supply an extra USB voltage from a brick or computer and keep the connection between the ground of the power supply and arduino, it won't work if it's not.
Step 6: Program
Just upload a bit of code to the arduino and your set!
There are many libraries that support the WS2821b LEDs, my favorite is adafruits, get it here: https://github.com/adafruit/Adafruit_NeoPixel
Hit download and make sure you have the arduino IDE installed, once downloaded extract it and move it to the libraries folder. Open an example sketch or code your own and smash that upload button. MAKE SURE YOU CONFIGURE THE NUBER OF PIXELS AND THE DATA PIN (in this case 6)
And that's it, your done! And I know this was kinda rough, it's my first Instructable.
Ask any questions in the comments below.