BUCK REGULATOR
The buck regulator claims to be 96% efficient and to draw about 10mA when idle: https://media.digikey.com/pdf/Data%20Sheets/Seeed%20Technology/313080006_Web.pdf
CIRCUIT
Observations:
- REM is going to be the signal to turn on the TB (Still not thinking in that but since this is a 12v signal from the car, I'm probably going to use an optocoupler to avoid interferences and voltage spikes or at least a voltage divider to not blow the ATtiny85)
- The question mark is what I'm trying to figure out to be able to supply 5V/3A to TB given a signal from the ATtiny85 (optocoupler, BJT, MOSFET, relay, etc)
- One wire from TB to ATtiny85 to signal that it is on (FEEDBACK_PIN)
- One wire from ATtiny85 to TB to signal to shutdown itself (SHUTDOWN_PIN)
Good to know about the back feeding "problem" but so far I'm not going to send any voltage/current to any input on TB when it is off (shutdown signal won't be sent when it is already turned off nor I will connect it to any other sensor in the car).
ATtiny85
The entire point of the ATtiny85 in this project is to behave like this:
REM is ON
- Turn on Tinker Board
- If Tinker Board does not signal that it booted in 15 seconds, cut the device power and try again in 15 seconds
- Keep doing that until the device signals it is on
REM is OFF
- Signal Tinker Board to shut down
- Wait for 15 seconds to the device shut down
- Cut the device power if it didn't go off
In other words, boot failure, keep trying to boot indefinitely.
Device off for more than 15s cut the power off and try to boot again indefinitely.
Shutdown failure, cut the power off after the 15s.
AVOIDING ATTINY85
Relying entirely on the Tinker Board to shutdown itself may fail and flat my car battery in about 1 day.
I keep thinking in the all possible things that may interrupt the shutdown of the device like software updates, required user interaction to allow the shutdown, the software service that is going to watch the signal pin die/fail and things like that.
Also, I can't keep doing hard shutdowns because it may corrupt the file system of the Tinker Board and to remove the device from the car to fix that is going to be a PITA.
But maybe I'm too worried about that and I shouldn't be?
I may think in keeping the TB always powered and turning it on when the REM is on but this is going be a lot weaker.
Think that if I'm driving and the device for whatever reason shuts down, I'm going to need to stop the car, turn the engine off and turn the engine on again, just to reboot the device.
KNOWLEDGE
I don't mind about being asked, no worries, we really need to establish a baseline here.
I have studied analog and digital electronics a few years ago but I don't remember much of that and I'm a software developer these days.
Let say I know what voltage, current, resistance are, what resistors, capacitors, diodes, BJT does and how they work, but not much more than that.
About datasheets, I know what they are and how to read the basics like checking how much voltage/current it supports and how much temperature it supports but not much more than that (like how much heat the component is going to dissipate for a given current).
Bottom line is that I can understand how basic components work but I can't be sure which one is the right one for my problem, they all seem to fit (optocoupler, relays, BJTs, MOSFETs).
OPTIONS
The initial idea was to use something like a MOSFET SparkFun MOSFET Power Control Kit - COM-12959 - SparkFun Electronics or an optocoupler SparkFun Opto-isolator Breakout - BOB-09118 - SparkFun Electronics.
The MOSFET seems to be a overkill since it supports up to 60V/30A and the optocoupler too since it physically isolates the systems and I don't have interference from TB.
The optocoupler seems more appropriated to short two pins of the ATtiny85 physically isolated from the REM signal itself but seems wrong to power feed the Tinker Board.
I'm not sure about relays because we have to consider that the car is moving and the relay may lose contact, how much (de)acceleration they support?
I was expecting to find something very easy to use like a BJT that can handle up to 5V/3A without dissipating heat, I don't know if such thing exists, literally a digital switch.
I think the topic question would be what appropriated options are available for this load being turned on from an ATtiny85/Arduino.
Knowing all the "appropriated" options I think I can research them.