Iduino ST1173 User guide

IDUINO for maker’s life
User Manual
For
AM2302 DHT22 temperature and
humidity Sensor(ST1173)
www.openplatform.cc
IDUINO for maker’s life
Pin
Description
Vcc
Power supply 5V/DC
Gnd
Ground
DAT
Digital signal pin
Description:
AM2302 digital temperature and humidity module is a digital output signal containing a calibrated temperature and humidity combined sensor. It uses a dedicated digital modules capture technology and the temperature and humidity sensor technology to ensure that products with high reliability and excellent long-term stability. Sensor includes a capacitive humidity sensing element and a high-precision temperature measurement devices, and with a high-performance 8-bit microcontroller connected. Therefore, the product has excellent quality, fast response, anti-interference ability, high cost and other advantages. Ultra-small size, low power consumption, signal transmission distance up to 20 meters. Making it the best choice
for all kinds of applications and even the most demanding applications.
Specification
Dimension: 40 x 23mm Weight: 4g Voltage: 5V Port: digital two-way single bus Temperature range: -40-80 °C ± 0.5 °C Humidity: 20-90% RH ± 2% RH Platform: Arduino, SCM Need library: Adafruit DHT library
Pinout:
www.openplatform.cc
IDUINO for maker’s life
Example:
Wire connection as below:
Vcc------------5V
Gnd------------Gnd
DAT-------------D2
***********Code Begin**********
#include "DHT.h" #define DHTPIN 2 #define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE);
void setup() { Serial.begin(9600); Serial.println("DHTxx test!");
dht.begin(); }
void loop() { // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) float h = dht.readHumidity(); float t = dht.readTemperature();
// check if returns are valid, if they are NaN (not a number) then something went wrong! if (isnan(t) || isnan(h)) { Serial.println("Failed to read from DHT"); } else { Serial.print("Humidity: "); Serial.print(h); Serial.print(" %\t"); Serial.print("Temperature: "); Serial.print(t); Serial.println(" *C"); } }
***********Code End**********
www.openplatform.cc
IDUINO for maker’s life
Library download:
https://github.com/adafruit/DHT-sensor-library
https://github.com/adafruit/Adafruit_Sensor
Reference:
https://learn.adafruit.com/dht
www.openplatform.cc
Loading...