Switching between two 5v/3a USB power supplies, with little to no delay

Thread Starter

Rowa

Joined Dec 20, 2019
4
Hello,

I am currently building a raspberry pi 4 system that will be placed inside a vehicle. What i want is that whenever the car is on the raspberry will receive power from the car charge port using a 5v/3a charger. If the car gets switched off i want it to switch to the backup power bank that also supplies 5v/3a without turning off the raspberry so it needs to switch almost instantly. My question is is this possible to do to keep the voltage at 5v and at 3amps?

I am a noobie when it comes to circuits so any help would be appreciated

Kind regards,
 

hexreader

Joined Apr 16, 2011
581
Why not supply the power bank from the car supply?

Leave the Pi permanently powered from power bank...

EDIT: Or if lighter socket has permanent power (many do not) buy a good quality Cigar-lighter USB converter
 
Last edited:

Thread Starter

Rowa

Joined Dec 20, 2019
4
Why not supply the power bank from the car supply?

Leave the Pi permanently powered from power bank...
I've tried, this but the power bank cannot handle being charged and charging another device at the same time. I've looked into finding a power bank that can do this but no luck so far. If you know of one that can do that while supplying 3A let me know
 

hexreader

Joined Apr 16, 2011
581
Would need to be a hefty power bank to supply 3A for any significant time. Have you compared AmpHour rating against required running time?
 

Thread Starter

Rowa

Joined Dec 20, 2019
4
The powerbank i've found can do this for about 6h before running out of power. What i've tried is to have the powerbank charging while also powering the pi but the problem is as soon as i disconnect the powerbank from charging it will turn off the pi. That is a problem since my requirement is that the pi always stays on
 

bassbindevil

Joined Jan 23, 2014
824
Build a power bank that runs at 8.4V nominal (2S) (get a 2S PCM and something like an SY6912 charger module (set for 2s)). Then, an LDO (low drop-out) buck converter that can deliver 5V/3A from an input voltage ranging from 6V to 15V. Feed the buck converter though a couple of suitable isolation rectifiers.
The LDO thing might be a problem, unless you don't need to use the full capacity of the battery pack. So, another approach would be a 3S battery pack, with a 3S PCM, SY6912 (set to 3S), and a boost converter to step up the car 12V to whatever is enough for the SY6912 to work with. Finally, isolation rectifiers and a 5V/3A buck converter.
 

dendad

Joined Feb 20, 2016
4,451
Your car has a pretty decent power bank. The 12V battery.
The easiest thing to do is have a high efficiency switch mode regulator run off the car battery itself. Forget another power bank.
If you wanted to spend extra money, just buy the largest 12V battery that can physically fit into the car.
 

dendad

Joined Feb 20, 2016
4,451
An automotive battery doesn’t like continuous discharge. Ever leave an interior light on by mistake?
As long as the battery voltage does not drop too far, it does not matter to have continuous discharge. Leaving the light on is not the problem in itself. Fully discharging the battery is.
Most cars now do have a continuous load. The remote entry system is always on, for example. No doubt, more of the car computer will be on too.
As the TS wants the Pi to be on all the time, adding a second smaller battery makes no sense. It will discharge long before the car battery.
Some under voltage discharge protection could be a good idea to protect the car battery. Over discharge can damage it.
 

dendad

Joined Feb 20, 2016
4,451
But I think, unless the Pi needs to be on all the time, a better way to go is one of the automatic safe power down options for the Pi.
And make the file system read only. Have backup data stored on a USB stick if needed. The RasPis have a reputation for killing SD cards.
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
We are already discussing a similar question in another thread. You don't need to switch, like the previous post suggested. Just charge the battery bank and use it at the same time.
 
