Use Mosfet on High side to turn on Arduino?


I am working on a project with a variant of the Arduino DUE - the Macchina M2 specifically. I have this in my Porsche and it runs the gauge cluster with CAN info from the GM LT1 (Gen V 6.2) I have stuffed in the back. Initially I powered the M2 on a switched ignition source. The issue I seem to have is the M2 boots a little slower than the other systems in the vehicle, and when it isn't transmitting on boot up, errors start to pop up on other controllers. So from there, I started to look into other options.

A) Boot the M2 quicker. I don't know much about this, afraid to mess with it to be honest. Not even sure where to start.

B) Connect the M2 to battery directly - Easy for wiring, but I couldn't get the M2 to power down to less than ~50mA in sleep states. Obviously, not a good idea to have a drain that high on an idle battery.

C) Find an an earlier power source - When the door opens, or key is first inserted. Most systems in the car that turn on when the door is opened have a battery supply and use a 12V signal that "wakes" them up. I tapped this signal, but it is not meant to be a power supply... It didn't power the M2 at least. So now this stems to my thread title, my thinking is that I can use this 12V "wake-up" to trigger a MOSFET that powers the M2 from a battery source. Something like my picture below.


EDIT: If you are interested in more on this project in general, I have the M2 side partially documented here:

And the actual car build well documented here:


That could work, but use a P-channel MOSFET to provide power, vs the N-channel you have drawn.

A low on the gate turns P-channel on.
Then an output from the Due could turn on an NPN to hold the gate low until your program decides to release it.
Example part:

This would work if the M2 could run on as little as 8V. There has to be a voltage differential between the mosfet gate and source for it to turn on. With the gate at 12V, current will flow only if the source (which is powering the M2) is at a lower voltage. The datasheet says the threshold GS voltage is 2 to 4V, and that's just when it starts to conduct.

The usual solution is to put the N-channel mosfet in the ground line of the M2. Then the M2 would see the full 12V when the mosfet is on. But that can lead to complications depending on what the M2 is connected to. All of it's pins would float up to 12V if ground is "disconnected" by the mosfet, and connected components might not like that.

Also, when this door-opening 12V line goes back low, the mosfet would shut down, which is probably not what you want.

So you would want the M2 to be powered via two sources in parallel - one directly from the ignition switch power as you have it now, and the other from a P-channel mosfet placed where you have the N-channel in the drawing, but you would need another transistor, an N-channel or an NPN, to invert the logic for the P-channel gate.

However, if the 12V signal line shuts down when the door is closed, but before the ignition is turned on, you would need a latch of some kind, probably provided by a GPIO of the M2. But if the 12V signal also turns on with ignition key insertion, and stays high, then it should be ok, and you wouldn't even need the parallel source from the ignition. Anyway, attached is a drawing.

Ok, thanks, I'll have to do a little reading on these ideas. I'm not familiar with how an NPN works just yet.

The 12V source stays high the whole time the car is on, it triggers when the door opens to turn a few basic systems on - Radio, odometer, etc. It stays high until the car shuts down, and even a short time after that.

It seems there are plenty of solid state relays as well, for DC power. That fits the bill as well I think, is there a reason to avoid that route?

It depends on how much current the solid state relay needs, and whether the 12V signal line can supply that much current without its voltage drooping. The advantage of mosfets is they operate by voltage instead of current, so don’t load down the driving source.

Ah, ok. That makes sense! Thanks for the diagram as well. I think I understand how to wire it up with the N and P channel MOSFETs now.

Looking at the MOSFETS to use, for the P channel: IRF9540 and the N channel an IRF510N should do it. Not much load on either. The M2 can draw somewhere close to 3amps, but with my configuration, it should see over ~150mA.

(UPDATE) I wrote the below thinking you were working with a DUE clone. I since looked up the Macchina M2. I believe the below suggestion is not suitable for you situation.
I only left it here in the event you wished to contact Macchina and see what suggestions they could offer.

Just a different thought ......

Do you have a feeling of how much faster the M2 needs to boot to not have an issue on startup?

You can reduce some boot time on your M2 if you program your M2 with an in circuit programmer (aka ISP) in such a way as to not need the bootloader in the M2.

This will reduce your booting time but you loose the ability to program the board via the serial port, meaning with every M2 change you must use the ISP.

I don't know how much time this will save you but I'd guess it is googleable.

The bootloader is a program that resides in a protected portion of your M2. Its only function is to pause the startup and watch the serial port for incoming code. If code is coming into the serial port the boot loader writes this incoming code to your M2 to become the new operating code.

Without a bootloader, the M2 starts up immediately with your code.

Traditionally, you would pick transistors that are rated "Automotive", which are more rugged thsn normal transistors. But i doubt your M2 is automotive, so maybe that doesn't matter in this case.

The boot idea was my first thought, but that's something I'm not familiar with at all. I have brought the topic up on the macchina forum in my thread, but there hasn't been much activity their unfortunately.

I'm not sure if the M2 is more automotive grade than a normal Arduino, the connectors are the weak link. In my case, it's mounted inside the car, so it doesn't need any temperature/water resistance. I mounted the M2 in a box as well, where I'm hoping to fit the pair of MOSFETs.