pyupm_temperature module

class pyupm_temperature.Temperature(pin, scale=1.0, r0=100000, b=4275)[source]

Bases: object

API for NTC Temperature Sensors.

ID: temperature

Name: Analog Temperature Sensor

Other Names: Grove Temperature Sensor

Category: temp

Manufacturer: seeed


Connection: analog

Kit: gsk Basic UPM module for analog temperature sensors. These sensors use a NTC thermistor to measure ambient temperature. This driver was developed using the Grove Temperature Sensor. The conversion formula has been updated to work with versions 1.1 and 1.2 of the sensor. For the older v1.0 sensor you will have to specify R0 and B values when initializing the device. The range of this sensor is -40 to 125 C and accuracy is +/- 1.5 C.

C++ includes: temperature.hpp


std::string name()

Provided for compatibility with old grove base class

Sensor name


float raw_value()

Gets the raw value from the AIO pin

Raw value from the ADC


int value()

Gets the temperature in Celsius from the sensor

Normalized temperature in Celsius