Go Down

Topic: Powering sensors with Digital pins instead 5v (Read 161 times) previous topic - next topic

sn4k3

Hello,

I wan't to reduce power consumption at max.
First i removed all LEDs from boards and I have multiple sensors that only work from time a time.
Some of sensors are: MQ-2 Gas, DHT22, Photoresistor, PIR Motion

Working times:
Code: [Select]
#define PHOTORESISTOR_REPEAT_INTERVAL 2000
#define DHT_REPEAT_INTERVAL 300000 // 5 minutes
#define MQ2_REPEAT_INTERVAL 10000
...


They are only used to collect data every x seconds so they dont need to be ON all the time.
As i see some sensors like DHT22 uses 1/1.5mA thats not much but its always something.

So i'm asking if theres any trouble using DOUT pins to source sensors instead 5V (Always ON) and before a measurement send HIGH to switch on the module and after the read send LOW to disable sensor.
Also i know some sensors need some boot up time, maybe the PIR and the DHT??? Anyone have some experience in this workflow?

I plan to use a shift register and use same pin, only 1 measurement per time can occur.

Thanks

Grumpy_Mike

Quote
So i'm asking if theres any trouble using DOUT pins to source sensors instead 5V
Yes there is.
First of all the current, the maximum you should ask a pin to provide is 30mA, at 40mA damage occurs.

Second the voltage drops as the current increases so you do not get the full 5V.

Finally if an output is connected to the sensor in any way then that must be switched to be an input before you remove the power.

Peter_n

#2
Jun 29, 2015, 05:36 pm Last Edit: Jun 29, 2015, 05:37 pm by Peter_n
It can be done for very simple sensors (a LDR, or a NTC, or a diode as temperature sensor). For more complex sensors you might get yourself into trouble.

As far as I know the PIR sensors require very little current.
I don't know about the DTH22, you have to measure that. Don't trust what you read on the internet. Sometimes you can't even trust the datasheet  :smiley-confuse:

Which Arduino board do you use ? The Arduino Uno has a number of components on the board that require current.

The MQ-2 is a gas sensor with a heater. That requires 150mA ?
Then it is no use to turn off a sensor that needs 1mA, if the gas sensor requires 150mA.
It is possible to turn off the heater, but after the heater is turned on, the sensor needs a few minutes settling time before valid data can be read.

Grumpy_Mike

Quote
but after the heater is turned on, the sensor needs a few minutes settling time before valid data can be read.
Well the data sheet says 86400 seconds, or to be more precise it says 24 hours.

sn4k3

Yes there is.
First of all the current, the maximum you should ask a pin to provide is 30mA, at 40mA damage occurs.

Second the voltage drops as the current increases so you do not get the full 5V.

Finally if an output is connected to the sensor in any way then that must be switched to be an input before you remove the power.
Good point.
And if i use a transistor per sensor to drive the 5v directly from power supply and use digital pins to control it?

Code: [Select]
"Finally if an output is connected to the sensor in any way then that must be switched to be an input before you remove the power."

I didn't know about this part, can you explain why and what happen if i don't set it to input before cut power?
But its easy fixed as software rule all :)

Peter_n

#5
Jun 29, 2015, 05:47 pm Last Edit: Jun 29, 2015, 05:49 pm by Peter_n
Well the data sheet says 86400 seconds, or to be more precise it says 24 hours.
Not my datasheet, and not my MQ-2 which I have tested for this  8)
As far as I remember, about 2 minutes was okay, but 5 minutes was better.
The preheat time of 24 hours is needed only once after buying the MQ-2.

sn4k3

It can be done for very simple sensors (a LDR, or a NTC, or a diode as temperature sensor). For more complex sensors you might get yourself into trouble.


As far as I know the PIR sensors require very little current.
I don't know about the DTH22, you have to measure that. Don't trust what you read on the internet. Sometimes you can't even trust the datasheet  :smiley-confuse:

Which Arduino board do you use ? The Arduino Uno has a number of components on the board that require current.
Yes i have only saw the datasheet, i haven't made real measure.
Its sad to know datasheet can provide wrong info :(

I'm using Arduino Nano V3 (Chinesse) with removed LED and direct power feed in 5v pin with a 5v regulated power supply.
As I can build my own arduino with little hardware, the integrated 3.3v port and USB for fast reprogramming is a good thing. Also nano have more ports and is cheaper than build myself.

The MQ-2 is a gas sensor with a heater. That requires 150mA ?
Then it is no use to turn off a sensor that needs 1mA, if the gas sensor requires 150mA.
It is possible to turn off the heater, but after the heater is turned on, the sensor needs a few minutes settling time before valid data can be read.
Well the data sheet says 86400 seconds, or to be more precise it says 24 hours.
WOW 24h to heater setup?? That means 24h for make a good reading?
Or that 24h will only happen once? What if i power off all hardware and switch on again after 1 day? does it still need 24h to preheat?

sn4k3

My current setup, yet unfinished.
If i will have more trouble than benefits i will not disable/enable sensors on the fly


Peter_n

The power consumer is the heater of the MQ-2 sensor.
You can turn off the heater with a transistor or mosfet, but only if you don't need to retrieve samples for a few minutes.

If you really want, you could switch the power to the LDR, but it won't hardly make any difference. I think less than 1% reduce in power.
Some (older) Bluetooth modules also require a lot current.

Grumpy_Mike

Quote
What if i power off all hardware and switch on again after 1 day? does it still need 24h to preheat?
I got it wrong, I looked at the data sheet and it says:-
Quote
When accurately measuring, the proper alarm point for the gas detector should be determined after considering the temperature and humidity influence. The sensitivity adjusting program:
a. Connect the sensor to the application circuit.
b. Turn on the power, keep preheating through electricity over 48 hours.
c. Adjust the load resistance RL until you get a signal value which is respond to a certain
carbon monoxide concentration at the end point of 90 seconds.
d. Adjust the another load resistance RL until you get a signal value which is respond to a CO
concentration at the end point of 60 seconds .
So yes it takes time to stabilise once you turn it off. Not for a low power application then.

sn4k3

I got it wrong, I looked at the data sheet and it says:-So yes it takes time to stabilise once you turn it off. Not for a low power application then.
Thats bad news :(
Any good alternative to the MQ2?

Grumpy_Mike


Go Up