Temperature and Humidity Sensor Pro (AM2302)

The Temperature and Humidity Sensor Pro is an upgraded version to the original Grove temperature and humidity sensor and it has more complete and accurate performance. The detection range of the Sensor Pro is 5% RH to 99% RH, -40°C to 80°C. The accuracy reaches up to 2% RH and 0.5°C. For detailed specifications, visit the official WiKi page of this component

You can see how to download and install the driver by referring to:

After the installation is done, follow the steps below to use this component.

Setup and Execution

  1. Connect the module to the A0 header of the LinkIt 7697 breakout board.

  2. Select the File / Examples / Grove_Temperature_And_Humidity_Sensor-master / DHTtester menu.

  3. Click the Upload icon to compile and upload the sketch file to the board.

  4. Open the serial monitor (with baud rate 9,600) and reset the board to execute the application. You should be able to see the output as below:

Note

This library supports DHT11 / DHT22 (AM2302) / DHT21 (AM2301) sensors. Check the part number of your sensor and select the correct one in the sketch file. For example, if the sensor is DHT22 (AM2302), uncomment the Line 10 before execution.

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11   // DHT 11 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

Reference

If you're using sources from the repositories of module vendors:

Please follow the steps to modify the codes for making it available to the LinkIt 7697:

  1. Open the DHT.h file from the library folder.

  2. Comment out the #error message in line 16 and define the COUNT macro in line 17.

    #elif (F_CPU >= 15400000UL) && (F_CPU <= 19000000L) 
    #define COUNT 6 
    #else 
    //#error "CPU SPEED NOT SUPPORTED" 
    #define COUNT 6 
    #endif
  3. Save the file.

Last updated