1

I have an ATmega328P monitoring room temperature and humidity. It is enough for me to monitor every 8 seconds. In these 8 seconds, I am putting my Atmega to sleep.

Now , I want to know : Does shutting down the DHT11 for these 8 seconds affect the performance of the sensor in any way or is it advisable to keep it running (stand by) for these 8 seconds ?

[Shutting down means connecting the Vcc of the sensor to GND by means of digitalWrite(Sensor_pin,LOW);]

Also , (The below question is applicable only if your answer to the above question is to keep it in Stand-by) :-

I want to modify the above project such that Temp & Humidity is measured as and when only an input button is pressed. In this case too, should I keep the DHT11 running?

Is a running DHT11 sensor more accurate than a instantly powered on DHT11 ?

[And in case you are speculating , yeah,I want to save the 50 micro-amps Standby current of the sensor.(but of course without sacrificing accuracy of the sensor)]

6
  • Have you tried to do a practical test? Start the sensor, do some sample readings? And by the way, have you used a search engine and search for "wake up time"?
    – MatsK
    Commented Jul 27, 2018 at 15:12
  • I searched google.com for "DHT11 wake up time" but got nothing relevant :( Commented Jul 27, 2018 at 15:27
  • I do switch off DS18B20 as you explain it, because they seem to overheat, if powered constantly. If I do switch off my DHT22 betwean readings, the (first) reading fails about 50% (wrong values, reading error), so I keep i powered.
    – moestly
    Commented Jul 27, 2018 at 16:14
  • I googled, "DHT11 wakeup time", found this: forum.arduino.cc/index.php?topic=58531.90
    – MatsK
    Commented Jul 27, 2018 at 18:27
  • 1
    i wouldn't think a room would change that much in 8 seconds, certainly not more than the DHT11's error margin, unless it's some environmental chamber or something; slow that sampling down man...
    – dandavis
    Commented Jul 27, 2018 at 20:41

1 Answer 1

4

At times like this it is useful to refer to the datasheet. You can, in that document, find this paragraph:

4. Power and Pin

DHT11’s power supply is 3-5.5V DC. When power is supplied to the sensor, do not send any instruction to the sensor in within one second in order to pass the unstable status. One capacitor valued 100nF can be added between VDD and GND for power filtering.

So you can see that if you power down the sensor completely you have to wait at least 1 second before you can do anything with it.

With it just in the low power mode it defaults to between readings you can immediately start reading as soon as your ATMega wakes up.

So you have to ask yourself: Does running the ATMega at full power for 1 second consume more or less power than running the DHT11 in low power mode for 8 seconds?

As a rough guestimate - if the ATMega is using 30mA (ballpark figure) for 1 second (that's 30mAs - milliamp-seconds), and the DHT11 uses 50uA for 8 seconds, then you have 0.05*8 = 0.4mAs.

That's 0.4mAs (sleeping) vs 30mAs (powered down). So I'd go for leaving it powered and avoid the one second delay at full power.

Another option that may save more power would be to:

  1. Power off the DHT11
  2. Sleep 8 seconds
  3. Power on the DHT11
  4. Sleep 1 second
  5. Read DHT11
  6. Go to 1

Of course, that means your loop then takes 9 seconds not 8. You could compensate by sleeping for multiple amounts to make 7 seconds:

  1. Sleep 4 seconds
  2. Sleep 2 seconds
  3. Sleep 1 second
  4. Power on the DHT11
  5. Sleep 1 second
  6. Read DHT11
  7. Power off the DHT11
  8. Go to 1

But of course that then makes your sleeping less efficient - so is it really worth it?

2
  • "Is a running DHT11 sensor more accurate than a instantly powered on DHT11?" I tried to mean, is a DHT11 which is running all the time more accurate than instantly (which is being powered on, waited for a second, taken reading and switched off) powered DHT11? Commented Jul 28, 2018 at 5:18
  • 1
    No, it's no more or less accurate. Because you've had to wait for a second anyway before taking a reading it's been "always on" for the past second anyway.
    – Majenko
    Commented Jul 28, 2018 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.