DHT11

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

DHT11

Post by medelec35 »

Using DHT11 component Update and Test file (just changed to DHT11 component) posted here

Setup is EB006 with 16F1937 running at 19.6608MHz.
Keyes KY-015 DHT11
DHT11 Datasheet with sketches of waveforms
There is no noticeable difference in results between the original DHT11 component (using FC7_Latest_Files_151216.zip) and one posted on the above link.
Attached is a USBee waveform capture and Flowchart used.

Results on LCD are similar to reported DHT22:
Temperature and humidity is displayed but keeps flashing with CRC Error on a regular basis.

Martin
Attachments
DHT11 USBee capture.zip
(14.1 KiB) Downloaded 283 times
DHT11_Example_v7.fcfx
(11.58 KiB) Downloaded 313 times
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DHT11

Post by Benj »

Thanks Martin,

I'll have another look. I'm not in the office today but I'm back in tomorrow.

Out of interest are you using a pull up resistor? If you are then can you try it without and see if that makes a difference. This was working great for me yesterday without a resistor so if it's not that then I wonder what the problem is.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: DHT11

Post by medelec35 »

Hi Ben,
Benj wrote:Out of interest are you using a pull up resistor?
Yes, but the resistor is built-in to the PCB that's shipped with:
KY-015 Temp and Humid.png
(21.75 KiB) Downloaded 2580 times
I have removed the resistor and still flashing CRC error on a regular basis.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DHT11

Post by Benj »

Thanks Martin, good to know removing the resistor made no difference.

One quick hack you could try is slightly tweaking the clock speed setting in the project options say +/- 1%. Word of warning that if you have other critical delays or UART bauds etc in your program then it will also send them out.

Just wondering if my delays are too big or too small.

The 0 has a mark of 26-28uS, the 1 has a mark of 70uS so I wait for 30uS from the start of the mark before sampling.

Might also be worth trying the 16F1937 on the IntOSC running at 32MHz.

Code: Select all

OSCCON = 0xF0;
Strange it was working so well for me but I think I need to retry with the sensor on a short cable rather than connected directly.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: DHT11

Post by medelec35 »

Hi Ben,
produced a spreadsheet table:

Code: Select all

19660800		
     +	       -	  %
19857408	19464192	1
20054016	19267584	2
20250624	19070976	3
20447232	18874368	4
20643840	18677760	5
20840448	18481152	6
21037056	18284544	7
21233664	18087936	8
21430272	17891328	9
21626880	17694720	10
No CRC error at -3% (19070976Hz)
Also working with internal osc at 32MHz (clock speed is also set at 32MHz).

Hope that helps?
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: DHT11

Post by medelec35 »

Hi Ben,
Just updated DHT11 compont you have posted here
changing speed back to 19660800Hz display regally changes from showing Temperature/Humidity to 'No Reply'
It may take a while to find a speed in which it works.

Martin
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DHT11

Post by Benj »

It's so strange that it's working flawlessly here for me at 19.6608MHz but not for you guys.

Are you using the standard shipped version of the PIC compiler?

Also are you using the new IO cal from the update zip? This should help but I tested and is not required for my setup to work.

I've got my sensor on a long cable now but it's still plugged into a breadboard, I wonder if the additional capacitance is having any effect.

Post Reply