Quick overview — Which sensor for which use case
Common sensor types and their best-fit use cases.
- Temperature: constant environmental monitoring, freezer alarms, incubators.
- Humidity: desiccation needs, fermentation, or HVAC verification.
- CO2: air quality, occupancy estimation, and grow environments.
- PIR motion: presence detection, security triggers, and simple occupancy analytics.
- NMEA / serial sensors: boat electronics, GPS receivers, and legacy instrument testbeds.
Use case examples:
- Basic climate logging: temperature and humidity in closets or server racks.
- Safety monitoring: CO2 and ventilation alarms in enclosed rooms.
- Automation triggers: motion-based lighting or HVAC adjustments.
- Diagnostics: an NMEA testbed for verifying serial sensors and converters.
Parts & tools (BOM)
Choose components by cost tier and target accuracy.
Recommended sensors and controllers
- Budget: DHT22 / AM2302 for low-cost humidity/temperature; basic PIR modules for motion.
- Mid-range: DS18B20 temperature probes; BME280 for combined pressure/temperature/humidity; Sensirion SCD4x series for CO2.
- High-accuracy / industrial: calibrated CO2 sensors, PT100/PT1000 probes with proper ADCs.
- Controllers: ESP32 for low-power Wi‑Fi nodes; Raspberry Pi for heavier tasks, serial bridging, and gateways.
Accessories and tools
- Breadboards, jumper wires, soldering tools, and enclosures with ventilation or IP rating as needed.
- Power: USB supplies, LiPo with charging circuits, or PoE adapters for Pi.
- Optional: logic level shifters and real-time clock modules for reliable timestamps.
Cost considerations
Budget nodes can be inexpensive but may require frequent calibration and protection; regulatory or high-accuracy needs demand higher-cost sensors and traceable calibration.
Step-by-step builds
Each build outlines concept, connections, sampling strategy, and integration tips without platform-specific config examples.
Temperature & humidity with ESP32 and a combined sensor
Concept: ESP32 plus combined temperature/humidity sensor for compact, low-power nodes that publish to a local broker or HTTP endpoint.
Key steps
- Mount sensor in a ventilated enclosure away from heat sources and direct sunlight.
- Wire data and power to the ESP32, observing voltage and wiring practices.
- Choose sampling interval (30s–5min depending on volatility) and debounce transient spikes.
- Implement watchdog and reconnect logic to resume reporting after network interruptions.
Integration tips
- Label each device with a human-readable location and sensor type for clear dashboards.
- Store timestamps at the edge if the central server may be unreachable briefly.
CO2 monitor with Sensirion SCD4x
Concept: Sensirion SCD4x family CO2 sensor for reliable indoor air quality monitoring and ventilation control.
Key steps
- Allow warm-up after power-on and place where air mixes well.
- Implement baseline correction or manufacturer calibration routines to reduce drift.
- Report at longer intervals for battery devices; use shorter intervals for active ventilation control.
Practical note: Avoid mounting near windows, vents, or users' mouths for representative room averages.
PIR alarm with Raspberry Pi
Concept: Raspberry Pi for edge processing, event logging, and alerts based on motion detection.
Key steps
- Connect PIR to a GPIO pin and set up debounce to avoid repeated triggers.
- Run local scripts to timestamp events and push alerts to messaging or logging systems.
- Use the Pi to bridge to MQTT or forward logs to Graylog for long-term analysis.
Security tip: Secure SSH and services and isolate sensor networks from your primary network when possible.
NMEA sensor testbed (boat / serial sensors)
Concept: Raspberry Pi serial gateway to read, log, and replay NMEA data for development and testing.
Key steps
- Provide proper voltage isolation and level conversion for serial instruments.
- Capture raw sentences to a local log to validate parsing libraries.
- Simulate sensors by replaying logs during integration testing.
Use case: Validate dashboards and downstream parsers without live hardware attached.