Ok, that's clearer, and it isn't going to work.
Without a per LED resistor, one of the LEDs is going to take the current very briefly, before burning out, when another will take its place.
And so on.
240sxy:
This is what I was trying to describe. Parallell, no?
AWOL's right you'll need a current limiting resistor either before or after the LEDS. The other change I'd recommend is having three or four LEDs wired serially to replace each single LED that's presently between the positive and negative sides of the circuit.
240sxy:
kd7eir:
With this arrangement, you only need to supply 12 volts to the circuit, and about 250mA
250mA isn't too much?
It depends on what is supplying the current. You mentioned eventually powering it from a normal automobile battery, from a source like that 250mA is almost neglible. But from a standard 9V (which has only a ~600 mAh capacity), it you can expect the LEDS to be powered for 2 hours, at most.
240sxy:
Also, what would happen if I just wired 20 LEDs in parallel? Not enough power?
Just as a general comment, if you are going to do even simple electronics design you really need to understand how to find the current and voltages in basic parallel and series circuits. Please take a look at the links I gave you earlier, as well as some the others in the thread. Finally, you'll need to understand at least the gist of Kirchhoff's Laws.
For now let's do crash course with KCL... According to Kirchhoff's Current Law (KCL), the sum of all currents flowing into a node (node = a point of connection for multiple wires or other circuit elements) equals the sum of all currents flowing out (IIn = Iout). This holds true no matter what is supplying or drawing the current.
While this relationship can be used in multiple ways, let's just look at 20 LEDs of the same type in parallel. Despite the number of LEDs this circuit has only two nodes, one on the positive side and one at the negative side. If the 20 LEDs are the same, than their current draw ill be very similar (ideally exactly equal, but we don't live in an ideal world). Therefore you can estimate the current comming out of one node as simply being 20 times the current that one LED draws and be very close to the actual measured current.
If you have strings of say 5 LEDs in series running off a 12v supply, the voltage across them ( for red LEDs ) will be about 9.5 volts, and you could use a 120 ohm resistor to limit their current to about 20 mA ( 12v supply , minus the 9.5v across all the LEDs = 2.5 volts / 0.02 amps ( ohms law ) = 125 Ohms )
BUT this only applies if the 12 volts is regulated , if the supply is taken directly from the car battery it can go up to 14 volts, giving you ( 14 - 9.5v = 4.5 / 120 ohms = ) 37 mA through all the LEDs which will release their magic smoke, or make them go dark
I always use a 12v regulator for every 1 amp bank of LEDs displays. ( and I only run the LEDs at 18mA which I find a reliable level - out of the last 50,000 LEDs in 3 years I have only had about 6 LEDs fail - excluding orange ones which I had bad luck with for some reason ! )
Since I'm using 12 outputs off the Arduino, I would only need 12 then, correct? My understanding from what I've read, is that a transistor will just use the signal from Arduino to control whether or not a particular set of LEDs receives power
240sxy:
Awesome, I already have 60 .25W resistors so I'll just pick up some more.
NEXT QUESTION!
Transistors.
Are transistors pretty much universal for my application?
Any transistors that are rated above the voltage and current levels previously discussed will do, including both the 2N3904 and the 2N2222. While there are differences between these two parts, they won't matter for this application. In this case, the main determining factor on which of the two to use will be price.
240sxy:
Since I'm using 12 outputs off the Arduino, I would only need 12 then, correct? My understanding from what I've read, is that a transistor will just use the signal from Arduino to control whether or not a particular set of LEDs receives power
Your understanding is correct about the transistors acting like an On/Off switch for the LED strings' power. Therefore if you want to separately control the tweleve different strings of LEDs, you would need one per each output.
Right now I'm in the process of making a diagram (in MS Paint) of exactly what I'm going to do. Once that's done I will post it and hopefully someone can verify everything before I sink more money into this project.
Yesterday I bought a sheet of plexiglass. I believe it was .093" thickness. Is plexiglass easy to bend into tight 90 degree angles?
Notes:
a) Please disregard the resistor rating. I have 60 1/4W 200ohm resistors that came with previous LEDs I purchased. I just now realized they would now apply in 3 LED series.
b) The toggle switch has a blue LED tip which is why there are 3 terminals
c) The diagram shows 30 LEDs in each array. There may end up being more or less. There will be 12 total arrays all with the same amount of LEDs EXCEPT 2 of them.
Questions:
LEDs
On the spec sheet (posted previously) there are ratings of "Min" and "Typ". Do these stand for minimum and typical?
Could I just use 4 LEDs instead of a 100ohm resistor? This would bring me to about 12.8V which I assume would reduce the brightness and reduce the chance of blowing out the LEDs....or not, I still haven't completely grasped this concept.
The Typ forward voltage rating is 3.2V if 25mA. Using a 12V car battery:
12V - (3.2V * 3) = 2.4V
2.4V / 25mA = 96 ohms
Resistors
3) Say I used a 175ohm resistor (if I could find one) for times when the battery may spike to 14V; how much effect would this have on brightness?
4.4V / 25mA = 176ohms
4) What does the wattage rating mean on a resistor? (i.e. I've seen 1/4W resistors for all different ohm ratings).
5) How do I figure out what would be best for my application?
Transistors
6) Is the following correct? I have a feeling I don't need both grounds.
I have the negative terminal of each array connected to the the Collector, the Arduino output going to the Base, and the transistor Emitter going to the ground on BOTH the Arduino and the car.
Grounds
7) In my diagram I grounded the mometary switch to the Arduino, could I theoretically ground this anywhere? In general, can something be grounded anywhere so long as it's "earthed"? (I used this word b/c I was tired of saying grounded)
8) <--lol this should be #8 ) Did I wire the toggle switch correctly?
As far as the toggle switch goes I interrupted the ground from Arduino (from my understanding I could have done this on the positive line as well). Since this switch has an LED indicator, it has a 3rd terminal to ground this. Theoretically, I could connect both the ground terminals directly. This is essentially what I did just not quite literally directly.
Barrel Plug
9) What is the length of the plug on the Arduino? I know the diameter is 2.1mm, is the length 5mm?
10) I was told that I could wire this directly to the car battery. Is that correct? Would it be safer to use a resistor or something else?
Other
10) WIll the Arduino reset every time I turn it off?
I will have multiple flash patterns programmed into my Arduino, and I will be able to use the momentary switch to cycle through depending on my mood that day. Say I set it to the 3rd pattern one day, will it revert to the 1st pattern after I turn it off and back on again?
I think I'm starting to understand all of this a little better, but I'm still far from needing help. I apologize if it seems like I'm asking to be "spoon fed". If you think that's the case, then you don't have to respond. I appreciate all the help and responses I've received so far. I realize this is a lot of questions, so feel free to answer whatever you feel like. I know I will have more down the line.
Also, I have an inkling my diagram is not completely correct, so PLEASE PLEASE help me correct it. Even if it is perfect, any suggestions on how to improve it or do something better would be much appreciated.
I'm hoping to start building this weekend. There are a number of questions I need answered from pg 2 and 3 of this thread before I'm comfortable doing anything.
Also, is there some sort of etiquette as to how long you should wait before you bump?
240sxy:
Transistors
6) Is the following correct? I have a feeling I don't need both grounds.
I have the negative terminal of each array connected to the the Collector, the Arduino output going to the Base, and the transistor Emitter going to the ground on BOTH the Arduino and the car.
The GND pin on the Arduino is the same voltage level as the ground of whatever is powering the Arduino, in this case your car battery (this would be true even if you had a lower voltage adapter from one of the circular 12V outlets powering the Arduino). So you are correct in that there are unnecessary ground wires. While this shouldn't cause any harm, you probably don't want to go through the extra effort running superfluious wires in your car. In this case, just connect both emitters to a GND pin on the Arduino, and skip the direction connections to the car battery. Bare in mind though, if you were driving a few more banks of LEDs then you'd want to do it the other way. This is because there is a limit to the total amount of current that can be sunk by Uno's GND pins.
240sxy:
Other
10) WIll the Arduino reset every time I turn it off?
I will have multiple flash patterns programmed into my Arduino, and I will be able to use the momentary switch to cycle through depending on my mood that day. Say I set it to the 3rd pattern one day, will it revert to the 1st pattern after I turn it off and back on again?
The Arduino will reset every time it loses power. However, there are forms of non-volatile memmory; flash (where your program is stored) and the 1 KB of internal EEPROM. The EEPROM has a limited number of times each memory location can be written, probably more than several thousands of write cycles (technically there's a limited amount times you can expect to write the flash as well, but the EEPROM's limit is smaller by at least a few orders of magnitude). This sounds like a lot, but remember at a 16 MHZ clock rate (i.e. 16 million cycles per second) a fairly complex and/or math intensive Arduino sketch can run through the main loop over a thousand of times per second! So I'd write your program to only update any EEPROM locations being used on an as needed basis (e.g. only when you want change the initial light sequence).
240sxy:
Already though of more questions:
11)Is there an optimal transistor I could use or is more of just a minimum I should use?
For the voltage and current levels in this circuit, nearly all common types of NPN transistors will do. A through-hole packaged 2N3904 will probably be the most readily available, but it's certainly not your only option.
Far-seeker:
In this case, just connect both emitters to a GND pin on the Arduino, and skip the direction connections to the car battery. Bare in mind though, if you were driving a few more banks of LEDs then you'd want to do it the other way. This is because there is a limit to the total amount of current that can be sunk by Uno's GND pins.
So to err on the side of caution should I go straight to the battery. You said connect BOTH emitters to the Arduino, but I will actually have 12 total. I only included 2 in my illustration to reduce clutter. I will have a maximum of 500 LEDs connected distributed over 12 outputs (most likely will have somewhere around half of that
240sxy:
So to err on the side of caution should I go straight to the battery. You said connect BOTH emitters to the Arduino, but I will actually have 12 total. I only included 2 in my illustration to reduce clutter. I will have a maximum of 500 LEDs connected distributed over 12 outputs (most likely will have somewhere around half of that
You mentioned the number of LEDs before, but that was a while ago and I didn't check the earlier posts. So yes, I was just going by what was on your diagram.
In the case of 12 strings or arrays of LEDs, it would be advisable to have the current powering the LEDs go directly to the negative post on the battery instead of through an Uno's GND loop. Under normal circumstances, the total should still be under the absolute maximum current limit for the GND loop. However, you'll need to run a direct connection from the LEDs to the positive terminal of the battery in any case, so it's not much additional effort to bypass the Uno and return the current directly to the battery.
On a (marginally) related note, I just found out I can use the 6 analog pins as additional outputs! 19 usable outputs (i still need one for the momentary switch) for my project??!! what whaaaaatttt??!!!! sweet deal