🌡 ESP32 Sensing

Environmental monitoring with ESP32, sensors, Wi-Fi, and MQTT

Overview

Use ESP32 microcontrollers with a range of sensors to monitor the environment. Data is sent over Wi-Fi via MQTT to the shared Node-RED dashboard, where it can be visualised and analysed alongside data from other strands.

🧰 Kit List

  • ESP32 development board (e.g. ESP32-WROOM-32)
  • Micro USB cable
  • Breadboard and jumper wires
  • DHT22 temperature & humidity sensor
  • BMP280 barometric pressure sensor
  • LDR (Light Dependent Resistor) + 10k resistor
  • Soil moisture sensor (optional)
  • OLED display (SSD1306, 0.96" I2C) for local readout
  • Wi-Fi router (shared intranet)
  • Raspberry Pi running Node-RED + Mosquitto MQTT broker

🎓 What You Will Learn

  • MicroPython programming on ESP32
  • Reading analogue and digital sensors
  • Sensor calibration and data accuracy
  • Wi-Fi networking and MQTT protocol
  • Publish/subscribe messaging pattern
  • Data visualisation on Node-RED dashboards
  • Environmental science: weather, microclimates
  • Data sampling intervals and averages

🌐 Cross-Curricular Links

  • Science: Thermal energy, humidity, air pressure, weather systems
  • Maths: Averages, data sampling, calibration curves, unit conversion
  • Geography: Microclimates, weather data collection, environmental monitoring
  • DT: Enclosure design for outdoor deployment
  • English: Data interpretation, report writing, technical documentation

🛠 Key Skills

  • MicroPython text-based programming
  • Breadboard circuit building
  • I2C and analogue sensor interfacing
  • Network debugging (Wi-Fi, MQTT)
  • Scientific data collection methods

Projects

From blinking an LED to a full weather station.

Project 1: ESP32 Hello World

KS3

Set up MicroPython on the ESP32. Blink an LED. Read the built-in hall sensor. Print values to the serial console. Get comfortable with the workflow.

Project 2: Temperature & Humidity

KS3 / KS4

Wire up a DHT22 sensor. Read temperature and humidity. Display values on an OLED screen. Understand analogue vs digital sensors.

Project 3: Wi-Fi & MQTT

KS4

Connect the ESP32 to the intranet Wi-Fi. Publish sensor data to an MQTT broker on the Raspberry Pi. Subscribe to topics from Node-RED.

Project 4: Dashboard Integration

KS4

Create Node-RED flows that subscribe to your MQTT topics. Build dashboard widgets: gauges for temperature, charts for humidity over time, alerts for thresholds.

Project 5: Multi-Sensor Weather Station

Stretch

Combine DHT22, BMP280, and LDR into a complete weather station. Log data over time. Compare indoor vs outdoor readings. Calculate heat index.

Project 6: Soil & Plant Monitor

Stretch

Add a soil moisture sensor. Monitor a plant's environment: light, temperature, soil moisture. Set up dashboard alerts when the plant needs watering.

Baton Pass Checklist

Before you hand over to the next group:

  • Completed your digital project card with screenshots of dashboard
  • ESP32 connecting to Wi-Fi and publishing MQTT data reliably
  • Breadboard wiring diagram or annotated photo
  • MicroPython code saved and commented
  • Node-RED flow exported as JSON
  • Sensor calibration notes (any offsets applied)
  • 5-minute walkthrough for the next group