Using Arduino to switch a 5V/3A TinkerBoard

Hi,

I'm creating a head unit for my car using a TinkerBoard (similar to a Raspberry Pi) and I want to use an Arduino, or much more probably an ATtiny85, to switch it on and off.

The reasons behind that are that I don't want to worry about my car battery, pausing the music or things like that when I park.

Bottom line, engine on, tinker board on, engine off, tinker board off.

What I'm doing right now is detecting that the engine is on to turn a pin HIGH (other details don't matter here but you can check the code): https://gist.github.com/sobrinho/9c6bc277d07e95807064df43d5b976b1

Now, what I need is to turn on something (that's my question, what?) that can handle the TinkerBoard load that is 5V/3A.

I know just the very very basics of electronics so I'm kind of lost here.

Should I be looking for a BJT, MOSFET, Optocoupler or what?

Assuming that what I need is a MOSFET, one that is very cheap and widely available in Brazil is that one (in Portuguese but you can see the components in the picture): https://produto.mercadolivre.com.br/MLB-996288430-modulo-mosfet-irf520n-mos-arduino-raspberry-_JM

But those "drivers" always says that they are designed for solenoids, motors and things more "heavy".

Can they be used for a load like a TinkerBoard?

Also, there are always warnings saying that they need a heatsink for more than 1A even saying that they can handle up to 5A.

Am I going to lose too much energy because of the heat for 3A?

And finally, those drivers always (always?) have a voltage drop and since I have 5V and want to keep the same voltage on the "output" side, what are the options?

Note: I have 12v~14v in my car but I'm planning to use a single CPT C240505 that can provide 5V 5A to keep the Arduino/ATtiny85 always on and use the same power line to feed the TinkerBoard (the "logical switch" in practice).

In theory, it can handle the load but I'm okay to change the entire circuit if that's needed because of the voltage drop.

Suggestions?

Thanks!

Well now, according to this article, the sleep current consumption of the board is 50 mA which is about the consumption of an Arduino, albeit a Tiny would use less. If your buck regulator is efficient, the current draw at 12 V would be half that.

Point is, it would be simpler and probably equally efficient to simply tell the board to shut down when you did not want it.

OR:

sobrinho:
Bottom line, engine on, tinker board on, engine off, tinker board off.

Connect it to the ignition or "accessories" circuit.

It's pointless to discuss this without a schematic because you have already stated that you know little or nothing about electronics. If I start talking about "load switching device ratings" or "high side switching"
or "low side switching" of "gate threshold voltage" etc, etc, etc, how far is this discussion going to get , considering that not only is it unlikely (based on what you have said) that you have read the correct datasheet, it is more likely that you don't know what a datasheet is and have never read one.
For example, do you know what "backfeeding " is ?

(having voltage on analog inputs when the microprocessor has no power on it's power pins)

"backfeeding"

This subject comes up because you may or may not be monitoring sensors when the Tinkerboard is
off, thinking that it doesn't matter because it is off' We don't know yet if that's the case, hence the need
for a schematic.

This is not to underestimate your abilities, it is simply to establish an experience baseline.
Try not to be offended by someone on the forum asking you to state your knowledge or experience on this or that, since we cannot discuss anything until we establish what 'language' we need to be speaking.
If you had posted a schematic these questions would not have been necessary.

We need to know that you are even in the right ball park.
Post a photo of a hand drawn schematic of the proposed circuit so we can at least determine if you are even in the "ball park" . An ATTiny 85 can drive a mosfet but we have not established whether it should be high side switching or low side switching or even if a mosfet is the correct device. I would use a small relay
driven by the ATTiny85. Then you wouldn't need a heatsink because the switching "device" would be the relay contact. There are many small 5V relays available. Have you considered using one ?

raschemmel:
I would use a small relay driven by the ATTiny85.

Or simply connect it to the ignition or "accessories" circuit.

I think we need a lot more information before even talking about "solutions".

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:

  1. 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)
  2. 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)
  3. One wire from TB to ATtiny85 to signal that it is on (FEEDBACK_PIN)
  4. 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

  1. Turn on Tinker Board
  2. If Tinker Board does not signal that it booted in 15 seconds, cut the device power and try again in 15 seconds
  3. Keep doing that until the device signals it is on

REM is OFF

  1. Signal Tinker Board to shut down
  2. Wait for 15 seconds to the device shut down
  3. 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.

I need time to read the OP's reply.
After reading OP's reply once my question would be why is a simple relay not sufficient ?
If the relay is a 12V relay, it can turn on when the ignition is turned on using the ignition
or Acc voltage. The TB can be powered via the N.O. relay contacts such that energizing the relay
energizes the TB. De energizing the relay (either via switch or ignition), de-energizes TB. It is not
necessary to have feedback signal from the TB but if you needed one it certainly does not take 15 seconds to boot up an embedded microprocessor. In other words, one small 5V relay to switch the coil
current for a Heavy Duty 12V Relay would allow control of the small relay via ATTiny85 (which can
be in shutdown mode drawing microamps when not needed) and would have the highest reliability and
you would not need to worry about heatsinks or semiconductor failure.

