0

Sensor AHT20
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Sensor AHT20

by Brncsg on Tue Jul 27, 2021 5:53 pm

I'm trying using sensor AHT20 to read temperature and humidity. I'm using also the deep sleep function of arduino and in the second cycle of wake up the functions aht.begin() return 0 (zero) and also for the following cycles.
Only for the first cycle the function aht.begin return 1.
I have to do something before the deep sleep, or I have to put some delays before the function. Do someone know what I have to do?
Thanks

Brncsg
 
Posts: 1
Joined: Tue Jul 27, 2021 5:47 pm

Re: Sensor AHT20

by mikeysklar on Tue Jul 27, 2021 9:29 pm

Are you using a loop that continuously tries aht.begin as our example code does?

Code: Select all | TOGGLE FULL SIZE
  if (! aht.begin()) {
    Serial.println("Could not find AHT? Check wiring");
    while (1) delay(10);
  }


We also have a 1/2 second delay in the main example loop.

https://learn.adafruit.com/adafruit-aht20/arduino

mikeysklar
 
Posts: 5544
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.