User Tools

Site Tools


iot:outdoortemphum

This is an old revision of the document!


Outdoor Temp/Humidity

Overview

Device Type Outdoor Temperature & Humidity Sensor
Purpose Get & send via MQTT Outdoor Temperature & Humidity
Last Updated 2026-05-15
Notes Needs a Stevenson-style enclosure

Hardware

Bill of Materials

Component Model/Part Notes
ESP32 Board Adafruit Qt Py S3 PID: 5700
Sensor Adafruit AHT20 PID: 4566
Battery Management Adafruit Solar Lithium Ion charger PID: 4755
Solar Panel Adafruit 6V/2W Solar Panel-ETFE/Voltaic-P126 PID: 5366
Battery Adafruit Lithium Ion Battery PID: 354
Cable Adafruit STEMMA QT/Qwiic JST-SH 4-pin PID: 4210
Cable Adafruit 3.5/1.1mm - 5.5/2.1mm DC Jack Adapter PID: 2788
Enclosure Custom 3d Print Use ASA filament

Pin Assignments

Pins Function Connected To Notes
GPIO 40 SCL1 AHT20 via Qwiic cable
GPIO 41 SDA1 AHT20 via Qwiic cable
GPIO 8 Battery Voltage LiPo Positive terminal A3 on the PCB
GPIO 9 Panel Voltage Solar Panel Output A2 on the PCB

Schematic / Photos

Firmware

Gitea Repo OutdoorTemp-AHT20
PlatformIO Board adafruit_qtpy_esp32s3_n4r2

Key Libraries

Library Version Purpose
IoT_Simple Latest Common to all my projects
adafruit/Adafruit AHTX0 ≥2.0 Read sensor data
knolleary/PubSubClient ≥2.8 MQTT messages
syafiqlim/ESP32_MySQL ≥0.1.0 Database writes
bblanchon/ArduinoJson ≥7.4.2 Handling JSON data

OTA / Flashing Notes

Browse to device's IP or hostname, go to 'OTA Updates', flash new firmware

MQTT Topics

Topic Direction Payload / Notes
hostName/status Publish JSON — see fields below

hostName is its DNS name based on its IPv4 address provided to iot-server

Status Payload Fields

Field Type Example Notes
device string thsPatio Device hostname (iot-server query)
type string Sensor Always “Sensor” for this device
location string Exterior Device lookup data from iot-server
ip string 10.0.0.109 Current IP
uptime integer 14404 Seconds since last boot
timestamp integer 1778899264 Unix epoch
state string Online Online or Sleeping
temperature float 68.4 Fahrenheit
humidity float 42.4 Relative humidity %

Operation

Normal Behavior

Reads the temperature & relative humidity every 10 minutes then sends
an MQTT message and writes the data to a MariaDB table on blanca.

Notes / Known Issues / Quirks

These devices use a small solar panel & 3.7v LiOn battery. Deep sleep is used to
minimize power use. It can run multiple days with no solar input.
The DC Jack adapter gets one end cut off. Wires get soldered to battery charger.

Change Log

Date Change
2026-05-16 Created this page
iot/outdoortemphum.1778982803.txt.gz · Last modified: by rmorgan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki