The Story of the Torch

Back in 2008, I owned a brilliant torch. It was a blue anodised aluminium torch with 19 bright white LEDs set in its face. It was a brilliant torch. I kept it in the car because that is one of the places where a torch is most useful, well, at least for me. But in 2008 it was stolen when my car was broken into – no doubt they used it to break into other people’s cars. It was the only thing that was stolen, but despite the damage to my car and the realisation of just how easy it is to break into, I was most upset about the loss of my torch. In the time that followed, I looked for a replacement torch. At first I tried to replace it with another one of its type, but I just couldn’t find that particular model. After a while, I tried looking for something that I considered mostly equal, or perhaps even, greater than; but to no avail. You see, the torch was the perfect fit for my hand, it only required 3 AAA batteries, and they were fitted in a cylindrical-triangular form, rather than in series, which meant the torch wasn’t obnoxiously long, like a Maglite. The aluminium was cast in such a way to form a tactile grip along the battery compartment, such that holding it was both comfortable and secure. Its 19 bright white LEDs threw light far beyond what was necessary when outdoors, and indoors it could light up a room to almost day light brightness. It was a simple torch, none of this, SOS, UV, Laser nonsense, a simple rubber push button switch set it to On, or Off. But best of all, was the weight. It had a reassuring heft to it. Just by holding it, you could tell that it was built to last; it wasn’t the sort to explode into a million pieces if you dropped it on the pavement.

It is now 2014, and only now have I replaced that torch. I knew exactly what I wanted; utility. And I knew exactly what I didn’t want; standard. To deal with the utility, I now needed a body worn torch. I of course knew that I could buy a head torch, or one of those right angle body worn torches that potholers wear. But head torches are naff, and right angle torches are cumbersome. I also decided that I didn’t want a torch with a lightbulb. After having had such a nice time with all 19 LEDs previously, there was no way I wanted the lacklustre orange glow of an underpowered lightbulb. Radical action was needed. I knew what I wanted, but it didn’t seem to exist (like so many things I need want). So, after much thought, I decided that I would have to build it myself. This decision worried my slightly, as I knew that anything I would end up building would require soldering various joints. Up to this point, I had only ever soldered twice before. The first time in Secondary School, and the second was about six months ago when I decided I needed an extractor fan to help remove the hot air generated by my laptop inside the closed desk drawer from which it usually operates. Neither instance filled me with confidence; I was terrible at soldering and I knew it, later, I would come to learn the term for the joints that can be found gracing my fan project, “Cold Solder Joints”. However, as is my way, I refused to give up. If you give me the choice of doing something the easy way, and doing it the hard way, I will choose the hard way. So that is exactly what I did.

I first started by looking at LEDs, specifically, LED strips. Soon after, however, I found that in order to run an LED strip, you need a microcontroller. I thought that was silly. After all, all I want is On, or Off. I don’t need crazy light shows, and colour wipes and rainbow chases. I just want All On, White, or All Off. So for a little while, I put LEDs down and looked for something else.

After a while, I came across Electro Luminescent wire, EL wire. I found it first in an Adafruit YouTube video. Stern had made a glowing hoody by sewing EL wire parallel to the zip and around the hem of the hood. From the images, I knew that EL wire wouldn’t give me the throw of light I was looking for, but I wondered if EL tape, or an EL panel would give me enough glow to light up my immediate surroundings PipBoy 3000 style. So I ordered some EL wire and tape.

I used the EL wire to make the hoody I saw in the video, and gave it to my brother as a birthday present. This also gave me the opportunity to test the wire and tape, and to find out how it worked and how bright it was. In a darkened space, the blue EL tape did light up its immediate area, but for that area to be useable, I would need a lot of tape. Also, the DC-AC converter that you need to drive EL makes a horrible whistling noise when its switched on. So, sadly, I was back to square one.

Realising that LEDs were the only things that were going to give me the light throw that I wanted, I resorted to LED research again. Knowing that I didn’t want or need RGB LEDs, and that I didn’t need them to be individually addressable, I restarted my search by looking for what I termed, “White analogue LED strip”. By “analogue”, I simply meant, binary. LEDs that would turn on if there was power and went off if the power disappeared. In my mind, that was exactly how my torch worked. Along the way, I found LED strips that had four inputs, and this put me back a few days, as now I was confused. All the LED strips I had seen thus far only had three inputs, and now all of a sudden the strips needed to know what the time was. I was confused. I put my research to bed for a couple of weeks.

A few weeks later I decided to scrap everything I had already learned, and knowing that Adafruit had already helped me down one avenue and enabled me to complete one project already, I decided I would restart my research by looking into Adafruit first. This first step I took was to subscribe to their YouTube channel, seeing as it had already been so helpful, and this proved to be a very good step. Shortly after subscribing they produced videos detailing the Gemma microcontroller and an LED skateboard project that used the Flora microcontroller.  It seemed to me that the Adafruit microcontrollers were the way to go. I spent a lot of time in the Adafruit learning system, which was far more useful than I had first realised, and soon after, I set about mentally modifying and combing two different projects: the LED skateboard project, and the Flora Brake Light Backpack.

