# 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](http://wiki.seeed.cc/Grove-Temperature_and_Humidity_Sensor_Pro/) of this component

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

* [How to install driver](https://docs.labs.mediatek.com/resource/linkit7697-arduino/en/grove-starter-kit)
* [Driver repository](https://github.com/MediaTek-Labs/linkit-7697-peripheral-drivers-for-arduino)

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

### Setup and Execution <a href="#temperatureandhumiditysensorpro-am2302-setupandexecution" id="temperatureandhumiditysensorpro-am2302-setupandexecution"></a>

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:

![](/files/UGXD4eZcyyAntDYTYtw4)

#### Note <a href="#temperatureandhumiditysensorpro-am2302-note" id="temperatureandhumiditysensorpro-am2302-note"></a>

[This library](https://github.com/MediaTek-Labs/linkit-7697-peripheral-drivers-for-arduino/tree/master/Grove_Temperature_And_Humidity_Sensor_AM2302-master) 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:

* the [Seeed DHT library](https://github.com/Seeed-Studio/Grove_Temperature_And_Humidity_Sensor).

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cavedu.gitbook.io/linkit-7697/linkit-7697-development-guide-for-arduino-ide/tutorial/temperature-and-humidity-sensor-pro-am2302.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
