6 Replies Latest reply on Jan 18, 2020 2:19 AM by AnMo_4196841

    dht22

    AnMo_4196841

      Hi everyone, I have done a project with PSoC 4200 and sensor DHT22. The problem is that when I show the temperature o humidity data on a screen, two values for each one are shown to me (the real value and 9), both with temperature and humidity happen the same thing. I attached pictures.

       

      Can anybody help me?

        • 1. Re: dht22
          rola_264706

          Please post your project so we can determine what the issue is.

          • 2. Re: dht22
            AnMo_4196841

            Here you have the project.

            • 3. Re: dht22
              RakshithM_16

              Hi AnMo_4196841,

               

              I went through your project and the project is quite similar to the one that I had. I just want to mention that the way the humidity and temperature is calculated is very interesting

               

              To answer your question, whenever the communication timeout occurs i.e., when timeout is greater than 500,

              r99 label is executed -

              This sets the value 99 to both humidity and temperature. The LCD prints this value divided by 10.

              Therefore, 9 (99/10) is displayed on the LCD.

               

              Hope this helps,

               

              Thanks and Regards,

              Rakshith M B

              • 4. Re: dht22
                AnMo_4196841

                Hi,

                 

                you are right but how can I solve this so that it doesn't show me?

                 

                Thanks

                • 5. Re: dht22
                  RakshithM_16

                  Hi AnMo_4196841,

                   

                  Can you let me know how often you are getting this timeout error?

                   

                  The timeout is before the sensor starts sharing the data and as far as I know the logic implemented is correct.

                   

                  Can you try these steps and see if this resolves your issue?

                   

                  1. Can you add the following lines before line 64 -

                                           DHT_Write(1u);

                                           CyDelay(500);

                  2. Change the delay in line 68 from 19 to 18 miliseconds and see if this helps.

                  3. You can also enter Debug mode, put a break point at line 147 - humidity = 99; and check at what point exactly the timeout occurs.

                  4. Another debug method is to probe the data line with any logic analyzer and check what is causing the timeout.

                   

                  Thanks and Regards,

                  Rakshith M B

                   

                  • 6. Re: dht22
                    AnMo_4196841

                    Hi,

                     

                    The problem has not been solved with your instructions. I cannot do the debugging because the bluetooth cannot be connected while it is being performed and therefore does not enter the condition of the connected device and notification.

                    My idea in this project is that the sensor continuously reads values but only sends the value through the ble when it is different and how it takes the "9" because the value continuously changes between 9 and the real value.