Does anyone know what a "Head unit " is ? (for a car)

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'm not an auto mechanic and maybe I'm reaching here but I though ALL cars used relays. Am I wrong about that ? (not all relays have the same characteristics.
Relay Datasheet Parameters

FYI, see "VIBRATION RESISTANCE".

I think the topic question would be what appropriated options are available for this load being turned on from an ATtiny85/Arduino.

Maybe if I knew what the load was (what a "head unit "is) it would be easier to discuss.

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.

But have you met Mr. Ohm ?

In the meantime, FYI, here is the OP's circuit posted using the normal
forum procedure:

  1. copied OP's photo from his dropbox and saved as a .jpeg file.
  2. opened with Paint and saved as .jpf file
  3. Used "Attachments" link in bottom left corner to upload photo and clicked SAVE.
  4. Then Used "More ..." drop down menu to select "Modify"
  5. Right clicked on saved photo attachment and scrolled down to "Copy link address"
  6. Clicked on Image toolbar icon and pasted link address into image bar and clicked SAVE.

(yeah, I know, you're thinking "And that's supposed to be faster ?" It is once you've done it a few times and doesn't require dropbox and more importantly, allows one to look at the circuit WHILE reading the post, which I find to make it worth the effort...

RELAY

I'm totally fine with using a relay that can be driven by the ATtiny85 and supports the vibration and shock of the car.

I was just wondering what can be used instead since relays in cars are a bit problematic because they even have a right position (orientation) to be mounted to avoid troubles with (de)acceleration/speed bumpers/turns/etc (the vibration and shock, itself).

LOAD

The load I was referring to is the Tinker Board itself, 5V/3A.

Sorry about not making that entirely clear before.

FEEDBACK

The feedback signal is an important part of the system that will make me sure that the device has booted, that is different from "turned on".

This is going to take some time since the Tinker Board is going to run an Android system.

Also, this feedback signal will be used to reboot the Tinker Board if it shuts down and does not recover for whatever reason (maybe a reboot failure, for instance).

HEAD UNIT

I think we have some confusion here, a head unit is an infotainment system: Automotive head unit - Wikipedia

My head unit is going to be this entire device (buck regulator + attiny85 + tinker board + touch screen + USB GPS).

So, what I'm going to turn on and off is just the Tinker Board, the attiny85 will be kept always energized.

The head unit is this "entire system".

IMAGE

I will keep in mind to attach the image here in the next time, thanks!

READY

I found this product 3A Car Supply / Switch – Mausberry Circuits that is almost what I'm developing but the price is extremely high for Brazil (our currency does not worth a lot).

I can't see what component they are using but you can see there is no relay in that circuit.

I can't see what component they are using but you can see there is no relay in that circuit.

I believe the black module on the reverse side of the pcb is the switching device. It is impossible to tell if
it is a relay or an IGBT or Mosfet based device. The reverse side might be the heatsink for the two power
devices seen underneath the clipon heatsinks.

It is possible to have a DC solid state relay in the same form factor as the black module seen in the photo,
as evident from this photo:
DC solid state relay

Here's the datasheet

As you can see ,As you can see from the Pin Function Names, "DC LOAD +""DC LOAD -"

DO NOT mean that you connect the LOAD + to "DC LOAD+" AND LOAD- to "DC LOAD-" !

In fact , if means the exact opposite , and in addition, means that ONLY ONE
of the two pins (pin1 OR pin2) connect to the LOAD. If you look at the datasheet, there are TWO
LOADS shown. This is simply their way of indicating that it can be a High Side Switch OR a Low
Side Switch. "Position A" shows the ANODE of the flyback diode connected to Pin1, and the LOAD

  • connected to the power supply DC+ source. THIS is a LOW SIDE SWITCH .
    Position B shows the CATHODE of the flyback diode connected to Pin2 and the LOAD - connected to
    the power supply DC RETURN (or -). THIS is a HIGH SIDE SWITCH. Normally one would purchase this
    device to control ONE load, but if you have met Mr. Ohm , you know that anything in series shares the SAME current so there is literally no limit to how many LOADS you could switch with only ONE of these devices, just as there is no limit (per se) to the number of light bulbs in series you could switch, because the LOAD is essentially the equivilent of the current limiting resistor for a led. If the it becomes shorted , the led burns out . If the load shorts out due to excessive current in this case the switching device (mosfet) will carry the full load current that the power source can deliver, and you must know a car battery can deliver a lot of current. You could switch "x" loads IN SERIES in POSITION A and "y" loads IN SERIES in POSITION B and if all of them are rated for <= the rating of the device (3A) , there would be no problem because it would likely be less than the maximum load current of a car battery.

I would say by the picture what is under the board is this: https://www.amazon.com/Converter-Regulator-Power-CPT-UL-1-Cable/dp/B07CQWCT8L

It seems to be the same size, same position, same wire colors, and same voltage/current.

"I concur"

("Damn it !, I should have concurred !", Leonardo DiCaprio)

Investigating further seems like a MOSFET is out of the list.

An RFP30N06LE is going to heat up to ~160ºC to drive ~15W, ~70ºC using a good heatsink.

If we consider that is not so uncommon to get ~45ºC inside a car in Brazil, it is probably going to set my car on fire.

Reference: Sizing a heat sink for a heavy load - SparkFun Electronics


I'm going with a relay and see how it goes, thanks for your time!

If interested, I'm going to try this one: Módulo Relé - Atuadores e Relés - RoboCore


Feel free to suggest more options!

Investigating further seems like a MOSFET is out of the list.

An RFP30N06LE is going to heat up to ~160ºC to drive ~15W, ~70ºC using a good heatsink.

12V @3A = 36W

Tinker Board is 5V@3A = 15W :wink:

Tinker Board is 5V@3A = 15W :wink:

"Very good , Grasshopper..."