You are viewing an older revision! See the latest version

RHT03

/media/uploads/tristanjph/10167-01.jpg

The RHT03 is a digital humidity and temperature sensor. It is sometimes know as the DHT22. The sensor is available from Sparkfun here.

Wiring the RHT03

The sensor comes in a 4 legged package, but only 3 are required. The pins are numbered 1-4 from left to right when looking at the front of the sensor.

Powering the sensor

The will work on any voltage from 3.3-6v. The datasheet advises putting a 100nF capacitor between VDD and GND for wave filtering, but don't worry if you don't have one of these it will still work!

VDD should be connected onto pin 1 and GND onto pin 4.

Data Line

The sensor uses a MaxDetect 1-wire bus, this is a dual direction digital signal. This can be connected to any of the Digital In/Out ports on the mbed. The digital in/out port of the mbed should be connected to pin 2 on the RHT03. A 1K pull up resistor is also required on the data line.

Wiring Diagram

/media/uploads/tristanjph/rht03_wiring.png

Getting Data from the RHT03

The bus/sensor is a little bit temperamental at times...

All you need to know about getting the data is:

  • You have to wait at least 2 seconds after a power on to get data from the sensor
  • You can only request data from the sensor every 2 seconds
  • You will get a get a couple of check sum errors most times you try to read sensor data

RHT03 Library

Import libraryRHT03

An eddied version of http://mbed.org/users/crazystick/code/DHT22/ for LPC11U24. All printf statements are removed and features requiring the real time clock are removed.

RHT03 Test program

[Repository '/users/tristanjph/code/RHT03_test/docs/4c2df3ab072c/main_8cpp_source.html' not found]

Data sheet: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Weather/RHT03.pdf


All wikipages