Switching between two power sources (Li-io batteries)

Hi!

I am completely new to electrical engineering and using the arduino but wanted to complete a personal project to learn more about arduino so please forgive me if I sound dumb, just need some guidance!

I am currently using an Arduino Mega and I want to find a way to power it using two sets of Li-io batteries. Essentially, what I have in mind is that the arduino is powered by the Li-io battery while the other one is being charged from a solar panel. Once the battery in use by arduino is almost run out, the power source automatically switches to the second battery that was charged by the solar panel to power the arduino. From research, I saw that a relay might be needed for this task but I have no experience with them and I am not completely sure how I would implement that into my idea or if I would need something else that would facilitate the switch over between the power sources.

Any help is appreciated, thank you!

Why? Why not just parallel them, charge and run them down together? There is no magic capacity unleashed by separating them, only if they are replaceable.

Either a relay or a power mosfet in the high side of each battery.
You will also need some blocking arrangement to stop one battery feeding the other.
Simplist arrangement i can imagine would be to use another uC chip, maybe an ATtiny85 or Arduino promini to detect the voltages and do the switching.
Naturally if you want to have continuous working of the Mega you would need to switch the new battery in first before disconnecting the old one.
Then there is the arrangement required to recharge the old battery.

Far easier to simply recharge the one battery, forget all this switching in and out.

What about adding a diode in serie for each battery pack and having connectors for 2 batteries. Connecting a fresh, charged battery in parallell to a low one sounds like current rushes to me.

I wanted to learn how I could switch between power sources if for example one battery runs out, there is a backup battery being charged by solar that could power the arduino. That way the arduino has a consistent power source. For applications such as a remote data logger etc.

Right, you can't do that. But it is my understanding that some battery management systems can handle that for you.

What happens during bad weather, and the backup battery is not charged?

Switching to backup power is at best a temporary solution. For genuine reliability, the system has to be able to automatically recover from general power failures.

Don’t think you understand what @anon57585045 suggested

Through a regulator......????
Have to remember it was an initial suggestion, not an engineering "must do".
If you want a really simple one, use a double schottky diode.
Ahhh...but then there is the solar charger.....

Done..

Is it possible to recharge the battery with solar while it is powering the arduino? Sorry if this sounds dumb, I'm just thinking of ideas to implement the uses of solar power with batteries to power the arduino

Why not? Can you use your phone while it is charging?

Sure, depending on the type of battery. With NiMH and lead acid batteries that is not a problem.

At present there don't seem to be good options on the hobby market for "load sharing" solar LiPo chargers (LiPo batteries are VERY finicky and easily destroyed by overcharging and overdischarging).

The solutions that manufacturers have come up with for cell phones are probably proprietary, as it is difficult to impossible to find out how the charging is actually done.

ahh okay, so Li-io batteries wouldn't be a good option. To make that work, how would I make the arduino know when to start charging the battery with solar while it is in use? Is that more coding based or am I missing a component?

okay true haha, how would I go about calculating the appropriate specs so it would be able to charge the battery faster than it is discharging? The solar panels I have are 1 Watt each with 6 Volt

battery is like a glass with water, solar battery current is water that you add to the glass, arduino consumption current is water you take from the glass, figure it out

1 Like

A load sharing charger makes that decision for you.

For hobbyists, lead acid batteries are by far the best choice for solar powered projects, but NiMH batteries run a decent second.

A solar scheme could be where the solar cell feeds into a Solar Charge Controller. The Charge Controller, charges the battery during sun up. There are 3 types of solar charge controllers PWM, MPPT, and Hybrid. Here you can do the research on the differences. I prefer MPPT or MPPT Hybrid.

PWM (Pulse Width Modulation) charge the battery according to a preset timed schedule.

MPPT (Maximum Power Point Tracking) charge the battery according to the charged characteristics of the battery being charged.

Hybrid (MPTT). I've only use Wind/solar Hybrid MPPT charge controllers. The Hybrid will switch to the best source of power available to charge the battery. When the Hybrid switches away from wind. The power from wind is switched to a dump load.

The solar charge controller can charge the battery while its under load.

My battery of preference is known as LiFePo4.

I prefer solar panels of 12V loaded and +14V unloaded. I find the 17V unloaded solar panels to give the best charges for a LiFePo4. The load on a solar panel is under the charge controllers control.

1 Like

You need to charge periodically or lose

Yep. Lead acid solar chargers do just that, cheaply and reliably!