Arduino power management

I am bulding a system that is controlled by an Arduino Nano and consists of an Arducam OV5642, SD card breakout board, and an accelerometer. The accelerometer determines when (4) LEDs are to be powered (by Mosfet), images taken and stored, and accelerometer data stored in a (text) file. The system must be powered by 5V (USB). My question is how to properly wire the assembly so that the arduino controls the system but all accessories have appropriate power.
Thanks for any input!

This page shows an assortment of power supply arrangements. Important is using the Arduino as a microcontroller, sending and receiving control signals, and not as a power supply.

1 Like

Thanks for the pointers but the examples do not include power for the arduino so it can control independent sensors and SD card. I don't see how data processing is possible with these configurations. The Nano needs to be active to control the sensors.

I see. There are four power input choices. USB, RCA connector, Vin and 5v pin. These pages from Arduino should help clarify how to use them.

https://docs.arduino.cc/learn/electronics/power-pins/

And an external link to help... (5 ways!)

As long as you have a common ground, the "data" connections will work with separate power supplies.

The 5V output should be OK for everything (with USB power) unless you are driving "high power" LEDs.

If you are using MOSFETs, that sort-of implies "high-power" LEDs and those usually need a special constant-current driver. And USB power MIGHT not be enough voltage and/or current.

Perhaps the wiring diagram will better explain what I intend (need!) to do. The Mosfet requires some (5) V to power up the rest of the circuit.
MWire

Hi, @Gravity123
Just an edit to your circuit, feed the 5V USB into the 5Vpin.
Vin pin is the input to the onboard 5V regulator and needs at least 7V.
poweredit

Look closely at the MOSFET circuit for the SD card and OV5642
You will need a P-CH MOSFET and it will be connected differently.
Also powering down the OV5642 will mean you may have to send initialising code to it, each time it is powered up.

Tom. :smiley: :+1: :coffee: :australia:

Thank you TomGeorge,
You actually answered a question I haven't asked yet - whether one has to initialize the OV5642 every time - Kudos! Is the same true for the SD card? Why do I need a P-Mosfet? I tested the N-Mosfet and it works well if the proper voltage can be supplied.

Can you turn the N-Mosfet OFF?

It is not turned off but will not provide power. That's the functionality I want.

I looked at the circuit again and I see that the SD player is on the S of the N-Mosfet. If that mosfet has a Vgs of say 3 Volts and you want 5 Volts on the SD player, then the gate has to be at 8 Volts, but it cannot go above 5 Volts. That is a problem that can be solved by using a P-Mosfet connected correctly as has already been suggested.

1 Like

Hi,

Probably.

Describe how it works when you drive output A0 HIGH and drive it LOW?

Do you have a DMM? (Digital MultiMeter)

Exactly..

Tom.. :smiley: :+1: :coffee: :australia:
PS. Why do you need to turn SD and camera off?

@herbschwartz and @TomGeorge,
I do have a DMM. The reason for not using the SG and OV5642 and LEDs is to avoid heat build-up while the accelerometer needs to be able to run (and eventually trigger SD, OV, and LEDs (total LED current ~100 mA).
Testing with the n-Mosfet consisted of applying 5V to gate. Removing the lead turns the LEDs off.

Which mosfet model is it?
Measure the voltage in the source lead of the mosfet when it is on, so when you apply 5V to the gate. And also when it's off.

It should be either 5V, like in drain, or zero when is off, to work as a switch. But for that, the n-channel mosfet should be between the devices GND and the circuit GND, in the low side.

Where, on the Nano, are you connecting the 5V supply? If connecting to the USB socket, there is an anti reverse polarity diode in series that will drop 0.3 ~ 0.4V, the Nano's Vcc will be about 4.7V, not 5V.

@stonemk , the MOSFET is https://www.sparkfun.com/datasheets/Components/General/RFP30N06LE.pdf.
@JCA34F - see diagram in earlier posts.

Ok, the mosfet is fine. But I think that your circuit only partially works and can produce problems.

In the mosfet you have 5V in drain, but in source probably you have something between 5V and zero, otherwise it wouldn't be on. So you have a voltage drop across the mosfet => power wasted => heat. And you loose some voltage, so in the VCC pin of the modules you will have less than 5V. Could you measure it with the multimeter? And the voltage drop accros the mosfet?

If I understand you right, for a N-channel mosfet the circuit should be something like this (not tested).

The mosfet is in the low side, switching the path to GND.

When you apply 5V to the gate, the mosfet will be fully conducting (Vgs=5V), almost no voltage drop across it. And when you apply 0V to the gate it will be off (Vgs=0), no current accross it. Like a switch.
If you want it in the high side, then you would need a P-channel mosfet.

Besides that, I think that you don't need to cut the power to the OV5642 and the MicroSD mudules. When they are not working the power consumption is very low, it will be not a problem to keep them powered. And you avoid the initialization problems and other issues.
You can use the mosfet to manage the LED's only.

Thank you for the thorough response. I followed your advice and separated the Camera and MicroSD from the Mosfet. Only testing the Mosfet with 5.1 V applied at S resulted in 0 V across GS and 2.7V DS. With 5V applied to G (i.e., LEDs on) there are 1.91V between GS and 0.7mV DG. I will rewire the system acording to your sketch and report back.

Have you checked on the heat build up?
Experimented and come to a conclusion?

Tom.. :smiley: :+1: :coffee: :australia:

Then, if I understand it right, when the mosfet is on you have at gate: 5V, at drain almost 5V and at source: 5 - 1.91=3.09V. So the voltage drop between drain and source is almost 2V, right?

When the mosfet works as a switch, the current flows from drain to source (red arrow):
image

When it is on it's like a open pipe: the current flows easily. So, the resistance between drain and source should be close to zero, and therefor the voltage drop almost zero.

When the mosfet is off, the resistance between drain and source is very high, the pipe is closed and the current is completely interrupted.

So, when the mosfet is on and working properly, the voltage drop is close to zero and also the resistance. So the power dissipated (wasted) in the mosfet is very low, and also the heating.

But in your case you have a voltage drop of 2V between drain and source.

Let's imagine that the devices powered by the mosfet are consuming 500mA during some time: then across the mosfet you have 500mA flowing.
So the power wasted in the mosfet will be:
P = V * I = 2V * 0.5A = 1W
And it will be dissipated as heat in the mosfet.

Why do you have a voltage drop of 2V? Because the voltage in the gate (Vgs) should be 5V above source. But as source is not GND, Vgs is far below 5V and the mosfet is only partially conducting.

3V at source is enough to light the leds, but you are wasting power. That's why it's better to put the mosfet in the low side, with source connected to GND.