#define PHOTORESISTOR_REPEAT_INTERVAL 2000#define DHT_REPEAT_INTERVAL 300000 // 5 minutes#define MQ2_REPEAT_INTERVAL 10000...
So i'm asking if theres any trouble using DOUT pins to source sensors instead 5V
but after the heater is turned on, the sensor needs a few minutes settling time before valid data can be read.
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.
"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."
Well the data sheet says 86400 seconds, or to be more precise it says 24 hours.
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 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.
What if i power off all hardware and switch on again after 1 day? does it still need 24h to preheat?
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 certaincarbon 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 COconcentration at the end point of 60 seconds .
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.