Logs temperature, humidity and moisture of plant soil using MicroPython.
- Microcontroller: ESP-WROOM32 DEVKIT 1
- Temperature & humidity sensor: DHT20
- Moisture sensor: Geekus Soil Sensor
- Micro SD slot: 3.3V Mini TF
- Micro SD card: Any card, formatted to FAT32 without any partitions.
Component | Pin Name | Pin # |
---|---|---|
SD Card | MISO | 19 |
SD Card | MOSI | 23 |
SD Card | SCK | 18 |
SD Card | CS | 5 |
DHT20 | SCL | 14 |
DHT20 | SDA | 13 |
Moisture | ADC | 36 |
Built-in LED | 2 |
esptool.py --chip esp32 erase_flash
Build micropython locally
# compile micropython
cd micropython/
make clean
make submodules
make BOARD=ESP32_GENERIC
# write firmware to device
esptool.py --chip esp32 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 4MB --flash_freq 40m 0x1000 build-ESP32_GENERIC/bootloader/bootloader.bin 0x8000 build-ESP32_GENERIC/partition_table/partition-table.bin 0x10000 build-ESP32_GENERIC/micropython.bin
Initial RTC clock:
mpremote rtc --set
Copy *.py
files to device
mpremote fs cp src/*.py :
Add SD-card and reboot device. The LED will flicker every 30 seconds as data is collected.
MIT