Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:39 29 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : DHT11 can you read it using DHT22 functio

Author Message
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 12:04pm 22 Apr 2015
Copy link to clipboard 
Print this post

Has anyone tried reading a DHT11 using the Micromite DHT22 function? I get high values returned for temperature and humidity indicating a checksum error or unresponsive device.
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 12:45pm 22 Apr 2015
Copy link to clipboard 
Print this post

DHT22 returns twice the data per temp and humidity. What kind of values are you getting? If you divide by 100 does it become more reasonable?
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 01:12pm 22 Apr 2015
Copy link to clipboard 
Print this post

Thanks for your reply.

I get a temperature of 1000 and a humidity of 1000. This normall indicates a checksum error or an unresponsive device.
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 03:16pm 22 Apr 2015
Copy link to clipboard 
Print this post

How are you powering the DHT11?
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 08:02pm 22 Apr 2015
Copy link to clipboard 
Print this post

Hi
Take a look here
http://www.thebackshed.com/forum/forum_posts.asp?TID=7204&KW=dht11&PN=0&TPN=1

Regards
Jman
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 11:39pm 22 Apr 2015
Copy link to clipboard 
Print this post

The DHT11 is being powered by 3.3V to Vdd, the data pin has 4.7 kOhm to 3.3 volt.
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 10:48pm 24 Apr 2015
Copy link to clipboard 
Print this post

I used the program for reading the DHT11 (from The Back Shed) and it worked. However I tried using ithe same program with a DHT22 but I could not find a modification that would work. I get a temperature reading of 152.5 instead of about 24 degrees C.

The only difference seems to be the length of the start (low pulse) from the host (Micromite), for the DHT11 it is about 20 millisec, but for the DHT22 it is 1 millisec. The format and timing for the reply from the DHT11 and DHT22 seems to be identical, does anyone have more information?
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 10:55am 25 Apr 2015
Copy link to clipboard 
Print this post

Why use the same program for the DHT22 use the built in command
"DHT22 pin, temp, humid" see the manual page 18

What version of the Micromite software are you using ?
This from the latest change log
"Fixed a bug which caused the DHT22 command to return an invalid reading at low temperatures."


Regards
Jman
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 12:59pm 25 Apr 2015
Copy link to clipboard 
Print this post

I am using Version 4.6 of the Micromite software.

I was using the DHT22 function and it was failing below about 25 degrees C, I thought I had a faulty DHT22, but perhaps it's the Micromite software. What version of the Micromite software fixes the problem?

I was trying the DHT11 software on the DHT22 to try to analyse the problem. Using this software with a DHT11 and varying the start pulse length from the Micromite from 1 to 15 millisec with the checksum disabled I could get the correct value for temperature, about 22 degrees for a range from 2-13 millisec.

At 1 millisec the DHT11 would not reply. Above13 millisec the temperature came back as 48 or 152 indicating bits shifting to the left. Strangely the code

th=th and &H7F

Does not zero the sign bit, because it should stop you getting temperatures above 127. Is this another bug? I tried

If th>127 then th=th-128

But this did not work either.

I have not been able to get the DHT11 software to work with the DHT22 as yet, even trying different start pulse lengths.

 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 01:25pm 25 Apr 2015
Copy link to clipboard 
Print this post

  rogersan said   I am using Version 4.6 of the Micromite software.


That's the problem you need to upgrade to 4.6B
It's is available form here Micromite 4.6B

Regards
Jman
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 05:53pm 25 Apr 2015
Copy link to clipboard 
Print this post

Thanks for the information, looks like I will have to get a programmer for re-programming the Micromite, what do you suggest?

In the meantime so I can check my DHT22, do you, or anyone know the timing differences for the DHT22 so I can try to make the DHT11 software work for the DHT11.
 
centrex

Guru

Joined: 13/11/2011
Location: Australia
Posts: 320
Posted: 06:17pm 25 Apr 2015
Copy link to clipboard 
Print this post

Where about are you in Aus their maybe somebody nearby who could help.
Regards
Cliff
Cliff
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 07:13pm 25 Apr 2015
Copy link to clipboard 
Print this post

I am in Brisbane on the west side of town in Fig Tree Pocket. It would be helpful if there is someone in Brisbane, who is setup with a programmer, who could re-program it for me.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 03:20am 26 Apr 2015
Copy link to clipboard 
Print this post

You can easily reprogram a 'mite using another mite, a PC or even a Raspberry Pi.

John
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 03:04pm 26 Apr 2015
Copy link to clipboard 
Print this post

The DHT22 responds so quickly to the start pulse from the Micromite that there is not enough time to do

SetPin 2,din
I=DHT11conv(rawdata())

Before the DHT22 pulls the data line low. I would like to do the SetPin 2,din in the CFunction dht11conv, Can I just add the machine code for this just after the 00000000 at the start of the CFunction?
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024