ARDUINO AS A POWER SOURCE ALTERNATOR

Could some one explain how one could use the arduino to switch between two voltage sources?

I am trying to prolong the flight time of a plane am designing for my senior project. I thought that i could use an arduino and program it to switch between two voltage sources. When one voltage drops below a certain level, the arduino will switch to the other battery. Please help!!

OK, a voting method, then. Reading the voltage on the Arduino through an analog input and a voltage divider should be pretty easy. Then as Bill suggests, use a MOSFET to select the better power source. But, build a bit of hysteresis into it so that it doesn't constantly flip flop. But you can't just throw a switch between sources because the APM will momentarily loose power causing a reset of the Arduino. could mess up the program... You could put a giant capacitor on the Arduino to keep it's +5V up during the switchover.

That's a good point, I obviously, and without thinking ;-), assumed the switched source was not powering the Arduino as well. You could use a design that the Arduino is powered by the second battery always, and the switch just connects the main output to the Arduino supplying battery

Thanks for the advice,but does any one have any sources they could point me to so that i could start working on this. I will need to know the type of Arduino that i have to use, and also how i will have to connect the MOSFET together with the Arduino. I already built a circuit that i could use to detect the voltage on battery and when it goes beyond a certain voltage point it acts like an open circuit.I used a zener diode and a couple of npn transistors. it works but its not precised. My professor then gave me the idea to use an Arduino to do the switching, but i dont know were to start.

see http://arduino.cc/en/Tutorial/HomePage the tutorial on blinking and LED on based on the volatge from a pot on the analog in looks like a good example. Its close to what you are doing. ie. change a state output based on voltage in

If you want to avoid an arduino to do this, check out the BatShare. I use it all the time and it does exactly what you are talking about for 5v and 6v sources off 2 batteries. link here . You can put any battery type of size on each outlet and it will intelligently manage drain equally from both, automatically switch to the one thats best if the other drains too much and I use these not only in my APM but on my over $10k GiantScale aircraft. They work perfectly and very cost effective!

Thanks for the reply, the drone i am designing has to have an input voltage of about 12.6 volts, so thus am using an 11.1v lipo battery. I plan on using two 11.1v lipo batteries.The peak or max current output is somewhere around 36A. With the BAT SHARE you mentioned could i modify it or are there other ones that can handle this peak currents. I know the voltage is not a problem because i can step it up .

Rather than modify the BatShare, use it to monitor the battery voltages, and connect the outputs to drive the MOSFETs.

Where is 12.6V a hard spec? If you are looking at powering brushless motors, the difference from 11V to 13V is negligible if the battery can provide the current the motors want. Watts is Watts - lower voltage+higher current = same wattage, A.K.A. power. Using a switching supply to bump the voltage will yield a net negative. A pretty big one actually because the current required would dictate pretty beefy switching supply which would add considerable weight to the aircraft so you would need bigger batteries which makes the aircraft heavier - see where this is going?

Yes Stephen has a great idea. I will check on whether ones exist for 12.6v not sure. To be frank the easiest way to prolong flight with Lipos are the source is to join 2 or more in parallel and increase the MAH. I am not sure adding additional weight of a switcher will be of benefit efficiency wise. Just a thought. I get 48 minutes on 2 - 4S - 5000 MAH batteries on my Arducopter. I get almost 2 hrs on 2 - 3S 3500mah flight packs on my Arduplane. How long are you looking to fly ? Wayne Garris gets 3.4hrs on the TechPod with 10000mah 6S setup....food for thought!

Thought that might not actually handle the heat. At 0.5V drop at 20A, the diode will be burning 10W of power, which needs to be dissipated. I think you could bolt both diodes to this thing and it would work:

But that's only rated at 4A. You can also go with something like this, which is an ideal diode controller, it basically is an automatic switch for some large MOSFETs, this could handle... a LOT of amps.

If you're always going to be pumping a lot of current through it, and you don't care so much about voltage drop, and you don't need any intelligence, then the Schottky diode might make more sense. The thing to know about this, is it will always be sharing the load to some degree, between the two sources. If you have two batteries hooked up, it will initially draw from the one with the highest voltage, until they are equal, and then they will share the load from then on. The battery with the higher charge CANNOT back feed and charge the second battery, which is good.

If you want super low resistance, and some intelligence, the Ideal Diode controller is the way to go. The LTC4416 is a nice system. In particular, you'll notice that you can designate one of the sources as the primary source. It will always draw ONLY from this source, as long as the input voltage is in range. It will only draw from the secondary source if the primary falls below a setpoint. Then it switches over. My only concern with this is that in some cases, I think you could have it switching back and forth rapidly. This is what would happen if the power supply couldn't handle the load. Say the primary source can't handle it, so the voltage drops, it would switch over to the secondary. Now that the primary isn't being drawn on, the voltage would recover, and the 4416 would switch back over to the primary...