FiPy Temperature Sensor
-
It have, temperature sensor?
-
@lloureiro so the answer depends on what temperature you want to measure: the CPU temperature or the ambient temperature.
For the former you can use
machine.temperature
as suggested by @rcolisteteFor the latter you’ll need an external sensor. The Pysense board has one (though at least on the first version it wasn’t perfect due to not being isolated enough from sources of heat such as the CPU, IIRC). Or you could connect any external temperature sensor using SPI or I2C or any number of other interfaces. I would not recommend a sensor with an analog output as the ESP32 ADCs are not very precise.
-
@jcaron Yes, it is the ESP32 internal temperature sensor, always reading above the environment temperature (15-25 C more).
-
@rcolistete that’s probably the CPU’s temperature, which is most certainly quite different from ambient temperature, isn’t it?
-
@rcolistete Thank you for booth answers :)
-
Yes, it has the MCU temperature, use
machine.temperature()
, but it is not yet documented... (even the Pycom development documentation) :import machine machine. # type <Tab> keyboard to see the all objects of the machine context __class__ __name__ main ADC BROWN_OUT_RESET CAN DAC DEEPSLEEP_RESET HARD_RESET I2C PIN_WAKE PWM PWRON_RESET PWRON_WAKE Pin RMT RTC RTC_WAKE SD SOFT_RESET SPI Timer Touch UART ULP_WAKE WAKEUP_ALL_LOW WAKEUP_ANY_HIGH WDT WDT_RESET deepsleep disable_irq enable_irq flash_encrypt freq idle info mem16 mem32 mem8 pin_sleep_wakeup remaining_sleep_time reset reset_cause rng secure_boot sleep temperature unique_id wake_reason machine.temperature() # in F 116 (_ - 32)/1.8 # in C 46.66667