Introduction: ESP32-C3 Tiny Network Weather Station

A mini board based on the ESP32C3 controller has been released. It features a 0.42" OLED display with a resolution of 72x40 pixels. If you connect a TZT AHT20+BMP280 sensor module to it, you can easily create a network weather station or a device for measuring temperature, humidity, and pressure in a room, such as a server room.

Thanks to the WiFi interface, this module creates a website displaying the parameters, which can be imported into systems like Zabbix or PRTG. You only need to connect four wires and a USB power cable. The module is also configured via a virtual COM port over the same USB connection

Supplies

  1. TZT AHT20+BMP280 sensor board
  2. ESP32 C3 controller with 0.42" OLED display "The egg"

Step 1: Boards Connections

First, connect the ESP32 board and the sensor board as follows:

ESP32 board -> AHT20/BMP280 board

  1. GPIO 5 (SDA) -> SDA
  2. GPIO 6 (SCL) -> SCL
  3. 3.3V -> VCC
  4. GND -> GND

Step 2: Arduino IDE Setup and Compilation

Install Arduino IDE:

  1. Download Arduino IDE from arduino.cc
  2. Install on your computer

Add ESP32-C3 Support:

  1. In Arduino IDE, open File -> Preferences
  2. In "Additional Boards Manager URLs" add: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Click OK
  4. Open Tools -> Board -> Boards Manager
  5. Search for "esp32"
  6. Find "ESP32 by Espressif Systems" and install latest version
  7. Close Boards Manager

Install Required Libraries:

  1. In Arduino IDE, open included Sketch -> Include Library -> Manage Libraries or download updated version of the sketch from here
  2. Install these libraries one by one:
  3. "U8g2" by olikraus (for OLED display)
  4. "Adafruit AHTX0" (for AHT20 sensor)
  5. "Adafruit BMP280 Library" (for BMP280 sensor)
  6. "Adafruit Unified Sensor" (may install automatically)

Project Configuration:

  1. Copy the complete sketch code into Arduino IDE
  2. Select board: Tools -> Board -> ESP32 Arduino -> "ESP32-C3 Dev Module"
  3. Configure settings:
  4. CPU Frequency: 160MHz (WiFi)
  5. Flash Size: "4MB (32Mb)"
  6. Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"
  7. Upload Speed: "921600"
  8. Port: Select your ESP32-C3 COM port

Compilation and Upload:

  1. Click "Verify" (checkmark) to compile
  2. If no errors, click "Upload" (right arrow)
  3. Hold BOOT button on ESP32-C3 board when clicking upload if required
  4. Wait for upload to complete

Step 3: Usage

First Boot (Setup Mode):

  1. Open Serial Monitor: Tools -> Serial Monitor
  2. Set baud rate to 115200
  3. Press RST (Reset) button on the board
  4. Display will show "SETUP"
  5. Serial Monitor will show setup wizard

Step-by-Step Setup:

  1. Enter device name (1-6 characters), e.g., "METEO1"
  2. Wait for WiFi scan
  3. Select network from list (enter number) or 'm' for manual entry
  4. Enter WiFi password
  5. Select connection type:
  6. 1 for DHCP (automatic IP)
  7. 2 for Static IP (manual)
  8. If Static IP selected, enter IP in format: 192.168.1.100/24
  9. Enter HTTP server port (default 80)
  10. Setup completes, device reboots

Device Operation:

  1. Display cycles through 3 screens (every 5 seconds):
  2. Temperature (large)
  3. Humidity and pressure
  4. Device name, IP address, and SSID
  5. Web interface available at: http://device-IP-address:port Page auto-refreshes every 5 seconds

Serial Monitor Commands:

Type command and press Enter:

  1. help - show all commands
  2. info - show sensor data and device name
  3. net - show network settings
  4. reset - factory reset
  5. set [parameter] [value] - change setting Parameters: ip, port, ssid, passw, name Example: set name METEO2
  6. save - save current settings
  7. scan - scan for WiFi networks
  8. apply - apply settings and reboot

Changing Settings via Commands:

  1. To change name: set name NEWNAME
  2. To change WiFi: set ssid NEW_SSID
  3. Then: set passw NEW_PASSWORD
  4. To change IP: set ip 192.168.1.150/24
  5. To change port: set port 8080
  6. Save: save
  7. Apply: apply

Step 4: Troubleshooting

  1. If sensors not detected:
  2. Check connections
  3. Verify I2C addresses don't conflict
  4. Check 3.3V power
  5. If WiFi won't connect:
  6. Verify SSID and password
  7. Use scan command to find networks
  8. Ensure network is 2.4GHz
  9. If web page inaccessible:
  10. Check IP with net command
  11. Ensure device and computer on same network
  12. Check firewall settings
  13. If display not working:
  14. Check SDA/SCL connections
  15. Verify display address (0x3C)

Important:

  1. AHT20 typically uses address 0x38
  2. BMP280 typically uses address 0x77
  3. OLED typically uses address 0x3C

If addresses conflict, BMP280 often has a jumper to change address from 0x77 to 0x76.

Factory Reset:

  1. Enter command: reset
  2. Confirm: yes
  3. Device enters setup mode

Device is ready after first successful setup. Settings are stored in non-volatile memory and restored after power cycle.