Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. DHT22 - switched sensor types?

DHT22 - switched sensor types?

Scheduled Pinned Locked Moved Development
5 Posts 3 Posters 1.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • simonszuS Offline
    simonszuS Offline
    simonszu
    wrote on last edited by
    #1

    Hi,

    i am trying to set up a DHT22 node. This is my first step with mysensors ever. After figuring out some hardware issues, all connection is working, at least for a distance of around 1 meters.

    However, i'd like to ask how big can a temperature offset of a DHT22 sensor be? I have a room temperature of around 22°C, however, this sensor shows around 28°C - and a humiditiy of 23%. So, either the measurement tolerance is quite big, or i have somehow switched both readings.

    This is the code i have flashed on the node: https://pastebin.com/E2XWu3F3
    And this is how it appears in Home Assistant: https://pastebin.com/rLWn91ws

    Is my code correct? I think i have some weird errors, e.g. only increasing temperature is registered, when decreasing temperature, the value isn't decreasing as well.

    Boots33B 1 Reply Last reply
    0
    • simonszuS simonszu

      Hi,

      i am trying to set up a DHT22 node. This is my first step with mysensors ever. After figuring out some hardware issues, all connection is working, at least for a distance of around 1 meters.

      However, i'd like to ask how big can a temperature offset of a DHT22 sensor be? I have a room temperature of around 22°C, however, this sensor shows around 28°C - and a humiditiy of 23%. So, either the measurement tolerance is quite big, or i have somehow switched both readings.

      This is the code i have flashed on the node: https://pastebin.com/E2XWu3F3
      And this is how it appears in Home Assistant: https://pastebin.com/rLWn91ws

      Is my code correct? I think i have some weird errors, e.g. only increasing temperature is registered, when decreasing temperature, the value isn't decreasing as well.

      Boots33B Offline
      Boots33B Offline
      Boots33
      Hero Member
      wrote on last edited by Boots33
      #2

      @simonszu Looks like you have the temp and humidity swapped around in the send message part

      here is a direct copy of your sketch. you are sending the temperature in the humidity message and humidity in the temp message

        send(msgHum.set(temperature, 1));    // this should be humidity
        #ifdef My_DEBUG
        Serial.print("T: ")
        Serial.println(temperature);
        #endif
        send(msgTemp.set(humidity, 1));   // this should be temperature
      
      1 Reply Last reply
      1
      • simonszuS Offline
        simonszuS Offline
        simonszu
        wrote on last edited by
        #3

        Ah. Yeah. Thanks. Sometimes one can be really blind when debugging own code. :D

        Boots33B 1 Reply Last reply
        0
        • simonszuS simonszu

          Ah. Yeah. Thanks. Sometimes one can be really blind when debugging own code. :D

          Boots33B Offline
          Boots33B Offline
          Boots33
          Hero Member
          wrote on last edited by
          #4

          @simonszu Yes I know the feeling well !! Hope it all works as expected now

          1 Reply Last reply
          0
          • gohanG Offline
            gohanG Offline
            gohan
            Mod
            wrote on last edited by
            #5

            dht sensors are not very accurate anyway 😅

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            20

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular