Basic Analog Sensor
TheAnalogSensV2 class simplifies reading analog sensors and converting to voltage values.
Source:
/home/daytona/workspace/source/example/sensors/SensorModuleV2/SensorList/AnalogSensV2/BasicAnalogSensor/BasicAnalogSensor.ino:1
Custom Analog Sensor with Callback
Convert raw analog values to meaningful measurements using a custom callback function:/home/daytona/workspace/source/example/sensors/SensorModuleV2/SensorList/AnalogSensV2/CustomAnalogSensor/CustomAnalogSensor.ino:1
Multiple Analog Sensors with Filters
Manage multiple analog sensors with filtering and alert systems:/home/daytona/workspace/source/example/sensors/SensorModuleV2/SensorList/AnalogSensV2/MultipleAnalogSensors/MultipleAnalogSensors.ino:1
Sensor Calibration
Calibrate analog sensors for accurate real-world measurements:/home/daytona/workspace/source/example/sensors/SensorModuleV2/SensorList/AnalogSensV2/AnalogWithCalibration/AnalogWithCalibration.ino:1
Wiring Diagram
Basic Analog Sensor
Voltage Divider (for 5V sensors on 3.3V boards)
Filter Types
Moving Average Filter
- Smooths noisy signals
- Window size determines smoothing strength
- Best for slowly changing values
Kalman Filter
- Advanced filtering for dynamic systems
- Process noise: system uncertainty
- Measurement noise: sensor noise
Available Values
AnalogSensV2
raw- Raw ADC value (0-1023 or 0-4095) (int)volt- Voltage value in volts (float)
Custom Values
Add custom values usingaddCustomValue() and update in the callback function.
Next Steps
Digital Sensors
Learn about I2C and digital sensor interfaces
Multi-Sensor Systems
Combine analog and digital sensors