https://github.com/castillodelsol/genericsensor
A lightweight, modular C++ framework for precision sensor data processing — designed for microcontrollers (Arduino, ESP32, STM32) and laboratory-grade applications. Implements fast, numerically stable function mappers, filters, and measurement processors for resistive temperature devices (RTDs) and generic analog sensors.
https://github.com/castillodelsol/genericsensor
Last synced: 8 months ago
JSON representation
A lightweight, modular C++ framework for precision sensor data processing — designed for microcontrollers (Arduino, ESP32, STM32) and laboratory-grade applications. Implements fast, numerically stable function mappers, filters, and measurement processors for resistive temperature devices (RTDs) and generic analog sensors.
- Host: GitHub
- URL: https://github.com/castillodelsol/genericsensor
- Owner: CastilloDelSol
- License: mit
- Created: 2025-10-18T08:27:03.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-10-18T09:33:57.000Z (8 months ago)
- Last Synced: 2025-10-19T05:53:57.540Z (8 months ago)
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GenericSensor-Processing Framework (v0.1.2)
A lightweight, modular C++ framework for precision sensor data processing — designed for microcontrollers (Arduino, ESP32, STM32) and laboratory-grade applications.
Implements fast, numerically stable function mappers, filters, and measurement processors for resistive temperature devices (RTDs) and generic analog sensors.
---
## ✳️ Features
- **Callendar–Van Dusen RTD Processor**
- Supports any platinum RTD with α = 0.00385 (IEC 60751)
- Exact quadratic solution for T ≥ 0 °C
- Minimax-corrected seeded double Newton step for T < 0 °C
- Universal normalization (`R/R₀`) → works with Pt100, Pt500, Pt1000
- Accuracy: full float accuracy.
- Valid range: −200 °C … +661 °C
- **Polynomial Mapper**
- Efficient Horner-form evaluation (supports any order)
- Coefficients defined as static `constexpr` arrays
- Useful for custom transfer functions or pre-calibrated sensors
- **Filter Chain Framework**
- Generic `BaseFilter`, `EMAFilter`, and extensible design for multi-stage signal conditioning
- Low overhead, ideal for ADC streaming pipelines
- **Generic Sensor Abstraction**
- Unified interface for mappers, filters, and processors
- Enables plug-and-play measurement pipelines
---
## 🧮 RTD CVD 385 Processor
Header: `RTD_385.h`
```cpp
#include "RTD_385.h"
RTD385 rtd(100.0f); // Pt100, default constants for α=0.00385
void loop() {
int raw = readADC(); // resistance in ohms
float T = rtd.apply(R); // temperature in °C
Serial.println(T, 6);
}
```
**Internally:**
- For T ≥ 0 °C: exact quadratic inverse
- For T < 0 °C: quadratic seed + minimax correction → two Newton steps
---
## ⚙️ Structure
```
IMeasurementProcessor (interface)
├── BaseMapper (generic transformation interface + config)
│ ├── BaseTableProcessor (shared logic for table-based transforms)
│ │ ├── PiecewiseLinearTable
│ │ └── CubicSplineTable
│ └── PolynomialMapper
└── BaseFilter (generic filter base class + config)
├── EMAFilter
├── SMAFilter
├── AlphaBetaFilter
├── ButterworthFilter
├── Kalman1DFilter
├── LowPassFilter
├── HighPassFilter
├── BiquadFilter
├── MedianFilter
├── WMAFilter
└── FIRFilter
```
All modules are header-only and can be used independently.
---
## 📦 Installation
Copy the headers into your project or platform-specific `include/` directory, or use as an Arduino library:
```bash
git clone https://github.com/.git
```
Then include the desired modules:
```cpp
#include "RTD_385.h"
```
---
## 🧾 License
MIT License © 2025 Your Name
See `LICENSE` for details.
---
## 🧭 Version History
| Version | Date | Notes |
|----------|------|-------|
| **v0.1.0** | 2025-10-18 | Initial public release — full CVD RTD processor, filter & mapper base classes |
---
**Precise. Efficient. Embedded-ready.**