-
-
Notifications
You must be signed in to change notification settings - Fork 1
Analog sensor
Guillem Castro edited this page May 1, 2019
·
1 revision
When using a Configuration object, the configuration file must contain at least the following parameters,
{ // Root node //
"sensors": { // Section //
"<sensor name>::text": { // Tree node //
"name": "<sensor name>::text", // Leaf node //
"topic": "<topic>::text",
"sampling_rate": <sampling_rate>::real,
"zero": <zero>::real,
"span": <span>::real,
"quantization_bits": <quantization_bits>::unsigned integer,
"zero_voltage": <zero_voltage>::integer,
"span_voltage": <span_voltage>::integer
}
}
}
The explanation of the meaning of each parameter follows,
- name: A text identifier for the sensor. Must be unique.
- topic: The topic where the sensor will publish its data to.
- sampling rate: The rate in nanoseconds at which the framework will sample the sensor.
- zero: The voltage at which the ADC reads the lowest value
- span: The voltage at which the ADC reads the highest value
- scale: The maximum value that can be read by the sensor
- quntization bits: The resolution of the ADC in bits
- zero voltage: The lowest possible voltage at which the ADC reads a value (tipically 0)
- span voltage: The maximum possible voltage at which the ADC reads a value (tipically 5 or 3.3)