No description
- Python 100%
| .gitignore | ||
| config.sample.py | ||
| main.py | ||
| README.md | ||
ESP32 + AHT20
Written in MicroPython, reads temperature and humidity from an AHT20 sensor and sends them to InfluxDB or MQTT broker.
Installation
- Download MicroPython here
- Then flash it to your microcontroller, ESP32 for example:
esptool.py -p /dev/ttyACM0 erase_flash
esptool.py -p /dev/ttyACM0 --baud 460800 write_flash 0 ESP32_GENERIC_C3-20251209-v1.27.0.bin
Get the dependencies:
- AHTx0 driver: https://github.com/targetblank/micropython_ahtx0
- My helper functions (InfluxDB, MQTT) for MicroPython: https://code.f2n.me/finn/MicroPythonHelpers
mpremote mip install "github:targetblank/micropython_ahtx0/ahtx0.py"
mpremote mip install "https://code.f2n.me/finn/MicroPythonHelpers/raw/branch/main/package.json"
Use Thonny (graphical IDE) or ampy (CLI) to flash the files to the microcontroller.
Example with ampy:
ampy --port /dev/ttyACM0 put main.py
ampy --port /dev/ttyACM0 put config.py
Wiring
3V3, GND, SDA, SCL