Seeking recommendations on power source for project

Hi everyone,

I'm currently working on navigation lights for my RC airplane 8). I have been lurking through the forum and other places looking for a way to best select the battery and general wiring for my project. I did not want to take up all my IO ports as I actually wanted to follow Airbus lighting sequence and lighting and that would require a lot of ports for things that are essentially doing the same thing.

My problem:

I have 4 separate sets of lights (Strobe Lights, Positioning Lights, Beacon, and Tail Strobe, additionally in the future I'll add extra landing lights) in groups doing the same thing each.

The code has already been written and the lights tested with one LED per function group. So far, so good. But now, as I need to place this on an RC airplane, I need to run the Arduino Uno on batteries, as well as the whole LED setup. I can't figure out for the life of me how to choose the correct batteries to power it up safely and sufficiently. I have read all those tutorials on calculating the load of a circuit, power, and series/parallel arrays, Ohm's Law, so on and so forth... I just can't figure out how to calculate the power requirements and how much will be sufficient for everyone to be safely happy (board and LEDs).

The problem is that the lights are not going to go in same color groups which makes lights share a common current and voltage. For instance:

Position Lights
I plan on connecting 2 LEDs in place of every light.
So: 2x Red LEDs (left wing), 2x Green LEDs (right wing) and 2X Yellow LEDs (tail) and since they're all doing the same thing (just being on permanently while the code runs) I want to wire them together and connect them to just one port. (Yes, with a transistor (BC337), and each with their own current limiting resistor).

Strobe Lights:
2 White LEDs (left wing), 2 White LEDs (right wing) (each)

Beacon Lights:
2 Red LEDs (top) 2 Red LEDs (bottom) (connected to PWM as they fade in and out)

Tail Strobe:
2 White LEDs

I don't know how to best wire them, I was thinking to place them parallel so that I can rely more on Amperage rather than Voltage. I believe a series/parallel array would work, but I'm not sure.

LED Specs
White LED 3v2 @ 25mA
Red LED 2v @ 15mA
Green LED 2.1 @ 20mA
Yellow LED 2.1 @ 20mA

Any help would really really be extremely appreciated, I will post my code and make an instructables tutorial for anyone interested but I want to be as precise as possible and I don't want to fry my Arduino or have trouble down the line with the components and board.

Any light that would be shone on how to calculate my required voltage and best wiring practice would be amazing, and awesome for my future projects as well.

Thanks! I appreciate everyone's input immensely .

The Arduino can happily source 20ma per pin with 40ma an absolute max recommended limit. Since your most power hungry LED is 25ma you don't really have any need for any transistors.

For the colored LEDs, using the example of the Red LED, The Arduino outputs 5V and the forward voltage (Vf) of the RED is 2.1V. 5V - 2.1V - 2.1V = .8V. You then need to figure out what resistor to use (in series) to keep current limited to 15ma so, using Ohm's Law, V / I = R so .8V / .015A = 53 ohms.

For the white LEDs, with a forward voltage of 3.2V, you can't put them in series because 2 x 3.2V > 5V. What you can do is connect each one to a separate pin and in your program simply tell them both to blink at the same time. And again, 5V - 3.2V = 1.8V; 1.8V / .025A = 72 ohms.

Just to be clear, you're hooking these up as: Arduino pin to LED anode; LED cathode to resistor; resistor to GND. With the colored LEDs there will be two LEDs in the string. The order between LEDs/resistor doesn't matter.

With respect to powering the Arduino, you can use any BEC (or 5V output from an ESC) to power it via the 5V and GND pins. A switching BEC will be more efficient than the Arduino's linear regulator.

Awesome, thanks for that reply, I was thinking to source the whole thing maybe from a separate power source from the aircraft's mains as I wanted to ensure a correct flow even if my battery is almost drained before the end of the flight.

The issue I see though, is that if I connect each LED to a pin (resistors included and all), I will run out of ports and I want to keep some ports open for further expansion of the code. In the future, with a more complex RC plane, I wanted to add 3 small servos to control retractable gear, landing lights and a camera stand to move around.

Since I'm adding a total of 14 LEDs I don't think that's precisely the best way to place them (in each pin) also because it makes little sense to me to occupy different pins doing the same thing like all 6 Position lights are only on all the time.

I think maybe I could do a diagram and post it along in a while.

Remember you can have two colored LEDs on a single pin but only one white LED on a single pin. Just restating that in case I wasn't clear. With how you stated it below (position, strobe, beacon, tail) that would be a total of 11 pins.

With respect to using a transistor, the transistor introduces a .7V drop between the collector and emitter (Vce). In other words, using the examples above, you would subtract an additional .7V for the transistor before calculating the resistor needed. Unlike the LEDs and resistor, the position of the transistor in the string does matter: the transistor's emitter should be at the end of the string (connected to GND).

LEDs don't balance power properly when put in parallel unless you keep a resistor in series on each parallel string.

If you power LEDs directly from a battery (unregulated) make sure you account for the changing battery voltage as it discharges.

[quote author=Rigo T. link=topic=220685.msg1606049#msg1606049 date=1393223866]
The issue I see though, is that if I connect each LED to a pin (resistors included and all), I will run out of ports and I want to keep some ports open for further expansion of the code. In the future, with a more complex RC plane, I wanted to add 3 small servos to control retractable gear, landing lights and a camera stand to move around. [/quote]

Have you considered using shift registers to get more outputs? A few 74HC595 registers could give you a whole bunch of outputs, and there are even versions that can sink a constant current to the LEDs, like the STP16C596, so you could potentially get by with fewer resistors. The ShiftOut tutorial is a good starting point, and there are quite a few more tutorials out there as well. :slight_smile:

Hi there!

I don't know if I'm maybe over complicating myself, I didn't think that having 14 LEDs doing different things would be such a big problem haha... Thanks for the assistance, I'll take a look at the shift out tutorial.

What mostly worries me is burning the board, I don't care about the LEDs I have tons, but the board is what I'm trying to protect. I have a 4 AA battery case, and I was planning on powering the whole thing with that (seemed enough to me). But after reading for a bit longer on other's projects I soon realized it could not be enough, or I could damage components or the board and there's really no straight forward tutorial on how to appropriately power your project off of batteries.

Tell me if I'm wrong. Arduino uses 5V @ about 200mA. (some places say I should feed it 7V for it to behave correctly through the pins).

I have plenty of LEDs... The way I added them up is like this:

Navigation Lights:
2x Green 2v @ 15mA
2x Red 2.1v @ 20mA
2x Yellow 2.1V @ 20 mA

If parallel I understand I should get 2.1v @ 55mA (series transistor to each LED)

Strobe Wing Lights:
4x White LED 3.2v @ 25mA

If parallel 3.2V @ 100mA

Strobe Tail Lights:

2X White LED 3.2v @ 25mA

If parallel 3.2@50mA

Beacon Lights:
2x Red LED 2.1V @ 20mA

If parallel 2.1v@40mA

Which gives me a total of:

10.6V@245mA

PLUS

Arduino Uno R3 7V@200mA

17.6v@445mA

So, I think I did something wrong there, or something isn't correctly set up here... I highly doubt that I need more than 12V to power all my LEDs and my Arduino. I've seen projects powered by a lot less or even 4 AA batteries and everything seems smooth. I will add an NPN BC337 Transistor to each pin which will in turn power each pin's output to their respective circuit, connected to a mains positive and grounded to the transistor and at the same time to the Arduino's ground terminal.

I tried to make an schematic but with the uncertainty of the power requirements I really didn't get anywhere with it. That's about the size of it guys... Someone shine some light on me please. :wink:

If you add 1 shift register, it will take care of all your current concerns.
The Arduino itself only uses 25-30mA.
The LEDs will use whatever you set their current limits to. Usually 20mA is max continuous current.
The TPIC6B595 can handle 150mA per output continuously, so you can parallel up to 7 LEDs per output without concern.
Shift in a 1 to turn an output on (outputs can only go low and sink current).

digitalWrite (ssPin, LOW);
SPI.transfer(dataOut);
digitalWrite (ssPin, HIGH; // rising edge changes the outputs to the shifted in data

Resistor value:
(Vs - Vf)/current = resistor value

Example:
(5V - 3.2V)/.02 = 90 ohm

Resistor wattage rating: P = I^2 * R: .02 * .02 * 90 = 36mW, 1/8W or 1/4W resistor will do.

Ohhhhh, awesome, that seems like a reasonable solution and I have seen it used in other cases as well with 7 segment LCDs and such.

I do have another question for you, CrossRoads, for future projects, I still would like to know how do we weigh in all the current needs for a project. For instance, will my 6V 4X AA in Series battery holder do the trick and feed all LEDs and the Arduino? Are my calculations correct when I said:

Which gives me a total of:

10.6V@245mA

PLUS

Arduino Uno R3 7V@200mA (except for this as you said it is only 25 - 30 mA)

17.6v@445mA

Or this is off somehow? I really just want to find myself a nice solution for calculating my electric needs for more projects in the future. Also, instead of a shift register, why not the transistors, for instance?

Thanks CrossRoads, that's a nice solution and gives me additional options as well!