Interfacing the Imp with RHT-03 (OneWire support) and IR Goodness

Hey,

Sorry to bring this thread out of the dead and happy holidays!

I’m wondering if anybody’s been able to get the RHT-03 working with the Imp since I saw an Imp library for the DHT11 and they seem visually identical…?

I don’t really know what the difference between the two sensors is so I’d really appreciate some info from anyone who can help out.

Thanks in advance!

p.s. I just saw a page which stated that the RHT-03 is also known as DHT22. There’s even some example code detailing how to get it working with RPi - http://davidjkaleta.com/?page_id=26

p.s. 2 Here’s a link to Adafruit with some more info on the difference between the two sensors - https://learn.adafruit.com/dht

Also, here’s the Github link to the Imp library I found on the Imp website - https://github.com/electricimp/reference/tree/master/hardware/DHT22

Can anybody confirm whether they were able to get an RHT-03 (DHT22) working with the above library?

Thanks!

Hey, guys!

I went ahead and did a little test to see whether the library would work with my RHT-03 first-hand, but no joy :frowning:

I’ve attached an image showing my current breadboard config - I believe it’s as instructed by the Github page here:

Sadly, all I’m getting in the log is -

2014-12-26 01:49:24 UTC+2 [Device] Running 138d21b - release-30.22 - Fri Oct 17 12:15:01 2014, Free Memory: 81808 2014-12-26 01:49:24 UTC+2 [Device] Relative Humidity: 0.0 % 2014-12-26 01:49:24 UTC+2 [Device] Temperature: 0.0 C

Any ideas?

Your resistor is between pins 1 and 7, not 2 and 7.

@gsunada - Hey and thanks for trying to help out!

Sadly, the resistor is not the issue - here’s another slightly different angle of the same setup.

Any other ideas? Has anybody actually tried to do this?

Thanks!

I’am using this since months…

send me your SC and i can test it with my setup.

but first change the timmings for RHT-03’s

Zero 30
One 75

Hey, @Chrischi

I pretty much just dumped the code from the Github repo found here:

I also tried changing

static ZERO = 0.000026; // 26 us high for "0"

to

static ZERO = 0.000030; // 30 us high for "0"

as you suggested, but I’m still getting

2014-12-26 23:43:27 UTC+2 [Device] Running 138d21b - release-30.22 - Fri Oct 17 12:15:01 2014, Free Memory: 79868 2014-12-26 23:43:27 UTC+2 [Device] Relative Humidity: 0.0 % 2014-12-26 23:43:27 UTC+2 [Device] Temperature: 0.0 C

Any ideas?

Hey,

@Hugo - can you please lend your opinion on this matter? The class I’m trying to use is listed on the official drivers list

https://electricimp.com/docs/examples/drivers/

but isn’t working for me despite numerous attempts and help from @Chrischi

Has anyone previously reported issues with this driver? How can I troubleshoot this?

Thanks in advance!

Just to confirm the issue, I also tried with a DHT22 and getting the same 0.0 results.

I’m afraid I can’t help here. I didn’t write that driver; they aren’t “official drivers”, just drivers written by engineers here and released under an MIT license. Had a quick look around the lab and couldn’t see any maxdetect parts to try it myself either.

Seems like chrischi has no issues here; are you sure the sensor isn’t dead?

Hey @Hugo and thanks for chiming in!

I’m pretty sure the sensor is fine since it works when hooked up to an Arduino and also @osherl confirmed that he’s seeing the exact same issue as me.

How can we go about troubleshooting this since I really love the Imp platform and have been wanting to implement this sensor into my project for nearly two years now… :frowning:

Thanks in advance!

Happy holidays!

Got a scope to look at the waveform being generated? That’d be the first thing I’d look at.

You could obviously pick another sensor. These days there are really cost-effective I2C interfaces temp/humid sensors, eg the new Silicon Labs ones.

http://www.digikey.com/product-detail/en/SI7020-A10-GMR/336-2540-1-ND/4211751

…is $3.50, one-off. More accurate than the maxdetect too.

I used a new IMP001 and just C&P the Class from GitHub.

tied Mosi to Miso with 1k and Miso to Data.

Looks good to me…

2014-12-29 20:56:52 UTC+1 [Device] Running 138d21b - release-30.22 - Fri Oct 17 12:15:01 2014, Free Memory: 81976 2014-12-29 20:56:52 UTC+1 [Device] Relative Humidity: 24.0 % 2014-12-29 20:56:52 UTC+1 [Device] Temperature: 21.0 C

Hey,

Thank you very much for the replies!

@Hugo - sadly, I don’t have a Scope on hand (and I probably wouldn’t be able to find the specific issue, even if I did).

If all else fails, I can always try another sensor, as suggested - do you know off the top of your head a drop-in replacement for the DHT22? I’m referring to the following:

  • Breadboard-friendly - perhaps someone has developed a breakout board? I’d really prefer not to go SMD for this project
  • No external components
  • Similar price range
  • Ideally carried by SparkFun since it’s one of the few overseas companies I can get parts from

@Chrischi - that’s very strange. Myself and @osherl seem to be having issues with the exact same code & sensor which is working for you… Must be something else.

Thanks for the effort, guys!

HTU21D I2C sensor on a breakout: https://www.sparkfun.com/products/12064 … $15 (vs $10 for the maxdetect part)

3% RH and 0.4C accuracy.

+1, i own also the HTU21D I2C sensor and it’s much better than the DHT stuff.

@tldstyl3

  1. you should try to change the code to see the raw communication.
  2. where are you from?

Hey,

Thanks for the replies! Too bad these sensors always seem to be a pain when trying to interface with various mCs. Perhaps, I’ll get an HTU21D as suggested and just forget about getting the DHTs working with the Imp for the time being…

@Chrischi - I’m writing in from Bulgaria.

Happy holidays!

Hi,

I’m having the same issues with the DHT22. Is there well tested budget temp/humidity sensor out there that reportedly has no issues?

thanks

Yep, see above. HTU21D.

Hey @Hugo

My HTU21D shipment should be coming in within a week or so and I was wondering whether there’s a class already written for it?

I checked the official docs, but couldn’t find a link. Can you recall whether you’ve seen anything along those lines off the top of your head?

Thanks in advance!

No class, no, but it’s pretty simple to use. Appears to be code-compatible with the SHT21 from sensirion that I posted some code for here:

https://discourse.electricimp.com/discussion/500/sht21-need-help/p1