====== 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 [[https://en.wikipedia.org/wiki/Stevenson_screen|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 LFP 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 ==== |{{iot:OutdoorTempHum_schem.png?600x330|Outdoor Temp/Humidity}}|{{iot:OutdoorTempHumidityPhoto.jpeg?175x330|Outdoor Temp/Humidity}}| {{iot:OutdoorTempHumSchematic.pdf|Outdoor Temp/Humidity Schematic PDF}} ===== Firmware ===== | **Gitea Repo** | [[https://sneffels.portmorgan.com/gitea/rmorgan/iot-projects/src/branch/main/OutdoorTemp-AHT20|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 LFP battery. Deep sleep is used to\\ minimize power use. It can run multiple days with no solar input.\\ \\ The DC Jack adapter gets the male end cut off. Strip the wires and solder\\ directly to the VBUS & GND pads on the bq24074. ===== Change Log ===== | **Date** | **Change** | | 2026-05-16 | Created this page |