So after a few cosplay projects, I got tired of having to buy multiple new Arduino boards for each project. Sure, the Adafruit Trinket is fairly inexpensive, but everything adds up, right? Also, some of my projects used identical coding to other projects, so it felt like a lot of extra effort having to wire up yet another Arduino board from scratch.
That’s when I had an idea: modular chop n’ change Arduino board circuits! This could be fairly easily accomplished with some trusty JST connectors and a little soldering.
This project is recommended for people who already know how to load up code onto their Arduino board, and who already have their lighting code written (or are using one of the examples that are included in the Neopixel or FastLED libraries). If you don’t know that process, however, never fear – I’ll be writing a Part Two of this tutorial to cover how to load up example code and turn on and off functions within the example. So stay tuned for that!
What I aim to accomplish with this tutorial is an easy to replicate method of attaching LEDs to an Arduino board that you can remove and switch out between projects. The finished product, in turn, will easily connect to any USB power bank, which is my preferred method of powering LED strips due to both using 5V power, the easy to recharge nature of power banks, and the ease with which you can conceal them in a costume – large, flat power banks can be concealed in the small of your back when wearing armor, while the thin, tubular power banks fit nicely inside sword hilts and gun chambers.
And, as always, use proper PPE!
So, with that out of the way …
Things You’ll Need
- A 5V Arduino board. For the purposes of controlling cosplay lights, a 5V Adafruit Trinket is what I’ve used for this demonstration, and a Trinket will handle most of the less complex cosplay light animations. The 5V Pro Trinket is another great board if you want a little more bang for your buck.
- A 5V USB power bank. The kind you keep with you to charge your phone when Pokemon Go has eaten up all your battery! These come in a range of sizes and capacities – my current favorite one came from eBay and has a 20,00 mAh capacity, so it’ll power an average sized LED cosplay for an entire convention day.
- 1 male and 1 female 3-pin JST connector. Most online retailers who sell LED strips will sell these too. Try eBay if you can’t find them – look for the kind with a red wire, a green wire and a white or black wire.
- 1 USB cable. I love using old cables from broken stuff and upcycling them into my projects – just test them before soldering them. You’ll only be using two channels here; power and ground, so they don’t need to be able to handle data too.
- Two short lengths of stranded wire. I like to use 2mm, with red for positive and black for negative, but really, use whatever you have lying around – just remember which pole is which.
- Electrical Solder. Don’t buy the crappy stuff, or your joins will be weak. Don’t get cheap on me, Dodgson!
- Hookup wire – I like the 2mm stranded stuff in red and black, so I don’t get my polarities confused.
- Heat Shrink. I like to buy a big bag full of various widths. Read through the tutorial and decide what widths will work best for you – I think I used 5mm and 10mm
- A length of 5V WS2811 or WS2812 LED strip. It absolutely MUST be a digital strip with 3 channels – power, data and ground – or this tutorial won’t work. Also called Neopixels; I like the stuff Adafruit sells, although you can buy them locally in most countries.
Tools you’ll need are:
- Soldering Iron (and stand, little sponge etc). You will not be able to make this project without one. Invest in a good soldering iron
- Helping Hands. Best electronics assistant ever!
- Wire cutters/Wire strippers
Attaching the USB
First up, strip about 20-30mm off the outside of your USB cable. Try not to cut through the cables underneath – so leave a decent amount of length in case you sever one of the inside cables. It should look like this:
Next, have a look at the wires inside. The colors can vary – in this case, there’s black, red, white and green. White and green are the data cables; we won’t need to use those as we’re just connecting to a power pack. The red (power) and black (ground) cables are what we’re using. If your USB has orange, white, blue and green cables inside, the orange cable is power, and the white cable is ground. We then need to strip about 10mm off each of those. It’ll look like this:
Next, strip 20-20mm off the ends of your red and black hookup wire, and strip the ends of the leads on your JST connectors – red and white (or red and black if your JST cables use black), and twist them onto the corresponding color lead – power and ground. Like this:
Now we need to join these combined cables to our USB cable. The reason for running two sets of power and ground cables is that LED strips need a separate power supply, since a significant length of them could draw more power than an Arduino board can supply. So we’re wiring the power from the USB to the Arduino and the LED strips in parallel, then connecting the data cable from the LED strip to the Arduino board. It’ll look like this before you solder things. Slip some heat shrink on as shown:
And then solder those joins:
Pro tip: before you slide the heat shrink over the join, put a scrap of wire inside the whole configuration. It’ll stop the tiny fragile USB cable joins from breaking:
And the finished join, without Arduino board:
Now all we have to do is add the Arduino board to the configuration! First, trim down the lengths of the free black and red cables if they need it – ideally your Arduino board should sit right in the middle of the JST connector cables. Then, solder the red lead to “BAT” (for power) and the black lead to “GND” (for ground).
Next, solder the data cable to the correct pin for your code. I always use Pin #1. So trim the cable back – it should feel like the cables that attach to the Arduino board aren’t stretched as tight as the cables that lead straight from the USB cable to the JST connector, since the connections to the Arduino board are quite fragile and any tension could easily pull them out. The power and ground cables that bypass your Arduino board will serve as a supportive brace, of sorts.
And lastly, solder that green connection to the right pin. Pin #1 in this case:
And we are done with the main removable Arduino board component! Now we just need something to plug it into so we can run our LED strips. A lot of WS2812/2811 strips come pre-wired with JST connectors already in place – if that’s the case, cool! Plug in your board! If not, slide a bit of heat shrink over the end of your matching JST cable (I always use the female JST cables on the Arduino board side and the male cables on the LED side, for consistency) and solder the leads of your JST cable to your LED strip. Be conscious of the flow of current – indicated by the little arrow on the strip, it should always point away from your Arduino board. Solder the red cable to “+5V (power), the green cable to “Din” (digital input), and the black or white cable to “Gnd” (ground.)
Pop your heat shrink over. Heat shrink isn’t strictly necessary, but when your circuits will see a lot of wear and tear, it’s a really good idea to heat shrink all your joins.
Now just plug your LED strip connector into the one on the Arduino side, and you’re ready to plug in! This is just the basics of how this circuit works – you can add switches at any one of several intervals along this circuit to make turning your LED strips easier, and you can split the circuit to wire many more LED strips in parallel.
… And then plug the circuit into your USB power supply, and (assuming you’ve loaded your code correctly – more on that in another post) and you’ll see the pretty lights! BEAUTIFUL LIGHT BULB!