This project simulates the core logic of an IoT sensor node designed for ESP32-based edge monitoring applications.
The node is intended to:
- acquire sensor data
- apply lightweight edge filtering
- detect events locally
This project demonstrates the architecture of an ESP32-style IoT sensor node designed for edge monitoring and cloud-ready telemetry applications.
The project includes:
- simulated sensor data acquisition
- edge-side filtering
- threshold-based event detection
- firmware-style sample-by-sample node logic
- telemetry packet generation
- heartbeat/status messaging
- MQTT-ready topic routing
- Azure-ready telemetry schema design
This project highlights skills in:
- IoT system architecture
- Embedded-oriented firmware logic
- Edge filtering and event detection
- Telemetry design
- MQTT-style communication flow
- Azure-ready cloud integration thinking
- simulate a real-time sensor stream
- apply lightweight edge filtering
- detect threshold-based events locally
- generate telemetry, heartbeat, and event packets
- organize a mock MQTT telemetry flow
- build Azure-ready packet structures for future cloud integration
A time-series sensor signal is simulated with:
- baseline dynamics
- Gaussian noise
- injected event spikes
This represents the behavior of a real embedded sensing system under noisy operating conditions.
A lightweight moving-average filter is applied to the raw signal to mimic edge-side preprocessing on a constrained embedded device.
Threshold-based logic is used to detect relevant signal events locally on the node.
This reflects a common IoT pattern:
- collect raw signal
- preprocess locally
- trigger event-driven communication when needed
A firmware-style node class was developed to simulate ESP32-like sample-by-sample execution.
The node performs:
- filtering
- event detection
- telemetry packet generation
- heartbeat generation
A mock MQTT broker and publisher were implemented to test:
- telemetry publishing
- heartbeat topic flow
- event topic flow
- topic-based routing structure
A cloud-ready telemetry schema was added with:
- device metadata
- firmware version
- message type
- signal quality
- heartbeat status
- event severity
This makes the project closer to real Azure IoT integration patterns.
The initial stage of the project established:
- raw sensor signal simulation
- edge-side filtering
- local event detection
This created the core sensing and signal-processing logic for the rest of the system.
A step-based ESP32-style node implementation was built to support:
- one-sample-at-a-time processing
- telemetry packet creation
- heartbeat logic
- local event flagging
Generated packet counts:
- Telemetry packets: 601
- Heartbeat packets: 31
This confirms the node behaves as a periodic telemetry source with background health monitoring.
A mock MQTT pipeline was created to simulate:
- telemetry publishing
- heartbeat publishing
- event-based publishing
- topic routing
Generated packet counts:
- Telemetry packets: 601
- Heartbeat packets: 31
- Event packets: 48
This stage demonstrates an IoT-ready message flow architecture without requiring a live broker.
The telemetry system was extended with Azure-style packet structures that include:
- device ID
- device type
- firmware version
- location
- cloud timestamp
- message type
- signal quality
- heartbeat status
- event severity
Generated packet counts:
- Telemetry packets: 601
- Heartbeat packets: 31
- Event packets: 48
This confirms that the node and telemetry architecture are ready for future Azure IoT Hub integration.
esp32-iot-sensor-node/
β
βββ src/
β βββ main.py
β βββ esp32_node.py
β βββ test_esp32_node.py
β βββ mqtt_client_mock.py
β βββ test_mqtt_pipeline.py
β βββ azure_packet_builder.py
β βββ test_azure_ready_pipeline.py
β
βββ data/
βββ results/
βββ figures/
β
βββ README.md
βββ requirements.txt
Install dependencies:
pip install numpy matplotlib pandasRun the baseline sensor processing stage:
python src/main.pyRun the firmware-style ESP32 node simulation:
python src/test_esp32_node.pyRun the MQTT-ready telemetry pipeline:
python src/test_mqtt_pipeline.pyRun the Azure-ready telemetry pipeline:
python src/test_azure_ready_pipeline.pyThe project generates:
- filtered signal plots
- event detection plots
- firmware-style packet flow outputs
- MQTT-ready telemetry logs
- Azure-ready telemetry logs
- packet summaries
- sample packet JSON files
- simulated sensor acquisition
- lightweight edge filtering
- local threshold-based event detection
- firmware-style node execution
- telemetry packet generation
- heartbeat packet generation
- MQTT-ready topic routing
- Azure-ready message structure
- cloud-oriented metadata and status fields
- connect the pipeline to a real MQTT broker
- connect the node to Azure IoT Hub
- add reconnect logic and buffering
- add configuration updates / remote parameter control
- deploy the logic on real ESP32 hardware
- support multiple sensor channels
- add anomaly detection beyond simple threshold logic
This project demonstrates how an IoT sensor node can be designed from the edge to the cloud:
- sensing
- filtering
- event detection
- telemetry generation
- heartbeat monitoring
- MQTT-style transport
- Azure-ready telemetry schema
It provides a strong system-level example of embedded IoT architecture and cloud-ready telemetry design.
Hossein Electronics Engineer







