controlling the power consumption of the temp and soil sensor,using a mosfet.

hi . i am using an atmega328p with with a capacitive soil sensor link and temp sonsor ds18b20 link .

i wanted to lower the power consumption . so i was thinking of using a logic level mosfet to cut the power to the sensors.

i was thinking of using a n mosfet to cut the connection to the gnd of the sensor , thus stopping the current flow from the sensor.(assuming that there is very less leakage.)

i was thinking of using a p mosfet to cut the connection to the vcc of the sensor , thus stopping the current flow from the sensor.(assuming that there is very less leakage.)

is my approach viable ?

if so which mosfet should i go for ? p or n mosfet and why ?

pictures : low side switching using a n mosfet

high side switching using p mosfet

5mA current draw.
Just try switching VCC with an output pin.
Leo..

Wawa:
5mA current draw.
Just try switching VCC with an output pin.
Leo..

so you are suggeting that we use an arduino pin to provide the power to the cap soil sensor ?

arduino can provide upto 20 mA . but is it safe to do so ? will it damage the sensor or the arduino ?

Yes.
An output pin of an Atmega328 has an absolute max rating of 40mA.
If this sensor can be powered with 5volt and only draws 5mA, then I don't see a problem.
Leo..

ok in this case sensors can be powered using atmel chip . but lets say there are some heavy sensors which draw , for eg 100 mA , then will my approach be correct ?

manveen_singh:
ok in this case sensors can be powered using atmel chip . but lets say there are some heavy sensors which draw , for eg 100 mA , then will my approach be correct ?

Your approach using a P channel FET is the better option.

Switching the GND connection can cause problems, such as the sensor output appearing to be high when it shouldn't be.

However your schematic for the P-Channel FET option is wrong. You need to transpose the source and drain. (look which way the diode on the symbol is pointing)

Ds18b20 draws very little current. There is no need to cut the power, you won't save much by doing it.

JohnLincoln:
Your approach using a P channel FET is the better option.

Switching the GND connection can cause problems, such as the sensor output appearing to be high when it shouldn't be.

I thought so .

So which p mosfet would you recommend for these kind of application ? We want Vth to be very low so that any mcu can open it , as well as Rds on should also be very low such that there is a very low voltage drop across the mosfet.

ideal : Vgs : -1 v , Rds on : 200 mOhm

Any Particular mosfet you have in mind ?

PaulRB:
Ds18b20 draws very little current. There is no need to cut the power, you won't save much by doing it.

Something is better than nothing . we will be saving 1, 0.8 mA

manveen_singh:
we will be saving 1, 0.8 mA

On page 24 of the data sheet it says standby current is typically 750nA. Active current is 1mA. Are you continuously requesting readings? That will keep the device in active mode and prevent it from going into standby mode.

ok i got your point .

Now what about my design for vcc switching for higher current ? which mosfet should i use ?

I would also find that valuable information. I am not expert in p-channel MOSFETs.

I know this: "logic level" is irrelevant for p-channel. With p-channel, the important question is how close to VCC must the gate be to completely switch off the mosfet.

manveen_singh:
Now what about my design for vcc switching for higher current ? which mosfet should i use ?

Depends.
There is a danger that the signal lines have a different potential than the unpowered sensor.
You could still phantom-power the sensor through it's I/O, and maybe damage it.

When the signal lines are always HIGH (e.g. I2C), you would switch ground of the sensor.
When the signal lines are always LOW, you would switch high-side.
You also might have to set the Arduino pins to INPUT before you remove power to the sensor.
Leo..

Wawa:
Depends.
There is a danger that the signal lines have a different potential than the unpowered sensor.
You could still phantom-power the sensor through it's I/O, and maybe damage it.

this might not be a good idea after all.

Wawa:
When the signal lines are always HIGH (e.g. I2C), you would switch ground of the sensor.
When the signal lines are always LOW, you would switch high-side.

yes i got your point here.

any particular mosfet that can do the trick ?

Wawa:
You also might have to set the Arduino pins to INPUT before you remove power to the sensor.

Yes , surely i will do that .
A side question . in above replies you can see that i am plaing to directly power the 2 sensors using gpio os the atmel 328 p .

DO i have to set my pin to INput everytime i have to shut down the power ?

i am plaing to directly power the 2 sensors using gpio os the atmel 328 p .

I though you now understood that this is pointless for ds18b20.

DO i have to set my pin to INput everytime i have to shut down the power ?

You can set it to LOW or INPUT, for the soil moisture sensor. For other types of sensor, the answer may be different.

i meant cap soil sensor there ,not temp ensor , my bad .

temp sensor will be powered by vcc.