| Electronics > Projects, Designs, and Technical Stuff |
| Simple car radio battery automatic cut off |
| (1/3) > >> |
| simcop2387:
tl;dr https://github.com/simcop2387/Radio-Power So before all the lockdowns started I put a new fancy android headunit in my car and it works pretty well (there's some small quirks i'm still working on), but I've now learned that there's a tiny issue with it. In standby mode it draws enough power that after 1.5-2 weeks of the car not being started, the battery will be drained. This is apparently somewhat common with android headunits apparently from some searching and the common fix is to rewire the power so that it can't go into standby mode and instead just gets completely de-powered. This is easy, simple and makes sense to do, but it also means that you have a ~60 boot up time each time you start the car. This is completely utterly unacceptable and means that the entire car is now useless and unfit for any purpose. So instead I've started designing a different solution with the following goals: * Monitor the battery voltage to decide when to disconnect power * Turn off power after some large time period, regardless of the battery I'm attempting to do this with an attiny85 (I have many lying around), and using a p-channel mosfet (FQP27P06) and some BS170s to drive it. There's all the kicad files in the repo above and i'm attaching a png to the post too for anyone who doesn't like to leave the forum. I haven't written the code for the controller yet but it'll basically just sleep for a minute or so while holding the mosfet closed and then check the battery voltage (I'm planning on 11.75V as the threshold) when it wakes up. It'll also count down each time it wakes up for something like 4 days or so and then just let it all get powered down. What I'd like is a sanity check that I haven't missed anything critical on the design that's going to bite me. The only potential issue I see is the voltage dividers for detecting if the car is on (the ACC line) and the battery voltage line. I haven't included any clamping diodes since I've chosen then to take 16V to 3.8V on the input, and any higher spikes I'm expecting the internal clamping diodes to handle. I've thought about maybe a small capacitor on them after the divider to just knock anything down even more but I'm not sure that's necessary. There's also gerber files in the repository but I'm not fully done with them yet. I need to pick a proper footprint for the input and output terminals and I'm thinking I'll also redo the layout once more when I finish that. |
| viperidae:
I would start by putting the voltage divider on the switched side, maybe increase the values of the resistors too, with a capacitor to filter out noise. No point burning 2mA if you don't have to. You might also find that having power applied to an io pin when the MCU isn't powered can cause problems. Especially unfiltered, unclamped power during engine cranking. |
| DBecker:
A L7805 isn't the best choice in this application. The quiescent current is much higher than more modern regulators. With a sufficiently robust and efficient regulator you can just leave the ATTiny constantly powered in standby/watchdog mode. Using an automotive high-side switch can simplify the power switch, albeit with a less common component. The resistor divider is not a significant power draw if you increase the resistor values, but you can use a small MOSFET to switch the current flow on only when needed. |
| simcop2387:
--- Quote from: viperidae on April 24, 2020, 08:12:59 pm ---... You might also find that having power applied to an io pin when the MCU isn't powered can cause problems. Especially unfiltered, unclamped power during engine cranking. --- End quote --- This is one bit that I have been a little worried about but I'm honestly not entirely sure what to do about it. I suppose that's a good argument for the capacitor and maybe my own more aggressive clamping diode. I know given the right conditions you can power some of these small uC's over the data pins too. I suppose that using some higher value resistors to limit the current would make that less of an issue too. As would using the switched side instead. I'll update it tonight with those changes then (switched side and cap). |
| simcop2387:
--- Quote from: DBecker on April 24, 2020, 08:39:02 pm ---A L7805 isn't the best choice in this application. The quiescent current is much higher than more modern regulators. With a sufficiently robust and efficient regulator you can just leave the ATTiny constantly powered in standby/watchdog mode. --- End quote --- Any recommendations for something better? I've got some switching stuff but what I do have doesn't really like the 10s of uA range of things really, which is why I decided a cheap linear regulator is probably a better choice. A good bit of the part choice is just what I have lying around. Only thing I don't have handy is the p-channel mosfet, since I wanted something that could handle the theoretical full 10A on the circuit. --- Quote from: DBecker on April 24, 2020, 08:39:02 pm ---Using an automotive high-side switch can simplify the power switch, albeit with a less common component. The resistor divider is not a significant power draw if you increase the resistor values, but you can use a small MOSFET to switch the current flow on only when needed. --- End quote --- What do you mean by automotive high-side switch and how does it differ from a p-channel mosfet like the FQP27P06? |
| Navigation |
| Message Index |
| Next page |