Bonjour,
Je vous présente mon programme pour lire les capteurs d'humidité et de température DHT11, DHT22, AM2302
Ce capteur transmet 40 bits: l'humidité en 16 bits, la température en 16 bits, et une somme de contrôle en 8 bits.
DHT11 humidité en 8 bits, température 8 bits (boitier bleu)
DHT22 ou AM2302 humidité en 16 bits, température en 16 bits. (Boitier blanc)
Branchement Port F0 ou An0 sur Arduino pour les autres l'adaptation est facile.
Le programme
Capteurs d'humidité et de température DHT11, DHT22, AM2302
Moderator: Benj
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
How you doing cubitus54, I'm glad to work with you again. I really appreciate your time and help. I study your program an it looks awesome. I tried to run it yesterday but it did not work, I'm not sure in what phase but is getting locked up in one of the loops because my display macro is at the end and it's not being run. I double check today and I had one of the delays in 40ms. instead of 40us. could this be the problem? I'm posting my program, could you take e look at it? You maybe able to find if I did a mistake or just not using the right settings. I appreciate your help in these topics because I'm never hed the chance of implementing them, and still some of them a mystery for me. I'm reading and studying more in my free time. I learned a lot by just studying the programs you shared with me, Thanks a lot!!
- Attachments
-
- Uno_one-wire.fcfx
- My program.
- (11.71 KiB) Downloaded 655 times
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
Hello,
Ce n'est pas possible de simuler le programme sur Flowcode.
Il faut le tester avec un microcontrôleur.
Voici le programme que je n'avais pas pu mettre (3 PJ maxi) (Importer Macro)
Voici une application qu'il est possible de faire en l'interfaçant avec Matlab Simulink.
Ce n'est pas possible de simuler le programme sur Flowcode.
Il faut le tester avec un microcontrôleur.
Voici le programme que je n'avais pas pu mettre (3 PJ maxi) (Importer Macro)
Voici une application qu'il est possible de faire en l'interfaçant avec Matlab Simulink.
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
Thanks for your reply. I did run it in the micro-controller but it just display 255 as a value at both, temperature and humidity. I did try to open your program but is in a different format, I could not opened it with Flowcode. How can I see it? Thanks a lot for your help.
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
Menu -> Macro -> Import407charles wrote:Thanks for your reply. I did run it in the micro-controller but it just display 255 as a value at both, temperature and humidity. I did try to open your program but is in a different format, I could not opened it with Flowcode. How can I see it? Thanks a lot for your help.
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
Hello my friend, now I can see some activity in my display but the variable values are in a 16 bit format right? How do I separate the integers numbers from the decimal numbers? It's 8 bit integral humidity - 8 bit decimal humidity - 8 bit integral temp. - 8 bit decimal temp. How can I achieve the right display reading? Thanks a lot for your support.
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
I finally did it! Thanks a lot my friend, I really appreciated. I believe I found the way to display the humidity and temp.in real numbers. I have to check vs. a digital humidity temp. I got at work. I would not accomplished this without your expertise. See you soon.
- cubitus54
- Flowcode v5 User
- Posts: 110
- Joined: Wed Jun 19, 2013 7:18 am
- Has thanked: 7 times
- Been thanked: 32 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
Hello,
For the DHT11
8 bit integral humidity
8 bit decimal humidity =0
8 bit integral temp.
8 bit decimal temp =0
Le DHT11 ne transmet que l'entier sur 8 bits en BCD, la partie décimale =0
Le DHT22 transmet la partie entière et décimale en BCD sur 16 bits
For the DHT11
8 bit integral humidity
8 bit decimal humidity =0
8 bit integral temp.
8 bit decimal temp =0
Le DHT11 ne transmet que l'entier sur 8 bits en BCD, la partie décimale =0
Le DHT22 transmet la partie entière et décimale en BCD sur 16 bits
Flowcode V6.1.2.0(11 05 2015)
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
Re: Capteurs d'humidité et de température DHT11, DHT22, AM23
Got it, thank you very much. I will see you soon.