upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the Veris TEX00 Temperature Sensor. More...
The Veris TEX00 temperature sensor family is made up of a series of RTD thermistors in wall mount packaging.
This driver was developed using the TED00, which utilizes a 10K Ohm Type 2 thermistor. However, this driver can support the other 12 variants of the TE series as well by providing the correct sensor type to the class constructor. These other sensor types have not been tested. Only the TED00 was tested with this driver.
This sensor must be connected as part of a voltage divider, with the balancing resistor ideally matched to the sensor's 25C detection range. For the TED00 (10kt2), a 10K Ohm (1% tolerance) resistor was used in a circuit like the following:
GND o-—|TED00(10k2)|-—o-—|balanceResistor(10K)|-—o VCC (+5vdc) | | |-—o A0 (analog input to MCU)
A 3.3vdc voltage can be used as well if desired.
Public Member Functions | |
TEX00 (int tPin, float balanceResistor, SENSOR_TYPES_T stype, float aref=TEX00_DEFAULT_AREF) | |
~TEX00 () | |
void | update () |
float | getTemperature (bool fahrenheit=false) |
float | getTemperatureRangeMin () |
float | getTemperatureRangeMax () |
bool | isOutOfRange () |
Protected Member Functions | |
float | thermistor (float ohms) |
Protected Attributes | |
mraa::Aio | m_aioTemp |
TEX00 | ( | int | tPin, |
float | balanceResistor, | ||
SENSOR_TYPES_T | stype, | ||
float | aref = TEX00_DEFAULT_AREF |
||
) |
TEX00 object constructor
tPin | Analog pin to use for temperature. |
balanceResistor | Resistance (in Ohms) of the balance resistor used in your voltage divider. |
stype | The sensor type. One of the SENSOR_TYPES_T values. |
aref | The analog reference voltage, default 5.0 |
void update | ( | void | ) |
Read current values from the sensor and update internal stored values. This method must be called prior to querying any values, such as temperature.
float getTemperature | ( | bool | fahrenheit = false | ) |
Get the current temperature. update() must have been called prior to calling this method.
fahrenheit | true to return the temperature in degrees fahrenheit, false to return the temperature in degrees celsius. The default is false (degrees Celsius). |
float getTemperatureRangeMin | ( | ) |
Return the smallest temperature that can be measured by the current sensor.
float getTemperatureRangeMax | ( | ) |
Return the largest temperature that can be measured by the current sensor.
|
inline |
Detect whether the last measurement exceeded the sensors detection range. update() must have been called prior to calling this method.