Caldor is an innovative in-situ calibration system designed for field instrumentation, allowing for convenient and accurate calibration using traceable standards. This system, developed by the FieldKit Project team at Conservify, integrates Human-Computer Interaction (HCI) principles to minimize errors and enhance data integrity in environmental sensing.
- In-Field Calibration: Enables calibration in remote locations without needing lab facilities.
- Educational Resources: Provides comprehensive guidelines on calibration procedures.
- User-Friendly Interface: Simplifies the calibration process when paired with the intuitive app.
- Versatility: Compatible with various sensors like temperature, pH, conductivity, etc.
- Data Integrity: Ensures high-quality data with traceable calibration standards.
-
Prerequisites:
Linux
Chrome
bash
git
curl
Flutter
Dart
-
Installation:
sudo apt-get update -y && sudo apt-get install
-
Initial Configuration:
dart pub get
orflutter pub get
To run: dart run
To test: dart test
or flutter test
To use the library you've provided for calculating and handling sensor calibrations, follow this step-by-step guide:
First, identify the type of sensor you need to calibrate. This could be, for example, modules.water.ph
, modules.water.do
, modules.water.ec
, or modules.water.temp
.
Use the CalibrationTemplate.forModuleKey
method to retrieve a CalibrationTemplate
that corresponds to your sensor type.
Example:
String sensorType = "modules.water.ph"; // Replace with your sensor type
CalibrationTemplate template = CalibrationTemplate.forModuleKey(sensorType);
Gather a set of CalibrationPoint
objects. Each point should include a Standard
(which could be a FixedStandard
, UnknownStandard
, or UserStandard
) and a corresponding SensorReading
(which includes both uncalibrated and calibrated values, if available).
Example:
List<CalibrationPoint> points = [
CalibrationPoint(
standard: FixedStandard(4), // Replace with actual standard value
reading: SensorReading(uncalibrated: 1.0, value: 4.0), // Replace with actual readings
),
// Add more CalibrationPoint objects as required
];
Depending on the CurveType
in your CalibrationTemplate
(either linear or exponential), use the respective function (linearCurve
or exponentialCurve
) to calculate the calibration curve coefficients.
Example:
List<double> coefficients;
if (template.curveType == CurveType.linear) {
coefficients = linearCurve(points);
} else if (template.curveType == CurveType.exponential) {
coefficients = exponentialCurve(points);
} else {
throw Exception("Unknown curve type: ${template.curveType}");
}
The coefficients
list obtained from the previous step can now be used as needed in your application. This could be for sensor data correction, display, or further processing.
If you need to serialize the calibration data (e.g., for storage or transmission), you can use the toBytes
method from CurrentCalibration
. Ensure to add all the calibration points to CurrentCalibration
before serialization.
Example:
CurrentCalibration currentCalibration = CurrentCalibration(curveType: template.curveType);
for (var point in points) {
currentCalibration.addPoint(point);
}
Uint8List serializedData = currentCalibration.toBytes();
To deserialize, you would typically use the proto.ModuleConfiguration
to parse the bytes back into a meaningful structure. This process will depend on how you handle protobuf data in your application.
For more information on the Caldor package, including how to contribute, report issues, or get support, visit our GitHub repository.