Powering electronics with 12V in car. Protection? - Page 1
Forum section: electronics / beginners

author: Zippy1970
author_rank: Newbie
timestamp: February 11, 2021, 10:29:20 am
content: I need to power a router and Raspberry Pi of the 12V in a car. What kind of circuitry do I need to protect the electronics? Preferably something I could readily buy. Thanks in advance for your answers.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 11, 2021, 12:33:20 pm
content: Here are engineers are creating, and do not buy.But you need at least a 12V->5V converter, a protective diode, and a fuse.

author: atmfjstc
author_rank: Regular Contributor
timestamp: February 11, 2021, 02:07:54 pm
content: As far as I know, car power is relatively unstable with massive surges and drops possible. While not the best source, Wikipedia summarizes some of the potential problems:QuoteQuoteI fear a simple diode and converter may not be sufficient to account for all these issues.Another very important aspect you should clarify: for how long should the Pi/router be powered? Only for the duration of a trip? Or will they be left on overnight?

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 11, 2021, 02:54:15 pm
content: Practically all of the switching converters allow the input voltage to a very large range.Most often, any chinese step-down is capable of operating from 5 to 30V. It won't be a problem.The diode is needed to protect against incorrect connection of the battery (which happens).When the car is turned off, it will be more reliable to turn off the converter, i.e. to power it from line 15 (check, do not trust me).

author: perieanuo
author_rank: Frequent Contributor
timestamp: February 11, 2021, 03:38:05 pm
content: Quote from: Zippy1970 on February 11, 2021, 10:29:20 amjust a correct calculated fuse, no need to setup a fire

author: The Bootloader
author_rank: Contributor
timestamp: February 11, 2021, 04:35:08 pm
content: It's a bitch if you want to do it properly. On a 12V vehicle you are supposed to be able to handle spikes of up to 100V.https://www.st.com/en/protection-devices/automotive-load-dump-protection.htmlOne approach I used in the past was to disconnect the device from the vehicle while there was a high voltage spike, instead of trying to dissipate it, because the amount of energy can be significant and it can be an issue for some devices (in term of board space) as you typically need a big fat TVS.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 11, 2021, 09:09:03 pm
content: I would add to this another shutdown when the voltage drops below 6V.Well, of course, everything must be used from the category of "automobile" - as without it.But in which car there are power surges up to 100V in the on-board power?

author: BrokenYugo
author_rank: Super Contributor
timestamp: February 11, 2021, 09:37:05 pm
content: Quote from: S. Petrukhin on February 11, 2021, 09:09:03 pmI'll hazard a guess the starter could cause a spike like that.

author: rstofer
author_rank: Super Contributor
timestamp: February 11, 2021, 09:59:12 pm
content: And yet the auto manufacturers have literally hundreds of electronic gizmos all over the vehicle. Somehow they make it work.Back in '73, I was interested in sports car rallies. So I built a rally computer out of about 100 TTL chips and 6 banks of 4 digits filament style 7 segment displays, dimmable behind red plexiglass for night events. It was a BUNCH of electronics all wire-wrapped. I just used some linear regulators and dropped the 12V (nominal) to 5V without a care in the world. I had decoupling caps on every package and some bulk capacitance here and there and it all worked fine. I guess I didn't know it was going to be a problem.What didn't work fine was starting the computer a couple of hours before the event. The computer would absolutely kill the battery. But once everything was running, all was well. There was a need to sync the computer event clock to WWV and it was best done early before things got exciting so there was a tradeoff. Early clock setting versus car won't start...I built a digital clock for another fellow's car and we did wind up having to add more bulk capacitance.Remember, this was early 74xx logic and wire-wrapped. I suppose it is a surprise that it all worked but it did.Bottom line, I would just try a linear regulator with plenty of bulk capacitance and some 0.1 ufd ceramics around the regulator. I'll bet it works!

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 11, 2021, 10:48:47 pm
content: Quote from: BrokenYugo on February 11, 2021, 09:37:05 pmA good candidate, but it is shunted by a very low-resistance load - the battery.

author: atmfjstc
author_rank: Regular Contributor
timestamp: February 12, 2021, 12:46:58 am
content: Quote from: S. Petrukhin on February 11, 2021, 02:54:15 pmI'm sure plenty of converters can handle stepping down from an unusual voltage if it is reasonably constant, the question is whether they can do so when it is a large transient.Quote from: The Bootloader on February 11, 2021, 04:35:08 pmQuote from: S. Petrukhin on February 11, 2021, 09:09:03 pmWhat complicates the problem is that the device the OP is using, a Raspberry Pi, handles power loss very poorly. I've worked with Raspberry Pi's, including under battery power, for some time, and from time to time accidents have happened resulting in power loss without an orderly shutdown from the OS. In my experience, this resulted in SD card corruption in a shockingly large number of cases (20-30%). And not just incompletely written files, but subtle corruption in seemingly irrelevant files deep in the OS... Often the card gets stuck in read only and can't even be reformatted with regular utilities. A bad time all around.In short, I wouldn't connect a shoddy platform like the Pi to a car's electrics. Better to use a USB power bank capable of at least 2.4A.

author: bdunham7
author_rank: Super Contributor
timestamp: February 12, 2021, 01:28:30 am
content: Quote from: S. Petrukhin on February 11, 2021, 10:48:47 pmThe rare but possible high-voltage scenarios in an automotive system all involve an accidentally disconnected or failed high-impedance battery. With a functional battery properly connected the electrical system would be on fire before it got to 50 volts, let alone 100.

author: gnuarm
author_rank: Super Contributor
timestamp: February 12, 2021, 01:35:03 am
content: Quote from: BrokenYugo on February 11, 2021, 09:37:05 pmThat's what I thought, but it's the alternator. Seems when a load is drawing a heavy current and is suddenly disconnected the alternator does not adapt quickly enough and the voltage surges since the alternator is essentially a constant current device until the regulator adapts.BIGsurges result from turning off heavy loads.

author: gnuarm
author_rank: Super Contributor
timestamp: February 12, 2021, 02:28:57 am
content: Quote from: bdunham7 on February 12, 2021, 01:28:30 amThat's pretty much nonsense. I've designed mil spec mobile gear that has requirements for 100V protection. Why? Because they'veSEENspikes in their vehicles that would challenge protection that was much lower! Starting pushes the low end requirement to 6V in winter.The AC line has spikes and drop outs and most equipment survives and doesn't reboot. I would use an AC inverter and plug in the regular adapters. For the rPi I would use a USB battery pack that can act as a UPS. They are few and far between, but they exist and aren't really any more than the others that can only charge or be used, not at the same time.The router might require something similar, but it will be harder to find. if so, I would use the inverter, then a small UPS and then the wall warts powering the devices. It may not be terribly efficient, but it will work! Make sure your UPS won't overload the inverter. That will be the hard part.Otherwise, if you insist on a home grown UPS-like circuit, I can provide a schematic that includes a buck/boost to charge a SLA battery at 1A and a power source switch that will smoothly switch over on the 12V input being lost. It was designed for a ventilator so it will continue to operate without interruption if someone trips over the power cord. I think that portion of the design can be built for about $20 in parts not counting the PCB. It is in KiCAD and has been laid out but not tested. Not sure how soon we will be testing it. The controller board is far from complete and we seem to be focusing on that at the moment.This could be used with a smaller SLA battery for less power hungry apps. I think it's just one resistor to change for a lower charging current. Hmmm... do you think this is a worthwhile product? Would many people have a use for this? I could rework the design to eliminate the extraneous stuff and add the 5V regulator for a USB output, package it with a small SLA battery and voila, a small 12V/5V UPS!Let me know if you want the schematics. It's all open source.

author: bdunham7
author_rank: Super Contributor
timestamp: February 12, 2021, 03:04:52 am
content: Quote from: gnuarm on February 12, 2021, 02:28:57 amOf course they have. I've seen them too. There are automotive (the domain we're discussing, not mil-spec b/t/w) standards regarding this exact issue. That says nothing about their cause, which is pretty much what I said it was. This is something I've replicated and tested and without a system malfunction or physical damage, I've never seen an alternator that could drive a battery in good condition over 20 volts, presuming that the alternator and battery in question are both properly designed for the vehicle.The bottom line here is that if is not a critical system, which I presume a Raspberry Pi would not be, 35-40 volts of protection--perhaps just a linear regulator--will be quite sufficient.

author: james_s
author_rank: Super Contributor
timestamp: February 12, 2021, 04:54:50 am
content: Modern cars (as in last 30-40 years) have reasonably clean power systems but you still need to deal with spikes, sags, and there are fault conditions that can result in a significant overvoltage. There are lots of regulators designed for automotive use, both linear and switching, I would probably go with a switching regulator since 12V nominal to 5V is a significant drop and a Raspberry Pi and draw a significant load. I would start looking at buck regulators designed for automotive applications and study the datasheets, most will have at least one application note that is probably close enough for what you want to do.

author: ledtester
author_rank: Super Contributor
timestamp: February 12, 2021, 05:16:54 am
content: Quote from: Zippy1970 on February 11, 2021, 10:29:20 amThere are "carputer" power supplies on the market, e.g.:-https://www.amazon.com/M3-ATX-HV-95-Watt-Automotive-Carputer/dp/B005TWE636-https://www.mini-box.com/M4-ATX

