You come across as speaking down to me. Earlier you expressed you had trouble with the electronics. While I have no experience with the Arduino, I do have some knowledge in this area so I thought I'd provide some suggestions for which you may not have been aware. Most people on this forum try to share what they know to be helpful. They are merely suggestions or observations to which you can ignore completely, take bits here or there or follow entirely - completely up to you.NCC1966 wrote:I suggest that you dig a bit DEEPER... Also buy some parts (including an Arduino board) and make some prototypes — as I did. Then perhaps you will have a better perspective of the thing.slawton wrote:....
I am not saying that in theory some of your ideas could not work but they aren't the ideal. They are barely an attempt to deviate of a problem that sooner or later you will end bumping as your project grows. Let's see some points...
1) Arduino is a digital circuit and forcing it to the edge of its current limit can damage it.
2) Even if we hook two LEDs per pin (wrong again, pushing to the edge) we would be limited to something around 20 LEDs. Remember that you cannot use ALL the current for the LEDs as you have to save some for the board itself. Even so 20 LEDs It may be sufficient for a small ship but for a big model you aren't even close. I am starting my first project of a lighted ship (an 1/537 USS Reliant) that may use 80 LEDs or so — if not more!
3) Using LEDs in series instead in parallel as you suggested will cause another problem. Sure that you won't overload the current consume but by the other hand you will "eat" a lot of voltage. Considering that a LED can be lighted by average 1.8V each a 12V power supply (the maximum that an Arduino board supports without damage) would be able to turn barely 7 LEDs. That's why in mostly of lighting circuit people prefer to use LEDs in parallel and not in series.
4) If you have more than one pin to control LEDs doing the same thing you will need to have more code (bigger program).
5) If you need a fade effect (to simulate powering up nacelles or deflector lighting in for instances) how would you do that in a big model with just 6 LEDs? Yes, because the small Arduino boards have only THREE pins that accept the AnalogWrite command that allows to control LED bright. All the other ones you can just turn it on or off. Did you know that? Of course, and as I have said, in this case the smart way out would be to use ONE pin controlling a couple of transistors and lighting several LEDs at once.
So, in short the question is: why to cause a lot of hassle using more pins, more wiring, more coding, etc, and limit yourself in terms of cool things you can do by just adding a single 10 cents transistor? I really don't see the point. It doesn't make sense, unless, of course, you don't want to learn how a transistor works.
And don't forget that we are talking about to just light LEDs. What if you are going to add small engines to your Arduino board to move up and down the nacelles of a Voyager model or to rotate the brussards of a TOS Enterprise by your command? You won't have an alternative but to use a separate power source and transistors (maybe even a small relay) to act as a switch — as demonstrated in my schematics.
Sure one can make fire by rubbing two pieces of dry wood but I bet that everyone you ask will prefer to use a lighter instead always when possible!
For instance, the first circuit (transistor with 6 LEDs) you have will work, but the transistor and six resistors could be replaced with a single resistor on a 12V supply if they were put in series. It would be simpler, use only one I/O line and also use a lot less power.
Say you have 80+ LEDs to turn on -- do you need the Arduino to drive them? Why not use a switch directly to the power supply or a relay if they are all on/off? I would expect the Arduino to be used exclusively for the blinking LEDs or any other non-static effects (motors control, etc.). While fading may be accomplished with a pseudo-analog voltage output or staggering LEDs, a simpler approach may be a Resistor/Capacitor circuit which can create a gradual voltage increase/decrease rather than the sudden off/on.