Home | Product Categories | Temperature | SEN-10167

Humidity and Temperature Sensor - RHT03

sku: SEN-10167 RoHS Compliant

Description: The RHT-22 is a low cost humidity and temperature sensor with a single wire digital interface. The sensor is calibrated and doesn't require extra components so you can get right to measuring relative humidity and temperature.

Features:

  • 3.3-6V Input
  • 1-1.5mA measuring current
  • 40-50 uA standby current
  • Humidity from 0-100% RH
  • -40 - 80 degrees C temperature range
  • +-2% RH accuracy
  • +-0.5 degrees C

Documents:

Pricing

In stock

9.95
8.96
7.96

1,077 in stock

price
10-99
100+



Add to Wish List


Comments 77 comments

  • Awesome data sheet!!
    Now I know how to use it…

    • If you want to download better datasheet, please click this website to download
      http://www.humiditycn.com/fl1_1.html
      I have optimized the datasheet. The model RHT03 and DHT22 are for one same product.
      By the way, please buy from Sparkfun.

  • Nice sensor. I’ve been using it to monitor
    a greenhouse for about two months. The wet
    environment doesn’t seem to have harmed it.
    Temperature is accurate, and humidity seems
    about right – I think I believe this more
    than I do the other humidity sensors in
    there. I’ll be buying more.

    • How did you mount the sensor? I am planning on buying / using it, but am trying to figure out how I am going to protect my arduino from the elements while letting this device retrieve accurate readings (which I don’t think would be possible from inside a waterproof otterbox case.

  • I was using NetHoncho’s library, and was getting only maybe one out of ten readings correct. The rest were sync timeout errors.
    I modified his library to retry up to 70 times instead of 35 times, and that did the trick. Look for this line in his lib:
    if (retryCount > 35) //(Spec is 50 us, 352 == 70 us)
    — and change it to this —
    if (retryCount > 70) //(Spec is 50 us, 35
    2 == 70 us)
    Thanks for the lib NetHoncho! Works great now.

  • Is the interface compatible with 1-wire interface? The data sheet discusses the 1 data line, but it isn’t clear that it is 1-wire as defined by Maxim/Dallas. Does anyone know?

    • Based on the example code (which is almost as hilarious as the datasheet), this part is NOT compatible with the Maxim 1-wire interface. Plus it’s not an addressable device, so it can’t share the 1-wire communication line with other devices either.

      • It’s not the Maxim protocol, just a single wire interface. I’m changing the description to be more clear.

  • Is this item currently in stock?

  • when do you expect these units to be in stock?

    • They are on order, but shipping is slow. That’s the best I can say right now as shipping isn’t reliable in terms of time frame. But they are on order.

  • Do you think these could be used outside?

    • Yes, DHT22 could be used outside. But it needs a cover to protect it from rain & exposure to sunshine.

  • The first time I saw it, I thought it was a pico breadboard with just 3 rows of 5 holes (and some mysterious slots)!

  • It’s going to take a while to dig through there… from the datasheet:

    “DHT22 send out higher data bit firstly!”

    • If you want to download better datasheet, please click this website to download
      http://www.humiditycn.com/fl1_1.html
      I have optimized the datasheet. The model RHT03 and DHT22 are for one same product.
      By the way, please buy from Sparkfun.

  • Is there any ETA on this item?

  • I created an Arduino library for the DHT22 http://goo.gl/uy1fV

    • Version 0.4 has been uploaded. This version verifies the checksum.
      Now the project has a home at Git Hub
      http://github.com/nethoncho/Arduino-DHT22

    • NetHoncho:

      I created an Arduino library for the DHT22 http://goo.gl/uy1fV
      This library works great. As others have said, this is not a “one-wire” addressable device. It has its own single wire communication. This library worked perfect for me. Just don’t forget your 4.7K resistor from Vcc to data.

      • I have a AM2301 which is pretty much the same thing and was trying forever to get it to work by modifying the DHT11 code but was still have issues with the timing. Tried out your library and worked without a hitch.

  • Hmm… When did this come in?

  • I made some code and have been polling this with my ARMmite at 1 s intervals (using C, not BASIC). But while at first it seemed to work correctly, now it is returning 0 as the checksum (still giving numbers that seem correct for the Humidity and Temp though)…. Odd.

  • This fits in this, yes?

    • The pins are .1" spacing. The data sheet is a bit misleading on this.
      Also the pins are flat (not square) and do not make good contact in a standard female header (very loose).

      • Ouch! A bit worse than misleading if you design a circuit board to the data sheet (says 2mm instead of 2.54mm or 0.1").
        Thomas Liu – if you read this, can you fix the data sheet?

      • I have modified the spacing to 2.54mm in the datasheet, our engineer overlook this detail, thanks.
        Customers can download new datasheet at
        http://www.humiditycn.com/fl1_1.html
        Regarding the pins, DHT22(RHT03) is designed to be soldered on circuit board, so the pins are flat. Connection with female header was not under considered when our engineer designed DHT22(RHT03).
        So we can’t change the pins now.

  • PICAXE 18M2 – Has anyone interfaced this sensor to this, who can give me a leg up as to how to do the communications code please? Pity its not Ascii or something more standard

    • Why not use C51 or AVR microcomputer to collect signal from DHT22, it’s more simple.

  • Hey,
    How does this compare to Sensiron’s offerings? I have a SHT21 and a DHT22 on my desk connected to a PIC.
    The temperatures are within a degree of each other, but the RH is ~30% out (SHT reads 34%, DHT reads 65%).
    Obviously there is a price difference between the two but both claim to be calibrated etc.
    Neither has undergone recent soldering, so I would have thought the humidity sensor has settled.
    Any ideas?
    Steaky

  • Could I read the output from this sensor with just an XBee, without connecting an Arduino or microcontroller?

    • I’ve never played w/ an XBee, but from what I understand about them they basically just replicate the state 2 pins on the far end. If that is a correct understanding, then yes, you could read a remote DHT22 using an XBee.
      It might be tricky since I think the XBee is more focused on serial communication and the DHT22 doesn’t exactly work that way, but I think it might be doable.

  • Can I place multiple DHT22s on the same wire and address them individually?
    I know Maxim can handle this and I’d like to minimize the pins used for this on my Arduino as I’d like to put as many as 10 on my system, but I don’t see where it states this capability for this version of 1-wire.

    • As the units do not appear to have individual serial numbers or addresses (like Maxim 1-wire devices) you can’t do it without some trickery.
      I can think of a way to do it, however, with a minimum of 3 pins, off the top of my head.
      That would be a 2-wire serial-in, parallel-out shift register circuit (to provide multiple control lines) plus one input pin on the MCU to read the DHT22’s responses.

  • Can anyone help me?
    I have try to follow the connection on data sheet.
    But the Data pin always high.
    What can I do for testing? Thank You.

  • Thanks to NetHoncho for the library and code – a great help. Have hooked the sensor up as suggested but just get this error: “Requesting data… ACK time out”. Does anyone have any ideas how to overcome this?
    Cheers;
    Dave

    • A few things I did to get mine up and running with NetHoncho’s library:
      1. Make sure my ground bus was indeed grounded (oops)
      2. Remove the 4.7k resistor between Vcc and ground (not needed)
      3. Make sure I had Vcc hooked up to 5V rather than 3.3V, @ 3.3V I get the ACK time out.
      Hope this helps and thanks to NetHoncho for making a great library!

  • I wonder if this can be adapted to the Peet Bros weather stations?

  • Thanks, Babcoccl, all good now – had a bad 5v connection. Accuracy within 0.5 degree C; pretty good for $10.
    Cheers; Dave

  • I just found the same thing to be true that the RHT03 version does not work for 3.3V. They do work for the 5V..
    I am going to contact sparkfun tec support and see if they have the DTH22 version hanging around so I can complete my project 3.3v.
    By the way did some testing and the DTH22 reports back at 3.1 volts just not sure how accurate didn’t have anything handy to check the temp or humidity against.

  • To add one more final thing I found that the RHT03 does seem to work at 3.46 volts, Close to the upper end of where my 3.3 volt LCD is not going to be happy. I hope they fix this issue and get the sensor back to what the DHT22 was doing.
    Glenn

  • Don’t bother trying to run the RHT03 at less than 5 volts.
    It doesn’t report the humididty correct at the 3.46 I said it was giving me values at..
    Glenn

  • It does’t exsit RHT03 or DHT22 version. RHT03 and DHT22 are two different names for one same product.
    We have three names for this product, the names are RHT03 DHT22 AM2302. So, be noted that you are using the same product.
    I have asked our engineer to recheck if RHT03/DHTT22 could work under 3.3V DC this morning, the answer is RHT03/DHT22 could work properly under power supply of 3.3V DC.
    I think you have to check if the power supply at RHT03’s power pin is >=3.3V DC.

  • It does’t exsit RHT03 or DHT22 version. RHT03 and DHT22 are two different names for one same product.
    We have three names for this product, the names are RHT03 DHT22 AM2302. So, be noted that you are using the same product.
    I have asked our engineer to recheck if RHT03/DHTT22 could work under 3.3V DC this morning, the answer is RHT03/DHT22 could work properly under power supply of 3.3V DC.
    I think you have to check if the power supply at RHT03’s power pin is >=3.3V DC.

  • Thomas
    I understand what you are saying that they should be one and the same but they are not. The ones I am calling DHT22 were bought from sparkfun at the first of the year and match the picture above and will run at 3.18 volts(battery was getting low) and report correctly.
    The one I am calling RHT03 has that with the MaxDetect logo on the bottom of it and were bought in July from sparkfun. It will not run at 3.31 or 3.46 volts correctly, measured at the vcc pin for the sensor.
    I checked voltage using an ideal 61-361 meter.
    I even reset up the original bread board that I had, and used sparkfun’s FTDI break out board for power. the 5 volt version the RHT03 and DHT22 works, for the 3.3 volt version only the DHT22 work. I then hooked up a lipo for power putting it through a N4001 diode the voltage was 3.46 and the temp was right but the humidity was a little over double on the RHT03 the DHT22 reported correctly. I am using a ATMEL ATMega328P with ardiuno boot loader on some PCB I had made and the bread boards using Ben Adams version 4 DHT22 library.
    The Temp and Humidity values are checked against a sensiron SHT15 on another bread board using a arduino boot loaded Atmega32p with the sensiron SHT15 library.
    I have 3 more PCB boards that I need to populate and run at 3.3 volts so I am looking for some DHT22, I am going to use the RHT03 that I have for some green house controls I am going to make but they will be run at 5 volts so wont be an issue.
    Plain and simple I can’t get the last shipment to run at the same voltage the original ones I bought run at using the same set up…

  • I was never able to get the sensor that I had running at 3.3v but Thomas sent me photos of the RHT03 running at 3.3v, I will assume it is something with the batch.
    I will use the two I have up for a 5v project and wait for the a new batch to arrive and try the new batch at 3.3v. Looks like Sparkfun only has one left at the moment so shouldn’t be too long

    • I got my sensor just a few days ago. It was marked in enclosure as RHT03.
      It was not working until I decided to open it up and I found that the pin nr 4 is the unconnected and the nr 3 is the GND!! I was following this guide: http://www.ladyada.net/learn/sensors/dht.html
      The sensor works with 3.3V for me, as you can see on the pictures. One picture shows the connection of only pins 1(3.3V) , 2(Data) and 3(GND). Other picture shows the data line on oscilloscope and the bits “produced” by the sensor :–)
      It’s bad the incomplete documentation of Chinese sensors/components :–( — I am now an unhappy SparkFun costumer because I took a lot of time to get the sensor working and now I have an “incomplete” sensor because I had to cut off and remove the plastic enclosure.
      http://www.flickr.com/photos/43558168@N00/6134478453/sizes/l/in/photostream/
      http://www.flickr.com/photos/43558168@N00/6134478765/sizes/l/in/photostream/

      • Thanks for the heads up. I thinking the production side of things might be a bit rough. The sensors I have do work at 5V with pin 4 being ground. I spent about 8 hrs trying all the suggestions and anything else I read about to get those two to work at 3.3v no luck at anything less than 3.9 volts for the humidity to report correctly. Temp worked above 3.42 volts.
        I am going to order a few more. This package is perfect for what I am doing and I like the price to.

        • I contacted Sparkun and asked for a new sensor, since I almost destroyed the other to discover the problem of exchanged pins — they just sent me a new one as I expected.
          Hmmm, the true is that I didn’t yet verified the temperature and humidity against another calibrated sensor/monitor… I think I am getting high values of humidity and that they are incorrect — I will verify and if so, then I will move to 5V as you say! thanks ;–)

          • Got the new shipment of RHT03 and I got them to work fine on 3.3 volts.
            I had ordered 3 ea.
            I unplugged the original RHT03(from above) then plugged in the new. it worked.
            so plugged in the second it did not.
            So reading your GND issue above i connected both pin 3 and 4 to GND and it worked.
            Plugged the original back in with pin 3 and 4 connect to GND and it worked.
            Problem solved at least for me.
            So to recap at 5 volts the device works with pin 4 to GND at 3.3volts the device works with pin 3 and 4 hooked to GND.
            I wont even pretend to know why.
            Thanks
            Glenn

            • I have now 2 units of RHT03 which I am running at 3.3V (GND at pin 3).
              I am using a fluke multimeter and another one from unknown brand, to verify the temperature readings by the RHT03. On both two RHT03 I have, I read more 2,4ÂșC from value reading on multimeters!! — I am not happy with RHT03 sensor :–(

  • double post deleted

  • I’m having a fair amount of problems with this product.
    I’m using this library:
    http://arduino.cc/playground/Main/DHTLib
    And I’m trying to pull the information from the DHT22, and send it to a Pachube feed, once a minute.
    I split up the calls for the current temperature and humidity. Each request is 30 seconds apart. However, I’m still getting a rate of around 45% checksum errors. I’m also occasionally getting spurious temperatures in the 55f(12c) range. My lab is pretty steady around 74-79f.
    I’ve only had the chip for a week (today), and I’d really like to get this project completed (I’ve already gotten a couple requests for new unit builds). Am I asking too much of the sensor? Does anyone know of a method for reducing errors?
    I’m using a resistor on the dataline, as specified. I put in a filtering cap, but didn’t see any improvement with the error rate.

    • I ported the code above to be used with a PICs. I have found that the timings provided in the original code is not quite right.
      If you have access to a logic probe/analyzer, take a look at the data line, I find that the values provided in DHTLib over shoot (over sleep) the first bit of the humidity data, causing every other byte to be off by one bit. Make your mcu print out the binary values of the 5 bytes captured from the RHT03. I use this method in conjunction with a probe to help determine what is going on.
      When I get home later tonight, I will post a sequence of events and delays that have to happen to successfully read the RHT22 every time. I use the same sequence to read a DHT22, DHT11 and the RHT03 available here.

      • Here is what I use to read a DHT22, DHT11, and RHT03, 99% accuracy.

        RHT03_PIN - set 1 for high (5v), 0 for low (0v)  
        RHT03_PIN_DIR - set 1 for input, 0 for output  
        

        The above is the initial state used before and after gathering data from RHT03
        =Pseudo code=

        Init:  
        RHT03_PIN = 1; # Set output high  
        RHT03_PIN_DIR = 0; # Set direction to output  
        Start:  
        RHT03_PIN = 0; # Set output low  
        delay_ms(18); # Delay for 18 milliseconds  
        RHT03_PIN = 1; # Set output high  
        delay_us(40); # Delay for 40 microseconds  
        RHT03_PIN_DIR = 1; # Set direction to input  
        delay_us(40); # Delay for 40 microseconds
        
      • # At this point the MCU has sent the handshake  
        # and now we wait for the RHT03 to respond  
        # The RHT03 will need to pull the line low (0v)  
        if (RHT03_PIN == 1) {  
            # Something went wrong, the pin should be 0  
        }  
        delay_us(80); # Delay for 80 microseconds  
        if (RHT03_PIN == 0) {  
            # Something went wrong, the pin should be 1  
        }  
        # At this point the RHT03 is ready to  
        # transmit the data 5 bytes, one bit at a time  
        # Byte 1+2 = humidity (e.g. 45.0 %)  
        # Byte 3+4 = temperature (e.g. 24.3 Celsius)  
        # Byte 5 = check-sum (byte 1+2+3+4)  
        for (i = 0; i < 5; i++) {  
            for (j = 0; j < 8; j++) {  
                # While the RHT03 pin is low, wait  
                while(RHT03_PIN == 0) {}  
                # We now wait for 40 microseconds  
                delay_us(40);  
                if (RHT03_PIN == 1) {  
                    # The bit value is a 1  
                } else {  
                    # The bit value is a 0  
                }
        
      •         # Now we wait until RHT03_PIN goes low  
                # Note: If count < 100 is not used,  
                # the code will get stuck in an infinite loop  
                count = 0;  
                while (RHT03_PIN == 1 && count < 100) {  
                    delay_us(1); # Delay for 1 microsecond  
                    count++;  
                }  
            }  
        }  
        # Re-init RHT03 pin  
        RHT03_PIN_DIR = 0;  
        RHT03_PIN = 1;  
        delay(2); # Need to sleep atleast 2 seconds  
                  # between reads from the RHT03 device  
        Goto init; # Goto the beginning and start over again
        
  • I got two of these few days ago. During the weekend I wanted to see how it worked. Connected pin 1 to 5V, pin 2 with 1K resistor to 5V, pin 3 and 4 to GND. Connected an oscilloscope to pin 2 and briefly brought pin2 to ground. I can see the rising edge, but just a flat solid 5V (i.e. high bit). I tried to pilot it using a digital line from a Flyport, but got same results. I tried to use the second RHT03 that I got, same behavior. Looks like they are not working. Any suggestions on what I’m doing wrong or how can I check if they are working? Thanks a lot.

    • The handshake to get the RHT03’s to send data is the following.
      The pin hook-up you have is right, the only difference is that I leave pin 3 floating, but it sounds like GND is necessary if using 3.3V.

      Start with data pin HIGH  
      Set data pin LOW  
      wait ~18 ms  
      Set data pin HIGH  
      wait 40 us  
      

      At this point the RHT03 will start sending data.
      I used ikalogic’s analyzer to playback the above handshake to test my RHT03’s. I have purchased three, so far, and all of them work and continue to work.

      • Thank you PharoahsMummy. I don’t have a digital analyzer, but I do have an oscilloscope that triggers on the rising edge of the signal. I tried setting the data pin low for over 100ms to allow the RHT03 to recognize the start signal, but after the rising edge I don’t see any response. The signal remains high. Does the low signal has to be exactly 18ms and if it is more or less won’t work? This is not what the doc says, but I can try as soon as I find a little bit of time for my hobby :–)
        Thanks a bunch.

        • The initial LOW does not have to be exact, the datasheet states minimum of 1ms, I usually go 18ms because it seems to work for the DHT22, DHT11 and RHT03. The pull high and wait for 40us needs to be exact, the data sheet says 20-40us. This pulse needs to be within 20-40us long or the RHT03 will ignore the request.

          • Well understood, but the 40us wait is to release control to the RHT03. With the oscilloscope, after I have have put the pin 2 to ground for 100ms and pulled it back up, I should see some set of high-low pulses… while instead I see nothing, but a high signal. Do you agree, there is something wrong or there are other things I should be checking? Thanks you very much for your council.

            • Yes, you are right, pulling the data pin high is to allow the RHT03 to pull it low and the RHT03 should do that approx 20-40us after the data pin goes high.
              I would try the following, connect pin1 to power (5v), pin2 to data pin (plus 1k resistor to power), pin3 no connection and pin4 to ground. Start with the data pin high and set low for no more then 20ms, then bring high. The data pin should show signs of activity. If not something might be wrong with the RHT03.

              • Thank you PharoahsMummy for your kind support. I think I sorted this out. It was not how long I was pulling down the data pin. It was the fact that my PIC was starting to ask for data too early. What happens is that the RHT03 not only do not respond to that inquiry, but will never respond in the future to any inquiry. The only way is to reset it, i.e. cut the power and the re-establish it. Instead if the PIC waits a couple of seconds (may be more, I’ve not measured exactly), then the RHT03 works beautifully. The data sheet mention this “When power is supplied to sensor, don’t send any instruction to the sensor
                within one second to pass unstable status.”. What it does not mention is that, if you do, the RHT03 will never respond again. Bitchy device :–)

  • Here’s an example of working code with the Arduino. The example polls every 6 seconds or so, and gives you humidity and temperature readings.
    http://sheepdogguides.com/arduino/ar3ne1humDHT11.htm
    Works a treat!

  • Not sure why the example code for this product is in Microsoft Word (.doc) RTF format which can likely lead to corrupted characters and formatting issues? Why not share it using a Github Gist?

  • It works almost perfect but…..

    The temperature reports good results but the humidity is a little bit strange. It reports 29,70 29,80 29,90 30,00 99,99 I looks to me that there is some timing error or is it that I destroyed the sensor when I tryed out the 1K resistor as pullup instead of the 4K7 ? //Mats

  • Just got one of these,

    Temperature reading seems accurate. RH is way off. at least 20% off.

    What could I have done wrong? Is the sensor bad? I’m reading it with check-sum, so it is not likely a data interpretation issue.

    From reading other comments it seems like I am not the only one seeing this type of behavior. Is this just a crappy sensor? the datasheet does indicate that it goes to as much as +– 5% at the edges, but +– 20% is utterly useless.

    Any ideas?

  • Running into a bit of trouble hooking one of these up to an UNO. I’ve tried the NetHoncho and adafruit libs with no result. The NetHoncho lib gives me an “ACK time out”

    Any thoughts on how to continue ?

  • I spent about 9 hours bashing my head against this sensor (or, well, the wall while trying to get this sensor working) before finally getting it going. Write-up and sample code here

    Key lessons:

    • When requesting a sensor read, you have to actively pull the signal line high after your initial 1 – 10ms low pulse. Stopping pulling it low and letting a pull-up resistor bring it high is not good enough, at least with my setup (tried 20k built-in and 1k external pull-up resistors). You must actively pull the line high (+5V DC) for 20-40us then let the pull-up take over and wait for the it to go low as the sensor ACKs your request.
    • The datasheet is a lie. In particular, instead of a neat 50us low signal before sending a bit, my sensor may pull the line low for anything from 35 to 75us. Similarly, 0-bit high pulses may be from 10-40us instead of the documented 22-26us, and 1-bit high pulses may be 60-85us instead of 70us.
    • Even when you’re being tolerant of timing weirdness, you’ll get bad reads. Adding a cap across the +5VDC input (as mentioned in the datasheet) doesn’t seem to help, so it’s probably not power fluctuation. Be prepared to re-try reads and remember to wait at least 2s between reads.
    • (Didn’t trouble me, but): Remember to let the sensor settle for at least 2s after power-on before attempting a read, and at least 2s between reads.