author: viperidae
author_rank: Frequent Contributor
timestamp: February 12, 2021, 05:55:08 am
content: What's the worst thing that could happen? A $35 SBC gets fried? I wouldn't spend more than that trying to protect it.You'll probably be fine with a diode followed by a zener/tvs and a reasonable sized capacitor before the buck converter.

author: floobydust
author_rank: Super Contributor
timestamp: February 12, 2021, 05:56:13 am
content: For 5V at around 3-4A in the car I've been using the low cost TPS40057 boards from eBay or Ali. There's also a version with four USB jacks.They have a reverse-diode, external mosfets (synchronous rectification) and running them at their rated 5A... that's way hot.Undervoltage lockout is ~7.5V so it may cut out during cranking.I add a fuse, and massive 6,600W TVS diodeSM8A27specifically automotive rated. No problems with them for over 8 years now.I replace the two electrolytic capacitors with solid polymer because it gets cold up here, and the caps quality is cheapola. If you can fit upsized 680-1,000uF that works well.

author: Zippy1970
author_rank: Newbie
timestamp: February 12, 2021, 02:43:14 pm
content: Thank you all very much for your replies, it's very much appreciated!First of all, I see that my original post was a bit short and lacking information. My apologies for that. The router actually runs on 12V and the rPi on 5V. And actually with car, I meant an electricboatthat runs on 12V lead batteries. That makes it a bit easier since you don't have to filter out the tiny spikes generated by the spark plugs/wires.I've built car electronics before. About 15 years ago I built a digital dashboard for a classic sports car. I remember I had huge problems getting a stable 5V to the PCBs (all 7 of them). I could probably reuse what I made back then but it takes up quite a bit of space. Since I haven't done anything with electronics since, I was wondering if by now standard(ized) modules existed. Which is why I asked for something I could buy instead of having to make it myself.

author: james_s
author_rank: Super Contributor
timestamp: February 12, 2021, 05:03:40 pm
content: Every router I've been inside runs internally on 5V (older) or 3.3V (modern) and uses buck converters to supply these voltages. They are actually quite tolerant of input voltage variations and mostly specify 12V just because it's a very common voltage for off the shelf power bricks. You will almost certainly be fine just connecting the router directly to the 12V supply in your craft, maybe add a TVS and fuse for added insurance if it makes you sleep better at night. In a marine environment moisture and if in the ocean, salt are going to be much bigger issues than electrical spikes.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 12, 2021, 05:19:59 pm
content: My suggestion is, for a non-critical hobby project, forget about load dump, it's actually very, very rare, chances are you and all your friends and their friends combined never encounter one.ECU and ABS controller for example obviously need to deal with load dump. A $40 Raspi running something non-life-critical does not.Any proper quality buck converter module with, say, 35-40V max input voltage and some damping electrolytic capacitance on its input is very likely to survive for years.You can always add parts randomly; sometimes they offer limited help. For example, if you can afford the voltage drop of a series diode, why not - it protects from accidental wrong polarity if nothing else. This doesn't mean it's actually an important protection component.If you want to protect against load dump and have the device operational, really the best way is to just rate the switch mode supply to allows for such high input voltage. You can clamp the highest peak in a TVS + series resistance, of course, but clamping all of it may end up being more expensive than just regulating it down. For example, I have used large through-hole polyfuse, then a TVS with working voltage of 75V, worst case clamping voltage of 100V, capacitors rated at 100V, and the DC/DC regulator IC rated at 100V. At a design stage, this costs a few bucks extra.Properly sized fuse is always a good idea for protecting against fire in case of failure. It does not protect the devices from failing, though. It's there so that if the Raspi or its power supply roasts anyway, then at least the PVC insulation of the wires doesn't start to melt. Semiconductors die (permanently shorting out) in tens of microseconds; things get on fire in tens of seconds; properly sized fuses blow in tens of milliseconds to seconds, only protecting from the latter.

author: Smokey
author_rank: Super Contributor
timestamp: February 14, 2023, 01:33:23 am
content: https://www.eevblog.com/forum/projects/automotive-rated-power-supply-reference-designs/

author: JustMeHere
author_rank: Frequent Contributor
timestamp: February 14, 2023, 01:56:54 am
content: This app note from TI covers this.https://www.ti.com/lit/pdf/snva681

author: BeBuLamar
author_rank: Super Contributor
timestamp: February 14, 2023, 12:40:57 pm
content: Your router is probably 12V so there is no need for anything. Your PI is 5V then you need a buck converter. They are cheap. If it fries your PI and router just buy another. No big deal.