AndersM
Posts: 33
Joined: Sun Sep 06, 2015 1:18 pm

Changing battery running Pi

Mon Nov 20, 2017 6:37 pm

Hi!
I'm planning to use a raspberry pi to collect sensor data for a couple of days, approx. 3*24h. I have to run the Pi on batteries. I have a number of power-packs (5V USB 7800 mAh) and can switch batteries a few times a day. What is the best set up to make it possible to continuously run the Pi and be able to switch batteries?

pcmanbob
Posts: 7964
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Changing battery running Pi

Mon Nov 20, 2017 8:20 pm

Probably the safest option would be to power down the pi.

To change batteries live you would need to parallel to 2 batteries so as to have no break, its never a good idea to connect a discharged battery to a charged battery as high currents can end up flowing between the 2 batteries, you may also see voltage spikes when doing this.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Imperf3kt
Posts: 3232
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Changing battery running Pi

Mon Nov 20, 2017 10:29 pm

If it is possible, maybe try using a lead acid battery (such as the kind found in vehicles) and a step-down converter. It should not rrquire any changing for three days use.*

*purely an guess, without any figures on current draw, I cannot give an accurate estimate.
55:55:44:44:4C
52:4C:52:42:41

AndersM
Posts: 33
Joined: Sun Sep 06, 2015 1:18 pm

Re: Changing battery running Pi

Tue Nov 21, 2017 5:01 pm

pcmanbob wrote:
Mon Nov 20, 2017 8:20 pm
its never a good idea to connect a discharged battery to a charged battery as high currents can end up flowing between the 2 batteries, you may also see voltage spikes when doing this.
Yes, these are kind of complications I anticipated. I thought it might require some circuitry including maybe a large capacitor and switch to select battery but have no experience in designing it.

Imperf3kt wrote:If it is possible, maybe try using a lead acid battery (such as the kind found in vehicles) and a step-down converter. It should not rrquire any changing for three days use.
This is a possible but a bit cumbersome solution. I also thought about adding a solar panel to charge the battery.

Powering down during battery switching would be possible if the other solutions are to hard to implement in this particular case but I'm also interested in the general solution on the non interrupted power supply problem using batteries.

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Changing battery running Pi

Tue Nov 21, 2017 5:41 pm

Powering down during battery switching would be possible if the other solutions are to hard to implement in this particular case but I'm also interested in the general solution on the non interrupted power supply problem using batteries.
I think the following scenario would work:

1) Find a 5V (cell phone type) battery pack that can power the Pi, and has the attribute that you can connect and/or disconnect charging power to the battery pack without this action causing the Pi to crash. These do exist, but they're hard to find and there's no real way to tell from the blurb or sales information whether or not it will work. Most battery packs that you can buy at retail will cause the Pi to crash when you either connect or disconnect charging power. You need to find one that doesn't do this.

2) Hook up a charging circuit to charge the battery pack, with the power coming from a portable 12 v (car battery or wheelchair battery type). This battery can be changed out/recharged/put back as needed.

3) Hook up Pi to run from the battery pack.

Now, the Pi should stay up and running forever. You just have to change out and recharge the backup battery as needed. As long as the Pi doesn't crash from the act of removing the charging power, you should be good to go.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

hippy
Posts: 6757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Changing battery running Pi

Tue Nov 21, 2017 6:55 pm

If your Pi, sensors and anything else connected can run on slightly less than 5V you could perhaps parallel-up two battery connections through diodes. Plug in the new, remove the old, repeat.

You could have a DPST switch which bypasses the diodes once swapped so you would be back to 5V and have less time below 5V.

Code: Select all

                 \ 
A+ )-------.---O  O-------.---.---( 5V
A- )---.   |              |   |
       |   `--------|>|---'   |
       |                      |
       |         \            |
B+ )---|---.---O  O-------.---'
B- )---{   |              |
       |   `--------|>|---'
       |
       `--------------------------( 0V
       

User avatar
Burngate
Posts: 6193
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Changing battery running Pi

Wed Nov 22, 2017 10:07 am

At the top left corner of the schematic of the Pi https://www.raspberrypi.org/documentati ... matics.pdf is an "ideal diode"
It has the advantage of almost no voltage drop.
So if you wish to go for a much more complicated solution, build two of these onto a small circuit board, and you wouldn't need the switch.

AndersM
Posts: 33
Joined: Sun Sep 06, 2015 1:18 pm

Re: Changing battery running Pi

Wed Nov 22, 2017 7:22 pm

Burngate wrote:
Wed Nov 22, 2017 10:07 am
At the top left corner of the schematic of the Pi https://www.raspberrypi.org/documentati ... matics.pdf is an "ideal diode"
It has the advantage of almost no voltage drop.
So if you wish to go for a much more complicated solution, build two of these onto a small circuit board, and you wouldn't need the switch.
Looked at MOSFET ideal diode yesterday but as I understood it it will not work in this application as the MOSFET will be switched on all the time. Or have I misunderstood?

Ordinary diodes, even Schottky, seem to have too large voltage drop not to risk problems with the Pi/sensors if using 5V powerpacks. One of the sensors uses USB.

User avatar
Burngate
Posts: 6193
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Changing battery running Pi

Thu Nov 23, 2017 11:54 am

Let's have a look at these two diagrams:
Image
IdealDiode.png
IdealDiode.png (7.32 KiB) Viewed 1552 times
In the first, the gate of the FET is held at ground, so in our case at -5v relative to the the source. The FET will always be on.
So current can flow in either direction.

In the second, the gate will only be pulled low if the right-hand transistor is off, which will only happen if the left-hand transistor is on, which in turn will only happen if the input voltage is the same as or higher than the output voltage.
Thus, current can only flow in one direction, which is what we want.

AndersM
Posts: 33
Joined: Sun Sep 06, 2015 1:18 pm

Re: Changing battery running Pi

Thu Nov 23, 2017 7:00 pm

Burngate wrote:
Thu Nov 23, 2017 11:54 am
In the second, the gate will only be pulled low if the right-hand transistor is off, which will only happen if the left-hand transistor is on, which in turn will only happen if the input voltage is the same as or higher than the output voltage.
Thus, current can only flow in one direction, which is what we want.
Ah, Thanks!
I did not realize that you meant the whole circuitry as the ideal diod.

So, yes this gets rather complicated as it also needs to be duplicated. But if battery to battery current is a problem it is a nice solution.

Return to “Automation, sensing and robotics”