Here is each variable broken down-
V = Voltage (measured in Volts (V), just like you see on batteries)
I = Current (measured in amps (A), or milliamps (mA), 1 Amp = 1000 mA)
R = Resistance (measured in Ohms (?), 1 Ohm = 1 volt / 1 Amp)
Now we can apply this to our problem. In the helmet example I have six resistors all rated at 20 mA. So we know our voltages (of the battery and the LEDs) and current requirments so we just need to find out what R is in the equation above. With a little algebra we get-
R = V / I
Now you might ask what value for 'V' do I use. In Ohms law you need to use the voltage
drop in the circuit. This means the voltage the battery supplies minus the voltage the LEDs require. That's easy enough but hang on, the LED's have two different voltages (red = 2.4 V and white = 3.4 V)! Well shoot, I'll just average what the LEDs ask for and call it good-
(3.4 +2.4) / 2 = 2.9 Volts
The only other bit need is the current. This is easy, just add up the current values (I) for each LED. Handy for me they were all 20mA-
6 * 20 mA = 120 mA
In order have the units match up right the current needs to be in amps, not milliamps. This is an easy fix, just divide the millimamp value by 1000.
120 mA / 1000 = 0.12 A
Now we are ready to plug all this into the rearranged Ohms Law-
R = (3.7 V - 2.9 V) / .12 A
R = 0.8 V / 0.12 A
R = 6.667 ?
Since the resistors are not made for every single possible value a resistance can be, its ok to use something close by. Generally, a resistor rated up to 10% over your calculated number is acceptable. Perfect, I'll just hook up a 3.7 volt LiPo battery with a 6.8 ? resistor and I should be just fine...right? Well here is what happened-
First try lighting the LEDs...what the?!
First
off you notice only three of the six lights are on and only the red
ones. That's strange. Remember when doing those calculations I assumed the average voltage drop for all the LEDs? By doing that I dismissed the fact that the two types of LEDs have different resistances. In electronics, the power (current) will take the path of least resistance. Just like it's easier for the water to rush out of the hole in our pool then to hold itself together inside the pool. From the picture it seems the red LEDs have a lower resistance then the white ones. To know for sure we look at Ohm's Law again-
For the three white LEDs-
R = V / I
Ohm's Law
R = 3.4 V / (3 * 20 mA)
three LEDs at 20 mA each
R = 3.4 V / 60 mA
R = 3.4 V / .06 A
remember we have to use amps for the equation to work
R = 56.667 ?
For the three red LEDs-
R = V / I
R = 2.4 V / (3 * 20 mA)
three LEDs at 20 mA each
R = 2.4 V / 60 mA
R = 2.4 V / .06 A
again, we need the current in amps for the equation to work
R = 40 ?
As we expected, the resistance was lower for the red LEDs then the white ones. So how is it possible to light both sets up? We'll need two resistors, one for the red set and one for the white set so that the battery detects the same power request from both sets of LEDs. Since the power will be flowing from my battery, to the white LEDs first then to the red ones, the resistors can be in line and I don't need two separate circuits (see the pictures below). Here is what happened on the second try-
Now we're talkin!
That's exactly what I was going for. It's a little hard to see exactly how this is set up, here is a diagram that is showing how its all wired together (I'll use a bigger battery for the actual usage, this picture was just easier to use)-
The parts and wiring
This is what an electronics diagram would look like if you drew out this circuit with the proper symbols for each part -
Ahhh!! What is that?!
You can see the LEDs have an icon that looks like a little arrow (the D1s and D2s). This is because the power can only travel one direction through the LED, all electronic 'diodes' act in this manner. LEDs come from the factory with one long leg and one short one (see this on the 'parts and wiring' picture?). The positive side of the battery (usually the red wire if it has a wire lead) needs to be hooked up to the long leg of the LED. You can see this on the battery in the diagram (BAT1), it has the + and - near it. If your LEDs aren't lighting up, check this first! The little squigely lines are the resistors (R1 and R2) and the straight black lines will be wires/connections. It's also nice to have red and black wires when you are connecting the parts...helps keep things straight.
...and they put him back together again...
Now that we have all that settled here comes the fun part, adding the LEDs to the helmet! I wanted this to be as low profile and as light as possible. Here is all the hardware I chose-
All the parts
As well here are links to all the parts on the SFE website (in case you want a closer look of course)-
You'll also need some
hook-up wire to connect the boards together.
I decided that it would be good to have a switch as well so that I could turn the lights off, say if I was riding in the daytime. Doing this changed my circuit drawing a little-
The circuit diagram
You can see the new component in the green outlined box. Having this blue print really helps keep things straight when you actually start putting things together. The different colored outline/boxes/curves in the above drawing will be different PCBs with the enclosed components on each.
Next I laid out where on the helmet where the different parts would sit and sketched out where the wires would go. I even went as far as holding the little PCBs on the helmet and tracing out their sizes-
You can kinda see the white marks
Next I took an old soldering iron tip and melted little notches in the styrofoam for the wires and boards-
The power of an old soldering iron!
This made measuring the wire to fit much easier. Which I did and had set to the side. As I made one board, I soldered the wire segments to it before I started on the next PCB.
Next up was soldering the battery connector, first resistor and switch to the first PCB (the green set in the wiring diagram). I kinda shot myself in the foot here picking such small components. Soldering all these little bits together on such a small board was a challenge, I actually had to re-do it once 'cause I melted the JST (battery) connector-
The front of the switch board...
...and the back of the board
To solder these parts together I referenced the wiring diagram quite often. I made sure to connect where the red (positive) lead of the battery plugged in, out the same leg of that connection on the connector to a resistor, then to a red wire coming off the board. Then I connected from the pin on the connector that connected the black (negative) battery wire to a black wire coming off the board.
Next on the blue print is the red box. For this set I took the green PCB and cut it in half since there were only going to be three LEDs on it-
The front...
...and the back.
You can see this looks very similar to the wiring diagram, a good example of hooking the LEDs up in parallel with solder.
Now on to the last PCB, the purple outlined box on the schematic. This one was a little tricky since there needed to be a resistor as well-
Next I mounted the battery. I decided to use
Dual Lock, a 3M product. This holds like no bodies business and doesn't get twigs and pine needles stuck in it like regular Velcro does.
The battery in place
The Dual Lock
Once I got all the boards mounted, wired together and checked to make sure they were working (ie flipped the switch), I hot glued all the wires in place to keep any hungry sticks at bay during my bomber night time down hill rides-
The wires hot glued near the switch circuit
And that wraps up this edition of making LEDs turn on, if you follow these simple instructions step by step they won't
let you down!
Also, putting the LiPo on the outside of the helmet is just asking for fireworks in the event of a spill. That back ledge is somewhat protected, but you still run a serious risk of burning off half of your hair should you hit the LiPo in a fall.
I would be careful modifying the foam of the bike helmet as it could very likely weaken it.
Especially in the rear. Some pretty important stuff back there, especially when it comes to riding a bike!
http://en.wikipedia.org/wiki/Cerebellum
Is this safe from rain? I cycle and I have been wanting to make something like this too but what about rain?!? I also want to put lights on the frame of my bike but I leave my bike outdoors! I don't leave my helmet outdoors but sometimes I am forced to cycle in the rain. Is there a way to make this waterproof? I mean it never really gets submerged in water but it can get really wet..
I'd say no, but you can certainly use some silicon or something along those lines to waterproof it.
This was a great tut! I have never really understood what a resistor actually does and the explanation using the pool was what I needed for me to get it and for it to stick.
Apparently LiPo batteries get really grouchy if you let them discharge below something like 3V (as well as needing special chargers, but you've obviously got one of those.) Is there any easy way to design a circuit to cut the things off if the battery's discharged too much, or do you just have to guess, and recharge it while it still works?
You could drive the LEDs at a current that would still keep them from burning out even if one got fried. Example: Lets say that your trying to light up three 3V 20ma LEDs. If you drive each at 20ma and one burns out you'll probably be putting something like 30ma though each. If you limit this to 13ma to each LED you will put 19.5ma though each if one burns out. The more LEDs you add the more current you can handle if one burns out.
But won't my LEDs look dimmer with less current? This link explains it better than I would. http://led.linear1.org/how-is-led-brightness-related-to-current/
==QUESTION==
On a separate note, I have heard that it is not preferred to limit several LEDs with the same resistor, as the failure of one LED will cause the others to overload. Is there a way of avoiding this without using an individual resistor on every LED?
You are right, but you don't have the whole truth. The problem is that unlike man, not all LEDs are created equal. Each LED will have a different forward voltage, the voltage drop across each LED could vary tenths of a volt.
An LED is fully bright in saturation. In saturation it doesn't act like a resistor. Small changes in forward voltages can result in large changes in current.
In practical application, if you limit the current with 1 resistor to 120mA, LED 1 sinks 20mA, LED 2 sinks 20mA, and LED 3 sinks 80mA. Even if each LED can take 60mA, LED 3 will burn out prematurely. But wait! We limited the current to 120mA which meant that even if 1 LED burnt out, we'd be fine (60mA * 2 = 120mA). Once LED 3 burns out, perhaps LED 1 sinks 40mA and LED 2 sinks 80mA. Pretty soon all your LEDs are burnt out.
The moral of the story is that the only way to control how much current goes through each LED is a current limiting resistor for each parallel leg.
Interesting little project. Planning something similar myself. A couple of comments that could improve the tutorial.
1. You state "power will be flowing ... to the white LEDs first then to the red ones", but your diagram shows the opposite.
2. In the first part of the tutorial you are calculating the value of the LIMITING RESISTOR. In the second part, you are calculating the resistance of the groups of PARALLEL LEDs. This is a bit confusing as for how it relates to the selecting the correct resistor values.
Each resistor and LED combination (red or white) will see the same 3.7V from the power supply. If the resistance of the LED array is LOWER, a BIGGER resistor (or combination of resistors) is required to limit the current. For the white it will be R1. For the red it will be R1+R2. This is why the white LEDs need to be "1st". R1 is actually used by both.
I calculate R1 = (3.7-3.4)/.12 = 2.5 Ohm and R2 = (3.4-2.4)/.06 = 16.7 Ohm (approximately)