Overview
Kinematrix provides a powerful and unified sensor framework that makes reading sensor data simple and consistent. The SensorModuleV2 system supports multiple sensor types with a common API, automatic updates, and type-safe data access.Quick Start
Reading a Single Sensor
Here’s how to read data from a DHT22 temperature and humidity sensor:Reading Analog Sensors
Analog sensors like potentiometers, light sensors, and voltage dividers use the AnalogSensV2 class:Using SensorModuleV2 for Multiple Sensors
The SensorModuleV2 class manages multiple sensors with a unified interface:Available Sensor Types
Kinematrix supports a wide range of sensors:| Sensor Type | Class Name | Use Case |
|---|---|---|
| DHT11/DHT22 | DHTSensV2 | Temperature & humidity |
| BME680 | BME680SensV2 | Environmental monitoring (temp, humidity, pressure, gas) |
| Analog | AnalogSensV2 | Potentiometers, light sensors, voltage monitoring |
| INA219 | INA219SensV2 | Current & voltage monitoring |
| MQ Gas | MQSensV2 | Gas detection (CO, CO2, smoke) |
| MLX90614 | MLX90614SensV2 | Infrared temperature |
| GP2Y Dust | GP2YDustSensV2 | Air quality |
| RTC | RTCSensV2 | Real-time clock |
| MHRTC | MHRTCSensV2 | Multi-harmony RTC |
Data Access Methods
SensorModuleV2 provides multiple ways to access sensor data:Direct Access with Brackets
Typed Getters
Check for Updates
Key Concepts
Automatic Updates
Sensors automatically read and update their values based on configured intervals.
Type Safety
Use typed methods like
getFloatValue() and getIntValue() for type-safe data access.JSON Integration
All sensor data is stored in JSON documents for easy serialization and transmission.
Unified API
All sensors share the same update/read pattern regardless of hardware interface.
Common Parameters
AnalogSensV2 Constructor
pin: Analog pin (A0, A1, etc.)referenceVoltage: ADC reference voltage (3.3V or 5.0V)maxValue: Maximum ADC value (1023 for 10-bit, 4095 for 12-bit)
DHTSensV2 Constructor
pin: Digital pin numbertype: Sensor type (DHT11,DHT22,DHT21)
Next Steps
IoT Data Logger
Learn to log sensor data with timestamps and filters
LED Control
Control LEDs and outputs based on sensor readings
Multi-Platform Development
Deploy across ESP32, ESP8266, and Arduino platforms
Debugging
Debug your sensor applications effectively