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: AustraliaPosts: 79 |
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 StatesPosts: 147 |
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: AustraliaPosts: 79 |
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 StatesPosts: 147 |
How are you powering the DHT11? |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
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: AustraliaPosts: 79 |
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: AustraliaPosts: 79 |
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 ZealandPosts: 711 |
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: AustraliaPosts: 79 |
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 ZealandPosts: 711 |
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: AustraliaPosts: 79 |
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: AustraliaPosts: 320 |
Where about are you in Aus their maybe somebody nearby who could help. Regards Cliff Cliff |
||||
rogersan Regular Member Joined: 10/04/2015 Location: AustraliaPosts: 79 |
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 KingdomPosts: 3659 |
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: AustraliaPosts: 79 |
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 |