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

Powering Pi3b from car battery, need some advice on capacitors.

Tue Jan 23, 2018 12:56 am

Earlier today someone was asking about using their Pi to play music in their car. This prompted me to consider using capacitors to keep the Pi powered until it had shut down cleanly. For that I'll need something that detects when the accessories power is switched off and then initiates a shutdown script which hopefully can complete before the power is drained.

To visualise how this may work, I downloaded an Android app and began tinkering.
I had to substitute in places because some components weren't in the app.

I also only assume I have the relay wired correct, so ignore that if its wrong.
I subsituted a lamp as a fuse coming off the battery. I am aware I put it on the wrong wire.
The thing at the bottom right (which the app called a 'voltage controlled voltage source') should be a buck converter set to ~5.1v
The lamp connected to it is supposed to represent a Pi.
All grounds are connected to the battery cathode.
Image

What I need to know is:
- Is this accurate? I've got everything hooked up right?
- what rated fuse should I use? (relay is 30A and I may end up using more buck converters for additional Pis or USB power ports.)
What sort of capacitor (if any) would do what I want. Would multiple capacitors in parallel work or be better?

I appreciate even links to electrical forums where I coukd/should pose my question.
55:55:44:44:4C
52:4C:52:42:41

Idahowalker
Posts: 445
Joined: Wed Jan 03, 2018 5:43 pm

Re: Powering Pi3b from car battery, need some advice on capacitors.

Tue Jan 23, 2018 3:39 am

Do a search for a 'time delay relay' and use it to power the Pi using proper voltage regulation and so forth. .

When power to the time delay relay coil is cut, that power stoppage could be detected by the Pi and a shut down can be started before the time delay relay times out and cuts Pi power.
Without knowing why you are deleting my postings, I will not know how...

User avatar
davidcoton
Posts: 3952
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Powering Pi3b from car battery, need some advice on capacitors.

Tue Jan 23, 2018 9:00 pm

I'm sorry, I don't know how to put this nicely.
Your circuit is so badly wrong that I can't even begin to correct it.
The idea is in any case flawed. Try to calculate the size of capacitor you would need to run a Pi for the time it takes to shut down. If you don't know how to do that, either learn (basic electrical physics) or don't try projects that rely on that understanding.
I'm glad you understand the need for a fuse. 30A is way over the top. A fully loaded Pi3B running off a buck convertor will draw about 1.1A at 12V.
There are commercial products designed to let a Pi run in a car. Usually they use a supply not taken through then ignition switch (or relays operated from it). They monitor the ignition supply, and use that to start and stop the Pi, with a safe shutdown when the ignition goes off. I can't recommend any particular product because I've not had need to try any.
Signature retired

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

Re: Powering Pi3b from car battery, need some advice on capacitors.

Tue Jan 23, 2018 9:56 pm

I had a feeling it was badly designed, I'm better at actually wiring things than drawing diagrams.
To put it another way; I already have several such circuits in my car for various toys.

Calculating the capacity of the capacitor was half my question, but I'll take your word for it that its impractical.


Time delay relays look to be useful, but at the prices I'm seeing (three figures) they're not even remotely in my budget.


Looks like I'll just manually turn the pi on and off as required before full off on the ignition switch.

Thanks for the replies.
55:55:44:44:4C
52:4C:52:42:41

drgeoff
Posts: 9641
Joined: Wed Jan 25, 2012 6:39 pm

Re: Powering Pi3b from car battery, need some advice on capacitors.

Tue Jan 23, 2018 11:53 pm

Even if a capacitor could keep the RPi powered for long enough, the circuit as drawn doesn't even try to do that. The capacitor is in series to the supply to the dc-dc converter. :(

With a low coil-current relay a suitably configured circuit might be practical, especially if a transistor is added to multiply the effective capacitance. (The capacitor powering the relay coil - not the RPi.)

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

Re: Powering Pi3b from car battery, need some advice on capacitors.

Wed Jan 24, 2018 6:11 am

drgeoff wrote:
Tue Jan 23, 2018 11:53 pm
Even if a capacitor could keep the RPi powered for long enough, the circuit as drawn doesn't even try to do that. The capacitor is in series to the supply to the dc-dc converter. :(

With a low coil-current relay a suitably configured circuit might be practical, especially if a transistor is added to multiply the effective capacitance. (The capacitor powering the relay coil - not the RPi.)
I think we can all agree I can't draw circuit diagrams xD


But your post seems to point out a very simple solution: don't power the Pi with capacitors, power the electromagnetic relay with capacitors.
Since the relay feeds power as long as it is on, and since the current draw of the coil is something around 180mA (if I added it up right - don't quote me on that until I recheck my figures), it seems more plausible to keep the relay powered than to keep the Pi powered.

I'll look into this more with the helpful info I've gathered here.
Thanks.
55:55:44:44:4C
52:4C:52:42:41

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: Powering Pi3b from car battery, need some advice on capacitors.

Wed Jan 24, 2018 11:24 am

Hi,
A quick schematics about my idea to power RPI from a car electric system.
Its is a not tested circuity.
Image

Davidgbu
Posts: 1
Joined: Wed Jan 24, 2018 10:53 pm

Re: Powering Pi3b from car battery, need some advice on capacitors.

Wed Jan 24, 2018 11:10 pm

That schematic looks close to working. I assume P3 is a output to hold the relay closed until the Pi is completely shut down. If so it should go high to keep the transistor turned on. Not sure how to program the pi to shut down and keep a output pin high so that may be an issue. I didn’t try to,verify the resisters are correct values to match the transistor gain but they look close. You might just look at increasing the capacitor c1 value to create a time delay to keep the transistor on while the pi shuts down. You can get quite high values now with the newer technologies for capacitors. Take a look at some manufacturers web sites for ideas.

Return to “Beginners”