My first Arduino prototype!

LEDs, fiber optics, etc - everything needed to "Make it Glow"
User avatar
slawton
Can-Do Captain
Can-Do Captain
Posts: 935
Joined: Tue Mar 26, 2013 8:37 pm
Location: Space Coast, FL

Re: My first Arduino prototype!

Post by slawton »

NCC1966 wrote:
slawton 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.

:roll:

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!

:lol:
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.

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.
I'm a modeler, not a doctor...

Introduction
Galleries: Member, Comparison, Fleet, Action, Manufacturer
User avatar
NCC1966
Crafty Commodore
Crafty Commodore
Posts: 1281
Joined: Thu May 19, 2016 6:20 pm
Location: Brasil, SP

Re: My first Arduino prototype!

Post by NCC1966 »

slawton wrote:You come across as speaking down to me.
Sorry it was not my intention. I was just trying to prove my point but perhaps the fact I am not an English native speaker made my words to be misunderstood. Friends?

:)
Thanks,

Yan.
User avatar
NCC1966
Crafty Commodore
Crafty Commodore
Posts: 1281
Joined: Thu May 19, 2016 6:20 pm
Location: Brasil, SP

Re: My first Arduino prototype!

Post by NCC1966 »

Fellows, taking from where I stopped I prepared a small video demonstrating the schematics and instructions to allow controlling several LEDs from a single Arduino pin:



At the right hand you have a row of six LEDs flashing together and they are all hooked to the pin 12 of the board through a 2N2222A transistor. The 2N2222A is a general use transistor with a collector current value limited to 800mA. Considering that each LED consume 20mA we could hook up to 40 LEDs on it, but to stay safe let's keep with a security margin and stay in 35 LEDs. For such quantity of LEDs it may be necessary to reduce the resistor to the half the value (from 680R to 330R). I didn't test is though.

:)
Last edited by NCC1966 on Mon Jul 18, 2016 7:03 pm, edited 1 time in total.
Thanks,

Yan.
User avatar
NCC1966
Crafty Commodore
Crafty Commodore
Posts: 1281
Joined: Thu May 19, 2016 6:20 pm
Location: Brasil, SP

Re: My first Arduino prototype!

Post by NCC1966 »

Kremin wrote:So what voltage does the Ardunino run off?
Kremin, as mostly of digital circuits the work tension of Arduino is 5V. When you are just prototyping with very low consume components you don't need an external power source, as the computer USB will provide this voltage.

However when you start to hook current starving parts you will need an external source and then you can connect any power supply within a range from 6 to 20V (limits) so its regulator will adjust it properly. However the papers recommend that you stay within 7-12V.

Now for the consume the amperage to run along the Arduino board shouldn't surpass 500mA (maximum). That's why we need transistors in the logical pins. Overloading the board by hooking several LEDs (or any other component) directly to the pins can either make it to not work properly as well to damage the board.

I am using for my prototypes a 6V 1A power supply that is what I had around and it is supporting well... I left it running a full overnight and it didn't fail, so probably I will use it for my first starship project and plus a separate 12V 2A power supply for the bunch of LEDs that will be hooked directly (not Arduino).

:)
Last edited by NCC1966 on Mon Jul 18, 2016 6:58 pm, edited 1 time in total.
Thanks,

Yan.
User avatar
NCC1966
Crafty Commodore
Crafty Commodore
Posts: 1281
Joined: Thu May 19, 2016 6:20 pm
Location: Brasil, SP

Re: My first Arduino prototype!

Post by NCC1966 »

I would like to correct a small mistake. Seems that the 2N2222A transistor has a too very higher collector current than I supposed. I mentioned that it was 150mA but actually it is 800mA. So it means that it can handle safely at least 35 LEDs and not only 6 as I said. Still better than I had imagined!

:D
Thanks,

Yan.
Post Reply

Return to “Lighting”