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 4400mAh | 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 | | |
Pin Assignments
| Pins | Function | Connected To | Notes |
| GPIO 40 | SCL1 | AHT20 | via Qwiic cable |
| GPIO 41 | SDA1 | AHT20 | via Qwiic cable |
Schematic / Photos
Firmware
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 5 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 |