Matthias Hertel
Published © MIT

Outdoor Sensor Using Low-Code

Use the Arduino-HomeDing low-code library for ESP8266 to build and configure a sensor device with DHT22 or other environment sensors.

BeginnerFull instructions provided1 hour2,334
Outdoor Sensor Using Low-Code

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
Any ESP8266 board with USB and 4MByte Flash Memory can be used for development.
×1
DHT22 Temperature Sensor
DHT22 Temperature Sensor
A sensor like DHT22 to get values.
×1
Breadboard (generic)
Breadboard (generic)
A breadboard and wires to connect the sensor.
×1

Hand tools and fabrication machines

Arduino Environment
To upload the firmware to the board the Arduino Environment is used.

Story

Read more

Code

config.json

JSON
sensor functionality configuration.
{
  "dht": {
    "on": {
      "type": "DHT22",
      "description": "Temperature and Humidity sensor",
      "pin": "D5",
      "readtime": "30s",
      "restart": "true",
      "powerpin": "D6",
      "powerinverse": "true",
      "onhumidity": "log/h?value=$v",
      "ontemperature": "log/t?value=$v"
    }
  },
  "ntptime": {
    "0": {
      "zone": "CET-1CEST,M3.5.0,M10.5.0/3"
    }
  },
  "log": {
    "h": {
      "description": "log humidity",
      "averagetime": "00:05:00",
      "filesize": "10000",
      "filename": "/humlog.txt"
    },
    "t": {
      "description": "log temperature",
      "averagetime": "00:05:00",
      "filesize": "10000",
      "filename": "/templog.txt"
    }
  }
}

env.json

JSON
device level configuration.
{
  "device": {
    "0": {
      "name": "outdoor",
      "reboottime": "24h",
      "description": "Outdoor sensor",
      "logfile": 1,
      "safemode": "false",
      "homepage":"/board.htm",
      "led": "D0",
      "button": "D4"
    }
  },
  "ota": {
    "0": {
      "port": 8266,
      "passwd": "123",
      "description": "Listen for 'over the air' OTA Updates"
    }
  },
  "ssdp": {
    "0": {
      "ModelUrl": "https://www.mathertel.de/Arduino"
    }
  }
} 

Credits

Matthias Hertel

Matthias Hertel

2 projects • 5 followers
www.mathertel.de

Comments