As long as the battery voltage does not drop too far, it does not matter to have continuous discharge. Leaving the light on is not the problem in itself. Fully discharging the battery is.
Most cars now do have a continuous load. The remote entry system is always on, for example. No doubt, more of the car computer will be on too.
As the TS wants the Pi to be on all the time, adding a second smaller battery makes no sense. It will discharge long before the car battery.
Some under voltage discharge protection could be a good idea to protect the car battery. Over discharge can damage it.
It is true there are continuous loads on a car battery but that is not to say that a car battery is ok with discharge just not over discharge. My understanding is that those permanent loads are very very light and that a car battery is not designed to discharge at all. Cranking the engine may take several hundred ampere but only for a few seconds so the discharge is negligible. The 13.8V produced by the alternator is at the low end of a float charge voltage for a lead acid (or the modern variants) assumably to avoid the need for temperature compensating the charge voltage and 13.8V would take a loooong time to fully recharge a discharged battery. To test this point, next time you have the opportunity and have a discharged car battery on hand, hook it up to a bench supply set to 13.8V and watch the current maybe start high but within a few minutes drop to a trickle of the occasional electron having lost its way accidentally flow into the battery. Then consider the battery capacity is in the order of 40 to 60AH? And the charging efficiency averages out to about 70%? Considered with the small charging current several days would be required for a full recharge. The battery may get enough charge to crank the engine reasonably quickly but to actually recharge fully typically takes days if not weeks of normal car use. Car batteries are not called deep cycle batteries and for good reason. And don't be fooled by the name 'deep cycle' either. Every deep cycle (lead acid) battery I have had to deal with has been unhappy if discharged below 50% SOC (state of charge) and taking them down below 30% SOC seriously shortens the cycle life expectancy. And deep cycle batteries are designed to be discharged!
So keep the separate battery bank and avoid discharging the car battery if at all possible. Otherwise factor in the shortened life expectancy of the car battery and the cost of its replacement when pondering the pro's and con's of each solution.
The OP says he has a battery module of some description that will run the Pi for 6 hours! Sounds like a plan to me. ;-)
If you cannot cascade the battery bank thing in between the car power and the Pi you should be able to get a schottky with less than 0.4V forward voltage drop. Is that too much? If you do use schottky diodes, try not to keep them too cool either. They have a negative temp co on forward voltage drop so let them warm up a bit, it's good for power efficiency. :)

They also switch almost instantaneously unlike standard rectifier diodes. Good in some ways but be wary of back EMF if you have any inductors for filtering in series with the power supplies.
 

GetDeviceInfo

Joined Jun 7, 2009
2,192
What would a running Pi doe in a cold vehicle? I’ve cranked out several projects where battery capacity is king. Everything goes to sleep until it’s triggered.
 
As long as the battery voltage does not drop too far, it does not matter to have continuous discharge. Leaving the light on is not the problem in itself. Fully discharging the battery is.
Most cars now do have a continuous load. The remote entry system is always on, for example. No doubt, more of the car computer will be on too.
As the TS wants the Pi to be on all the time, adding a second smaller battery makes no sense. It will discharge long before the car battery.
Some under voltage discharge protection could be a good idea to protect the car battery. Over discharge can damage it.
Automotive batteries are not designed to discharge at all. See my other post for details. In my experience and research on the topic of automotive batteries they are intended to crank an engine and that's about it. The continuous loads are tiny and cranking whilst it may be 100's of amps it is also of very short duration so the average 40AH to 60AH car battery does not actually discharge appreciably by cranking the engine.
Automotive alternators also typically produce 13.8V (modern batteries and alternator combo's may vary this) and 13.8V is a float charge voltage which is not sufficient to actually charge a battery, it is enough just to keep an already charged battery topped up. To charge a lead acid battery properly requires a mutli stage charging regime which is a level of complexity just not required unless the battery is being discharged which it typically is not.
If the battery were discharged appreciably, by even as little as 30% the cycle life is also likely to be very short. Automotive batteries are just not designed to be discharged. Not even a little bit. That is not their intended purpose. They are not called 'deep cycle' and for a good reason. But if you did decide to go this way and use the car battery, the terminal voltage is difficult to use to estimate battery charge with any accuracy (except at the extreme ends of the battery state of charge) and even more so if the battery is being discharged at the same time. Your original idea is a good one I think.
 
Top