Skip to content
← All projects

Hardware & Software

Wireless Sensor Network

Three ESP32 sensor nodes on breadboards around the gateway board and its row of status LEDs

Project Overview

A wireless environmental monitoring system using battery powered ESP32 sensor nodes that measure temperature, humidity and light across three locations. A central gateway collects everything and sends it to MATLAB for live plotting and logging.

System Specifications

Three sensor nodes each carry a DHT22 and a BH1750 and run off 4x AA batteries. The gateway stays on all the time, keeps track of all three nodes, drives 8 status LEDs, and forwards everything to MATLAB over TCP.

Components of Wireless Sensor Network
ComponentQtyDetails
ESP3243 sensor nodes and 1 gateway
DHT223Temperature and humidity, one per node
BH1750FVI3Light level in lux, one per node
4x AA batteries3 setsOne set per sensor node
LEDs, 470Ω resistors8Status LEDs, all on the gateway

System Logic and Operation

Logic

Deep Sleep and ESP-NOW

Each node wakes from deep sleep, takes a reading, sends it to the gateway over ESP-NOW, tells the gateway how long it is about to sleep for, then powers down again. Reconnecting to WiFi on every wake would take 1 to 3 seconds and a lot of battery current, so only the always-on gateway joins WiFi, and it pays that startup cost once.

Operation

  1. Wake and Read: The sensors get about 2 seconds to settle before the first reading, and the DHT22 is retried once if its first read comes back invalid.

  2. Send: A node always sends a data packet, even when a sensor has failed. A failed reading goes out as -999 with its flag set to false, so a broken sensor never makes the whole node look offline.

  3. Sleep: The node announces a 360 second sleep, which works out to 10 readings an hour. The gateway expects it back within that time plus a 25 second grace window, and flags it as unreachable if it is late.

Scope and Limitations

The gateway's WiFi and ESP-NOW share one radio, so both have to sit on the same channel. The gateway has landed on channel 1 both times it has connected so far; if it ever lands on another, the nodes would stop reaching it without much warning. Its IP address comes from DHCP, so the MATLAB script has to be updated when it changes. And a sleeping node cannot be reset remotely, because ESP-NOW only reaches devices that are awake.

Testing and Maintenance

The core system is built and working end to end, from the nodes to the gateway to MATLAB, including live plotting and logging. All three nodes and the gateway have since been redesigned as custom PCBs in KiCad.

Build log for Wireless Sensor Network
DateAdjustment MadeOutcome
23.06.2026Test 1: backyard, basement and bedroom, about 7.5 hoursNo timeouts or sensor faults