Smart Sensor Network

A distributed sensor network for environmental monitoring using ESP32 microcontrollers, MQTT communication, and custom PCB design.
Introduction
This project explores the creation of a distributed sensor network capable of monitoring environmental conditions across multiple locations. The system uses ESP32 microcontrollers as sensor nodes, communicating wirelessly through MQTT protocol to a central data collection hub.
The motivation for this project came from the need to monitor temperature, humidity, and air quality in different areas of a workspace, providing real-time data visualization and historical tracking capabilities.
Key features include:
- Wireless sensor nodes with battery backup
- Real-time data transmission via MQTT
- Web-based dashboard for data visualization
- Custom PCB design for compact sensor nodes
- 3D printed enclosures for weather protection
Research
Before starting the project, I conducted extensive research on wireless sensor networks and IoT communication protocols:
Communication Protocols
I evaluated several wireless communication options:
- WiFi: High bandwidth, good range, but higher power consumption
- LoRa: Low power, long range, but limited bandwidth
- Bluetooth: Low power, short range, good for local networks
- Zigbee: Mesh networking, low power, moderate range
Sensor Selection
For environmental monitoring, I researched various sensor options:
- DHT22: Temperature and humidity, good accuracy, low cost
- BME280: Temperature, humidity, and pressure, I2C interface
- MQ-135: Air quality sensor for detecting various gases
- PIR Sensor: Motion detection for occupancy monitoring
Power Management
Battery life was a critical consideration. I researched:
- Sleep modes and wake-up strategies
- Power consumption optimization techniques
- Solar charging solutions for outdoor deployment
- Battery monitoring and low-power alerts
Making Process
The development process was divided into several phases, each building upon the previous work:
Phase 1: Prototype Development
Started with breadboard prototypes to test individual components and communication protocols. This phase involved:
- Setting up ESP32 development environment
- Testing sensor readings and calibration
- Implementing basic MQTT communication
- Creating simple web dashboard for data display
Phase 2: PCB Design
Once the prototype was working, I designed custom PCBs for the sensor nodes:
- Used KiCad for schematic and PCB layout
- Designed for ESP32-S3 module with minimal external components
- Included power management circuit with battery charging
- Added connectors for various sensor modules
Phase 3: Enclosure Design
Created 3D printed enclosures for weather protection:
- Designed in Fusion 360 with parametric modeling
- Included ventilation for sensor accuracy
- Added mounting points for easy installation
- Used weather-resistant materials (PETG filament)
Phase 4: Software Development
Developed the complete software stack:
- Arduino firmware for sensor nodes
- MQTT broker setup and configuration
- Web dashboard using HTML, CSS, and JavaScript
- Database integration for data storage
Bill of Materials (BOM)
Complete list of components and materials used in this project:
Item # | Ref. | Comp # | Description | Package | Link |
---|---|---|---|---|---|
1 | U1 | ESP32-S3 | WiFi/Bluetooth SoC Module | QFN-56 | Digi-Key |
2 | U2 | BME280 | Temperature/Humidity/Pressure Sensor | QFN-8 | Adafruit |
3 | U3 | MQ-135 | Air Quality Sensor | DIP-6 | SparkFun |
4 | R1 | 10KΩ | Pull-up Resistor | 1206 | Mouser |
5 | C1 | 100µF | Power Supply Capacitor | 1206 | Digi-Key |
6 | BAT1 | 18650 | Lithium Battery 3.7V 2600mAh | 18650 | Adafruit |
Final Outcome
The completed Smart Sensor Network successfully demonstrates a working distributed monitoring system with the following achievements:
Performance Results
- Battery Life: 7-10 days continuous operation on single charge
- Range: 50-100 meters indoor, 20-30 meters outdoor
- Data Accuracy: ±0.5°C temperature, ±3% humidity
- Update Frequency: 30-second intervals during active monitoring
Key Features Delivered
- Real-time environmental monitoring dashboard
- Historical data visualization with charts and graphs
- Mobile-responsive web interface
- Alert system for threshold violations
- Data export functionality for analysis
Lessons Learned
This project taught me valuable lessons about IoT development:
- Power Management: Sleep modes are crucial for battery life
- Network Reliability: MQTT QoS levels help ensure data delivery
- Sensor Calibration: Environmental factors significantly affect readings
- Enclosure Design: Proper ventilation is essential for accurate measurements
Future Improvements
Several enhancements could be implemented in future iterations:
- Solar panel integration for indefinite operation
- Machine learning algorithms for predictive analysis
- Integration with home automation systems
- Additional sensor types (light, sound, vibration)
- Mesh networking for extended range