Page 1 of 1
Help with programming the sensor DHT11
Posted: Sat Nov 17, 2012 9:18 pm
by nc56
Hello
to finich my program
http://www.matrixmultimedia.com/mmforum ... =3&t=11509
I need a help to program the sensor DHT 11 with flowcode using 16f877A
Does somebody worked with this sensor ?
Really I need your help
Thank you
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 10:21 am
by JohnCrow
Hi
Sorry , Im not familiar with that sensor.
I've just looked on you-tube and there are a lot of tutorials about it with both PICs and Arduinos
Maybe you will find some information on that site.
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 11:09 am
by Enamul
Hi
I am writing code for you for the chip with the help of Ben's earlier post. Hopefully I can finish that tonight.
Thanks,
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 11:11 am
by Steve001
have a look here may be of some use
http://embedded-lab.com/blog/?p=4333
Steve
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 11:16 am
by Enamul
Hi Steve
I am using that link and Ben's macro for data read to write flowcode file. You have guided to right one.
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 1:36 pm
by nc56
thank you for you help

I m also trying to write the code in flowcode but i didn't arrive yet

Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 1:59 pm
by nc56
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 2:00 pm
by Enamul
Yes, I have seen that.
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 6:45 pm
by Enamul
Here is the code I have been working on..I have followed the c code given in the following link
http://embedded-lab.com/blog/?p=4333
Most of the thing I have tried to follow and even PIC but you can change that to any PIC you want. Please let me know how it's behaving. I don't have the sensor that's why I can't test it but hopefully it will work.
Re: Help with programming the sensor DHT11
Posted: Sun Nov 18, 2012 8:46 pm
by nc56
Thank you so much ; I will test it in the test board and i will tell you the result
I hope that it work

Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 5:55 pm
by nc56
Hello Enamul
The code of the dht11 doesn't work , it shows always No response from the sensor
I tested he .hex of
http://embedded-lab.com/blog/?p=4333 and it works correctly
so I am trying to change some parametres
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 6:00 pm
by Enamul
Hi
I think there is a problem in the code for managing TMR0..I have modified that. Can you please try now? By the way what crystal frequency you are using for the code I have posted? Time is very critical for this device and the code.
It need to be 4MHz..
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 6:22 pm
by nc56
yes I am using the 4MHZ crystal
ok i will try this code now
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 6:49 pm
by nc56
now it didn't show anything ! I wrote "hello" in the beginnig of the program to see if te program is running and it is shown
then nothing in te LCD ! and when I remove the data pins it shows checkSum ERROR
that means that CheckSum is not equal to (RH_Byte1 + RH_Byte2 + T_Byte1 + T_Byte2)
so the program entred in the working mode .
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 7:09 pm
by Enamul
Yes, you are right. If it's showing nothing in the LCD that means program entered in the working mode. That's a good sign. But it seems to me now that Read_Byte macro is not working properly. If it stuck at some point only then LCD can be blank otherwise LCD should say "Checksum error!" or right results. I have to have a look again in the Read_Byte macro..but that is ok I think as Ben has written that.
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 7:25 pm
by Enamul
Hi
I have checked the code but I can't get any issue. Just disabled TMR0 after timing requirements. You can try if still don't work what I can do I have to order one for me to test practically. You have to wait couple of days in that case.
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 7:30 pm
by Enamul
Hi
I have ordered one for me..I will get that in Friday..so hopefully we can solve that by Friday
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 7:47 pm
by Enamul
Hi
One more try with change in checksum...as the datasheet says checksum will be the last byte of the summation of first 4 bytes.
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 8:08 pm
by nc56
Nothing has changed
OK Enamul ; until that moment I will try with it again
Tank you so much

Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 8:13 pm
by Enamul
Have you tried my last post?
Re: Help with programming the sensor DHT11
Posted: Tue Nov 20, 2012 8:29 pm
by nc56
yes I tried it but nothing new ; when I removed the dht11
and I start the lcd shows CheckSum Error !! Normally it goes to NOT response , isn't ?
Re: Help with programming the sensor DHT11
Posted: Fri Nov 23, 2012 2:04 am
by Enamul
After spending one whole evening I have manged to make the sensor working...
I will make a separate thread for that...I will post link to you..but you need 20MHz crystal 4MHz isn't enough for this.
Re: Help with programming the sensor DHT11
Posted: Fri Nov 23, 2012 7:40 am
by nc56
Good work , what was the problem in the precedent proram ? No problem for the quartz
I think it's the same thing when I use it with another pic 18f , I mean th horloge doesn't change
Thanks
Re: Help with programming the sensor DHT11
Posted: Fri Nov 23, 2012 10:35 pm
by Enamul