tl;dr
https://github.com/simcop2387/Radio-PowerSo 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.