Being based in the UK, it took a little while for my parts to arrive. I knew I could have ordered many if not all of the parts from more local suppliers, but with this being my first proper project, I wanted to make sure that I definitely got the right parts. When the parts did arrive, I set about playing with them, trying to work out how they all go together and, most critically, how to programme the Flora. Having never used an Arduino-type board before, this was new territory I had never stepped foot in before. I had used, and successfully turned a Raspberry Pi into a media server before, but even then I was mainly following other people’s instructions, plus it used Python and has a GUI, meaning it is a lot more beginner friendly. The Flora was completely new, and even now I’m not completely sure what programming language it uses, if I were to guess, I’d say C, but I’m not sure. Anyway, I was glad to find that Adafruit provided a starter programme for testing LED strips, and it worked perfectly, although, not until I had worked out how to install the Arduino IDE and the Adafruit libraries the hard way round. The Adafruit issued IDE simply refused to run (it was not a gatekeeper problem).

Here is a video of the strand test running:

After some toing and froing with the code and one very concerning occurrence when uploading a new sketch (the sketch that I now use on the Flora) caused my MacBook to abruptly restart, I eventually wrangled the code into shape, a shape that now looks like this:


#include <Adafruit_NeoPixel.h>

#define PIN 6

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(5, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

void setup() {
 strip.begin();
 strip.show(); // Initialize all pixels to 'off'
}

void loop() {
 // Some example procedures showing how to display to the pixels:
 colorWipe(strip.Color(255, 255, 255), 60);
}

void colorWipe(uint32_t c, uint8_t wait) {
 for(uint16_t i=0; i<strip.numPixels(); i++) {
 strip.setPixelColor(i, c);
 strip.show();
 delay(wait);
 }
}

So this is what happens on the Flora every time I turn it on, and that is exactly what I wanted; simple All On, White and All Off.

Now that I had worked out that I can make the LEDs work and not only that, but make them do what I wanted them to do, I then set about some practicality issues. The idea was that these LEDs would be mounted on my coat, so I not only had to work out a way of waterproofing the whole circuit, I also had to build in an easy detachment method and most of all, a way attaching the LEDs and switch and Flora and Battery pack to my coat without it looking like the coat is full of electronics and without making loads of holes in what is my favourite jacket.

Waterproofing

Waterproofing was fairly straightforward, the LEDs that I bought had a weatherproof, transparent seal, so they would be alright in the rain. The joints could be sealed with heat shrink tubing and then, if they were likely to be exposed to the elements glued shut. I’m well aware that gluing all the access points closed will make repairs harder, but I really consider this project to be Prototype 1, so I’m not bothered about that. And finally, a small project box would easily fit into a hitherto useless pocket on the lower left inside portion of the jacket. While I had the pocket, the project box was more difficult to find. More on that later.

Detachment

I’m quite pleased with my detachment method. After studying the problem for a little while, I decided the best option would be similar to the method with which you power the Flora; JST connectors. If I wasn’t bother with detachment, then I would have just soldered wires to the LED strip, and then to the Flora, but I was bothered about detachment. In the video below you can see my first test with a 4 pin JST connector (I think it was an XH, or possibly a PH). The JST is placed between the Flora and the LEDs, with jumper wires for easier prototyping:

Not knowing anything about wire resistance or . . . anything else that might have an effect on my project, I thought it best to test, so I did. The idea here was that I would cut the Male-Female 4 pin JST cable in half and reverse their direction. That way I would now have a detachable LED strip.

This terrible image illustrates the circuit:

FloraLEDCircuit

Discreetness

Discreetness was a big deal for two reasons. I didn’t want to look like an extra from Tron, or Johnny Five from Short Circuit, so I needed to keep as much concealed as I could. And secondly, I didn’t want to start cutting overt holes in my favourite jacket. Luckily my jacket had not one, but two hitherto unused and useless pockets; one on the inside, and on the left-breast; some kind of bizarre pen holder pocket. So for discreetness I would cut the holes on the inside of the two pockets, such that they were hidden from view, and the insulated cables would run inside the lining. I would also make one more hole in the front left pocket for the on/off switch.

Soldering

With those problems solved, I had to move onto the next, considerably larger problem. Soldering. As I mentioned previously, I am very bad at soldering. Remembering from the last time I used the soldering iron, I found it with a hole in the tip. While I didn’t know why this had occurred, I did know who used it last. So, rather than try to use the broken one we have, I decided to buy a new one.

While I was waiting for it to arrive, I watched a lot of YouTube videos on soldering. I learned more in five or six 3 minute videos than I ever did at school, and as a consequence, I felt far better about my impending soldering project. For practice, I bought a metre of 26AWG wire, the same gauge the LiPo battery uses, and soldered a series of small wire circles as practice. I did get used to soldering two wires together, but I couldn’t get the hang of tinning a wire. For further practice I desoldered, and then resoldered my extractor fan project, the one with the cold solder joints, and I am pleased to report that they are much better now.

Japan Solderless Terminal

Of all the components I needed, locating a single 2 pin JST PH jack was the most difficult. I now have quite a few JST connectors that are either the wrong size or the wrong gender, so to speak. Eventually though, I did find one on Amazon, and the postage cost more than the component itself, but I would definitely recommend the seller, certainly for UK buyers, RelChron Limited. In the LED skateboard project, an on/off switch is soldered inline between the AA battery pack and the JST on the Flora. The same goes for the brake light back pack project, this presented a problem. I wanted an on/off switch that was easier to get to and use than the one on the Flora, but I didn’t particularly fancy the idea of cutting and then soldering onto the red wire coming from the charged LiPo battery. To solve this I needed the 2 pin JST PH Jack. Instead of cutting and soldering what could potentially (for all I knew) be a live wire, I decided to leave that well alone. To solve the issue I would solder the ground from an additional JST wire I got with the Adafruit LiPo charger, to the ground pin of the amazon JST jack. I would then solder the red wire from the spare JST wire to one of the switch wires, and the other switch wire to the other pin on the amazon JST jack. This way I would have a better switch for powering the LEDs and I wouldn’t have a LiPo explosion in my living room!

This terrible picture illustrates the circuit:

FloraPowerSwitch

Project Day

It was Tuesday and I was bunking off of Uni. I had decided to do the pre-work for the rest of the week’s lectures, but it turned out there wasn’t any pre-work to do, so instead I decided to actually build my project. Using my rudimentary, hand drawn circuit diagrams, I was soon well into the swing of things. I first soldered the switch and and amazon JST jack, knowing that that would be a fiddly job.

JST

Then I put the circuit together using crocodile clips and tested the switch; it worked!

I disassembled part of the circuit and soldered my 40cm long run of 26AWG black, red and white wire onto the LED contacts. That was a very fiddly job and took some time.

LEDandG

I eventually settled with a sort of LED contact tinning approach, and then pressing the wires into the tinned contacts. I was not very happy with those bonds, but they seemed relatively strong, and they weren’t bridged, so I tested them and moved on.

At this stage, I took a short video:

For the next step I cut the 4 pin JST cable 20/80, and soldered the 80 set of wires to the wires now attached to the LED strip, and tested again.

This last step was the most nerve racking; soldering the 20 length of JST cables to the Flora itself.

FloraSoldering

I took a break before I soldered the wires onto the Flora, as I was aware that leaving a hot iron on a board for too long can damage components. While I was aware of this when I was soldering the LED strips, I still had 24 more LEDs left unused in my toolbox, so I wasn’t concerned. With the Flora though, I only had one. As it happens, the soldering went well, perhaps the best joints in the whole project, nice and shiny and no pits! (And remember, this is only the 3rd time I’ve done any soldering!)

FloraAfterSolder

Project Box

The project box was a tough one. Initially I was going to use an old 2.5″ sata hard drive caddy I had lying around, but the metallic nature of it made me wonder about accidental bridging problems, so instead I looked for a small box that would fit in the unusually placed and appropriately small pocket. I did find a box that was almost the right size, but it needed a bit of sanding on the inside to fit the battery pack. I did this for a long time, and was quite pleased with the result. However, on the morning of the Project Day I had been to the post office to pick up a package that required a customs charge to be paid. When I opened the package I found that it was the reward for one of the Kickstarter projects I backed, a 58mm lens filter by Mount July. What was serendipitous about it was that the filter came packaged in a neat little leather pouch. A pouch just the right size for a LiPo battery and a Flora.

Finished Project

CoatTorchOff

CoatTorchOn

Video

List of Products

1 x Lithium Ion Polymer Battery – 3.7v 1200mAh[ID:258]
1 x FLORA – Wearable electronic platform: Arduino-compatible[ID:659]
1 x Tactile On/Off Switch with Leads[ID:1092]
1 x Adafruit Micro Lipo – USB LiIon/LiPoly charger (v1) [ID:1304]
1 x Adafruit NeoPixel Digital RGB LED Weatherproof Strip 30 LED -1m (BLACK)[ID:1460]
1 x JST Right-Angle Connector Through-Hole 2 Pin
1 x Metre 26AWG RBW wire
1 x Sugru Black (Pack of 8) (Yet to be used, will be put on the on/off switch)
1 x 9 Piece 40w Soldering Iron Kit
1 x Wire Stripper
Lots of Heat shrink, 2mm and 10mm.

Author: Dan

Share This Post On