logo elektroda
logo elektroda
X
logo elektroda

Error reading data from DHT11 sensors connected to NodeMCU board on pins D1, D2

lexom 597 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19071169
    lexom
    Level 12  
    I have two sensors connected to the nodeMCU board (pins D1, D2).
    I am trying to read values from these sensors but unfortunately I get a reading error or the values are wrong.

    Code: Text
    Log in, to see the code
    .

    Anyone had a similar problem ?

    Code:
    Code: Lua
    Log in, to see the code
    .

    Plate:
    Code: Text
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #2 19222329
    zbylan1
    Level 10  
    Have you solved the problem?
    I ask because I have a similar one. Admittedly concerning not an ESP, but an Arduino Mega 2560, but maybe some conclusions can be drawn.
    I have a sizable project ready to go based on the Mega 2560, with a dozen or so different sensors, including 2 DHT11s, both connected on several metres of shielded twisted-pair cables. For a couple of months everything was humming along, until it suddenly stopped. - For no discernible reason :( . Both sensors, instead of actual temperatures, show 0 (zero), reporting no errors . I have replaced the sensors. The ones removed, plugged directly into the PCB work just fine. The wires have been "rewired", everything seems to be o.k. (When everything was working, the sensors were read every 15 sec. Now that it's kicked in, I've changed this and am trying to read them at a higher rate as well: alternately, every 30 sec each - to no avail.
    Do you have any ideas, as I've been sitting on this for a week now and "my hands have fallen off".
    Greetings
    P.S. I forgot an important one (perhaps for you):
    When I was running my project, I also encountered checksum errors.
    These were because the newer DHT11s labelled ASAIR (capacitive), require different libraries than the initial ones for the DHT11 AOSONG (resistive), and I started my attempts on the AOSONGs.
  • #3 19222852
    lexom
    Level 12  
    I have not dealt with this problem.
    I changed this sensor to bme280 and everything works.
    Maybe someone else on the forum had a similar problem.
ADVERTISEMENT