ESP Home ESP8266MOD + AM2301 Temperature Sensor

Hi guys,

i’m heaving trouble using my AM2301 temperature Sensor on my esp8266MOD. I’m sitting in my office and get the following readings:

[20:30:31][D][dht:048]: Got Temperature=-9.5°C Humidity=20.9%
[20:30:31][D][sensor:126]: ‘Greenhouse Temperature’: Sending state -9.50000 °C with 1 decimals of accuracy
[20:30:31][D][sensor:126]: ‘Greenhouse Humidity’: Sending state 20.90000 % with 1 decimals of accuracy

Setup:

GND connected to GND
OUT connected to D1 (GPIO5)
VCC connected to VIN

i already tryed different lenghts of cable. i tryed using 3v3 on VCC. i tryed using a 1k Ohm resistor (as described in the Data Sheet between out and VCC). Nothing changes significantly.

Here is my code:
esphome:

name: greenhouse1

friendly_name: greenhouse1

esp8266:

board: nodemcu

# Enable logging

logger:

# Enable Home Assistant API

api:

encryption:

`key: "***"`

`ota:

password: "***"

wifi:

ssid: !secret wifi_ssid

password: !secret wifi_password

# Enable fallback hotspot (captive portal) in case wifi connection fails

ap:

`ssid: "Greenhouse1 Fallback Hotspot"`

`password: "***"`

captive_portal:

sensor:

- platform: dht

pin: GPIO5

`model: AUTO_DETECT`

`temperature:`

  `name: "Greenhouse Temperature"`

  `unit_of_measurement: "°C"`

 `icon: "mdi:thermometer"`

  `device_class: "temperature"`

  `state_class: "measurement"`

  `accuracy_decimals: 1`

`humidity:`

  `name: "Greenhouse Humidity"`

  `unit_of_measurement: "%"`

 `icon: "mdi:water-percent"`

  `device_class: "humidity"`

  `state_class: "measurement"`

  `accuracy_decimals: 1`

update_interval: 60s

The spacing should be right… im just to dumb to format it…

I am out of ideas what to change… Any of you have a solution?
Thank you in advance.

regards,
Moet

Did you put the model number??


  - platform: dht
    pin:
      number: D3
      mode:
        input: true
        pullup: true
    temperature:
      name: "Hall SP Temperature"
      id: hallsptemperature
    humidity:
      name: "Hall SP Humidity"
      id: hallsphumidity
    model: AM2302
    update_interval: 120s

2 Likes

The 2301 is not a supported model- so i have it on auto detect.

In other news: it works now… i dont know why. 2hours after connecting the temperature jumped from -10 to +20 degrees. The value for humidity is plausible too.

HI. I specified the model number AM2302 and used a 5.1k resistor and it works perfectly. From various datasheets they recommend a 5.1k resistor. Trial …