Introduction: Humidity & Temperature Sensor (ESPHome)

About: To learn is to live!

I wanted a simply sensor for recording temperature and humidity in my roof cavity so that if necessary I could automate turning off my HRV when using our airconditioners.

This is more of an overview than an indepth tutorial.

Supplies

Materials/Parts

  • ESP01
  • DHT11 Temperature and Humidity Sensor
  • LM3940IT
  • ESP-01
  • 10uF Electrolytic Capacitor
  • 0.1uF Capacitor
  • 33uF Capacitor
  • 0.47uF Capacitor
  • USB-C connector
  • Connecting wire
  • Super or Epoxy glue
  • Solder

Tools

  • 3D Printer (Tevo Tornado)
  • Soldering Iron
  • Glue gun
  • ESP01 Programmer Adapter UART CH340 USB to ESP8266

Software

  • FreeCAD
  • Cura
  • Home Assistant or another framework

While the schematics show some headers, I did not use these, soldering the parts directly onto the board.

Step 1: ESPHome

I have only just started using ESPHome and so there might be a much better or more correct way to achieve the below.

If you have not used ESPHome with Home Assistant, then this is a good place to start: https://esphome.io/guides/getting_started_hassio.html.

esphome:
  name: roof-temperature-humidity

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret ota_password-Roof

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Roof-Temperature-Humidity"
    password: !secret fallback_password-Roof

sensor:
  - platform: dht
    pin: GPIO0
    model: DHT11
    temperature:
      name: "Roof Temperature"
    humidity:
      name: "Roof Humidity"
    update_interval: 20s
    
captive_portal:


In order to use the the programmer you need to short out two pins when uploading the code (see attached photo). Once installed, ESPHome can use OTA uploads so the programmer is no longer needed.

Step 2: Home Assistant Dashboard

The roof humidity and temperature are the only sensors being fed from this device. The other sensor readings are coming from our airconditioner.

Step 3: Final Product

The PCB I used is one I created for general ESP01 projects, hence there are some pins that are not connected to for this project.

Downloads

FreeCAD Drawing

PCB Gerber file