Overview
Sensor Module V2 is a modern, type-safe sensor management framework providing advanced features including real-time filtering, comprehensive alert systems, interactive calibration, and extensive debugging capabilities. Built with template-based APIs and optimized memory management.Core Architecture
Supported Sensors (14+)
Environmental Sensors
DHTSensV2 - Temperature & Humidity
DHTSensV2 - Temperature & Humidity
Supports DHT11, DHT22, and DHT21 sensors.Available Values:
temperature- Temperature in Celsiushumidity- Relative humidity percentageheatIndex- Calculated heat index
BME680SensV2 - Environmental Sensor
BME680SensV2 - Environmental Sensor
Comprehensive environmental monitoring with temperature, humidity, pressure, altitude, and gas resistance.Available Values:
temperature- Temperature in °Chumidity- Relative humidity %pressure- Barometric pressure in hPaaltitude- Calculated altitude in metersgas- Gas resistance in Ohms (air quality)
GP2YDustSensV2 - Air Quality
GP2YDustSensV2 - Air Quality
Sharp GP2Y1010AU0F dust/particle sensor for air quality monitoring.Available Values:
dustDensity- Particle density in μg/m³voltage- Sensor voltage outputraw- Raw ADC value
Industrial Sensors
INA219SensV2 - Power Monitor
INA219SensV2 - Power Monitor
Precision current, voltage, and power measurement.Available Values:
voltage- Bus voltage in Vcurrent- Current in mApower- Power in mWshuntVoltage- Shunt voltage in mV
MLX90614SensV2 - IR Temperature
MLX90614SensV2 - IR Temperature
Non-contact infrared temperature sensor.Available Values:
ambient- Ambient temperature in °Cobject- Object temperature in °C
MQSensV2 - Gas Sensor
MQSensV2 - Gas Sensor
Comprehensive MQ series gas sensor support with multi-gas detection.Configuration:
Time & Clock Sensors
Real-Time Clock Sensors
Real-Time Clock Sensors
Supports multiple RTC modules: DS1307, DS3231, PCF8523, PCF8563.Available RTC Classes:
RTCDS1307SensV2- Basic RTCRTCDS3231SensV2- High-precision temperature-compensated RTCRTCPCF8523SensV2- Low-power RTCRTCPCF8563SensV2- Ultra-low-power RTC
year,month,dayhour,minute,seconddayOfWeek(0-6, Sunday=0)
MHRTCSensV2 - Minimal Hardware RTC
MHRTCSensV2 - Minimal Hardware RTC
Software-based RTC using millis() with time persistence.
General Purpose Sensors
AnalogSensV2 - Flexible Analog Input
AnalogSensV2 - Flexible Analog Input
General-purpose analog sensor with custom data processing callbacks.Default Values:
raw- Raw ADC reading (0-1023/4095)volt- Calculated voltage
AbstractSensV2 - Virtual Test Sensor
AbstractSensV2 - Virtual Test Sensor
Virtual sensor for testing and development with multiple signal patterns.Available Test Signals:
value- Main test valuerandom- Random valuessine- Sine wave patterncosine- Cosine wave patternsquare- Square wave (0/1)triangle- Triangle wavecounter- Incrementing counter
Advanced Features
Type-Safe Data Access
V2 provides compile-time type safety:Update Status Tracking
Value Metadata
Sensors can provide metadata about their values:Sensor Proxy Access
Debugging and Monitoring
Debug Methods
Example Debug Output
Complete Example
Best Practices
Type Safety: Always use the correct type when calling
getValue<T>():Next Steps
Filtering
Learn about real-time signal filtering
Alerts
Configure threshold-based alerts
Calibration
Interactive sensor calibration
Sensor Module V1
View legacy sensor framework