DHT11 to DHT22!
Moderator: Benj
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
DHT11 to DHT22!
Hi All!
I have played with Enamul's and John's fine examples of DHT11 which works very very well. I can see that DHT22 has greater accuracy. And I can see the data for the 2 sensors are not equal.
I've tried to look at the example of DHT11 (John's) FC to try to "decode" the program, but it contains C code which I am not able to read and therefore can not see how the 40 bits are read from DHT11.
I dare to ask, because I think it's a very good project and can be useful in many respects and deserves a DHT22 with greater accuracy, is it very difficult to change the program to a DHT22 sensor. and someone will make the attempt. I myself am not able to do so.
John´s Poject http: //www.matrixmultimedia.com/mmforums/viewt ... t11#p44939
I would be very grateful if anyone can help....
Best regard
Jorgen
I have played with Enamul's and John's fine examples of DHT11 which works very very well. I can see that DHT22 has greater accuracy. And I can see the data for the 2 sensors are not equal.
I've tried to look at the example of DHT11 (John's) FC to try to "decode" the program, but it contains C code which I am not able to read and therefore can not see how the 40 bits are read from DHT11.
I dare to ask, because I think it's a very good project and can be useful in many respects and deserves a DHT22 with greater accuracy, is it very difficult to change the program to a DHT22 sensor. and someone will make the attempt. I myself am not able to do so.
John´s Poject http: //www.matrixmultimedia.com/mmforums/viewt ... t11#p44939
I would be very grateful if anyone can help....
Best regard
Jorgen
- Attachments
-
- DHT11 - Alarm-Eblock-Works.fcf
- (48.52 KiB) Downloaded 700 times
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
Hello,
I made this program for DHT11 or DHT22
It works very well
Warning this is a macro (macro import)
I made this program for DHT11 or DHT22
It works very well
Warning this is a macro (macro import)
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Cubitus!
Thank you very much, I am very greatfull. I Will test it later today and you hear from me.
But I wonder how it is possible to use both DHT11 and 22 in same program.
Thanks in advance
Jorgen
Thank you very much, I am very greatfull. I Will test it later today and you hear from me.
But I wonder how it is possible to use both DHT11 and 22 in same program.
Thanks in advance
Jorgen
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Again Cubitos!
I have tested your macro. I made a program (att.) The only thing I see in the display is 0,% and 0, c. I use a Pic16f876a and change the input for the DHT22 to C4
Are you able to se what i have done wrong?
Best regard
Jorgen
I have tested your macro. I made a program (att.) The only thing I see in the display is 0,% and 0, c. I use a Pic16f876a and change the input for the DHT22 to C4
Are you able to se what i have done wrong?
Best regard
Jorgen
- Attachments
-
- DHT22.fcf
- (23.49 KiB) Downloaded 706 times
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
Hello,
Must leave some time between acquisitions (eg 0.5 s)
Must adjust the value. "Chrono>35" depending on the speed of the microcontroller. 35 is a PIC 64MHz. At 19MHz, your good value should be around the value 10.
Must leave some time between acquisitions (eg 0.5 s)
Must adjust the value. "Chrono>35" depending on the speed of the microcontroller. 35 is a PIC 64MHz. At 19MHz, your good value should be around the value 10.
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Again!
Now humidity seem to work But not the temp. If I change the same Crono for temp I get the value 10,2c but it stuck´s same value all the time.
I don´t understand 100% where I have to place a delay for 500ms "Must leave some time between acquisitions (eg 0.5 s)".
B R.
Jorgen
Now humidity seem to work But not the temp. If I change the same Crono for temp I get the value 10,2c but it stuck´s same value all the time.
I don´t understand 100% where I have to place a delay for 500ms "Must leave some time between acquisitions (eg 0.5 s)".
B R.
Jorgen
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
For the 500ms
You can try to change the value 8 9 10 11 12 of .chrono,
You can also try changing the first delay 2ms to 4ms
You can try to change the value 8 9 10 11 12 of .chrono,
You can also try changing the first delay 2ms to 4ms
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Again and Again!
Meanwhile I found a bug ( I made ), now it Work Wery nice, and looks very promising. Compared with my proff. reference humidity/temp. measure, they are very equal
again thank you very much your help.
Best regard
Jorgen
Meanwhile I found a bug ( I made ), now it Work Wery nice, and looks very promising. Compared with my proff. reference humidity/temp. measure, they are very equal
again thank you very much your help.
Best regard
Jorgen
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi!
If anyone is interested I would like to share with you all.
It works very fine the readout from DHT22 Cubitus made.
B Regard
Jorgen
If anyone is interested I would like to share with you all.
It works very fine the readout from DHT22 Cubitus made.
B Regard
Jorgen
- Attachments
-
- DHT22.01.fcf
- (23.93 KiB) Downloaded 704 times
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Cubitus!
Oooopps. During test I discovered when the temerature is lower than 10 degre the display begin to show 99,c and 98,c ect.
I could imagine it is the decimal place which is not correct when below 10,0c
Will you help me to correct this. Pls
Best regard
Jorgen
Oooopps. During test I discovered when the temerature is lower than 10 degre the display begin to show 99,c and 98,c ect.
I could imagine it is the decimal place which is not correct when below 10,0c
Will you help me to correct this. Pls
Best regard
Jorgen
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Ok you Can se it!
But the only ting I understand is "To string funtion" and I could imagine this is not the problem
Is it possible to solve, and do you have an idea
B R.
Jorgen
But the only ting I understand is "To string funtion" and I could imagine this is not the problem
Is it possible to solve, and do you have an idea
B R.
Jorgen
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Again!
Sorry but my English is not so good.
What I meant, was that of all your calculations, in the calculation box, was the only thing I could figure out was the "to string" command. ( I do not have the deep experience with programming as you have).
I see you have been so kind to make a new FCF file or changes for me. I'll test it tomorrow. You hear from me.
So far, many thanks.
Jorgen
Sorry but my English is not so good.
What I meant, was that of all your calculations, in the calculation box, was the only thing I could figure out was the "to string" command. ( I do not have the deep experience with programming as you have).
I see you have been so kind to make a new FCF file or changes for me. I'll test it tomorrow. You hear from me.
So far, many thanks.
Jorgen
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Cubitus!
I have tested the temperature with coolspray: IT IS PERFECT :
For the humidity I am not able to test this. I have no dry air on spray But i suppose you have corrected the bug for both.
Thank´s Again Cubitus.
Best regard
Jorgen
I have tested the temperature with coolspray: IT IS PERFECT :
For the humidity I am not able to test this. I have no dry air on spray But i suppose you have corrected the bug for both.
Thank´s Again Cubitus.
Best regard
Jorgen
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
Hello,
No, I did not correct the humidity, I do not know if this is really useful.
The humidity of the air diminishes very rarely below 30%
The principle is the same as for the temperature.
No, I did not correct the humidity, I do not know if this is really useful.
The humidity of the air diminishes very rarely below 30%
The principle is the same as for the temperature.
Flowcode V6.1.2.0(11 05 2015)
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
Hello
For the négative temp.
For the négative temp.
◎Special Instructions:
When the temperature is below 0 ℃, the highest position of the temperature data.
Example: -10.1 ℃ Expressed as 1 000 0000 0110 0101
Temp.:0000 0000 0110 0101 = 0065H(Hexadecimal)= 6×16 +5 = 101
=> Temp. = -10.1℃
- Attachments
-
- DHT22.fcf
- (23.56 KiB) Downloaded 501 times
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Cubitus!
Thank you very very much. I am really grateful.
I will test it tonigth, and you hear from me.
One more small thing. I have 10 pc of DHT22. When I test them in same program and hardware, I get 10 different result, in temp and humidity, small differences. So in my view, its the DHT22 which not is 100% accurate. If I have one DHT22 wich I want to use as reference, where in the program in calculationbox can I add + or - to adjust it so it fit to my reference.
Hope it´s not to much
Thank´s in advance.
Jorgen
Thank you very very much. I am really grateful.
I will test it tonigth, and you hear from me.
One more small thing. I have 10 pc of DHT22. When I test them in same program and hardware, I get 10 different result, in temp and humidity, small differences. So in my view, its the DHT22 which not is 100% accurate. If I have one DHT22 wich I want to use as reference, where in the program in calculationbox can I add + or - to adjust it so it fit to my reference.
Hope it´s not to much
Thank´s in advance.
Jorgen
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
Hello
You put a variable or constant with offset
offset = 3 for example (+0,3°C)
OR
You put a variable or constant with offset
offset = 3 for example (+0,3°C)
Code: Select all
.temperature = .temperature + offset
.temperature = .temperature AND 0x03ff
.entier = .temperature / 10
...
Code: Select all
.temperature = .temperature + 3
.temperature = .temperature AND 0x03ff
.entier = .temperature / 10
...
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Cubitus!
I am sorry, but the last version doesn't work. The temperaturen is stocking, never changing even when the temperature is changing. The display show the same temp when I start. The humidity seemed to work.
Br.
Jorgen
I am sorry, but the last version doesn't work. The temperaturen is stocking, never changing even when the temperature is changing. The display show the same temp when I start. The humidity seemed to work.
Br.
Jorgen
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
- Contact:
Re: DHT11 to DHT22!
Hello,
I have not tested on the hardware ... Normally it should work.
Cubitus
I have not tested on the hardware ... Normally it should work.
Cubitus
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: DHT11 to DHT22!
Hi Again
Ok, but it doesn´t Work. The temp is "stock" it only change temperature when I reset the Pic. If I put the "old" program in the same hardware Again, it Work Again (without minus)
Sorry.
Br. Jorgen
Ok, but it doesn´t Work. The temp is "stock" it only change temperature when I reset the Pic. If I put the "old" program in the same hardware Again, it Work Again (without minus)
Sorry.
Br. Jorgen
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: DHT11 to DHT22!
Jorgen,
Could you post the contents of the calculation box?
Could you post the contents of the calculation box?
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis