Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
ds3231_pi [2021/06/28 14:06]
john [Directly]
ds3231_pi [2021/07/13 15:27] (current)
john
Line 94: Line 94:
 ====== Reading the Temperature Sensor ====== ====== Reading the Temperature Sensor ======
 The folks that designed the DS3231 were very kind and made the temperature registers user-readable, so we can use it as a thermometer! How neat is that! The temperature is stored in registers 0x11 and 0x12 and is reported in 0.25ºC increments, though keep in mind the sensor is only accurate to ±3ºC. [[https://www.raspberrypi.org/forums/viewtopic.php?t=59808#p956491|This forum post]] includes a sample python script that reads those registers and displays the output. It needs to be run with root privileges, and it will briefly unload the RTC kernel module in order to access the device, though this shouldn't matter given how quickly it runs. The folks that designed the DS3231 were very kind and made the temperature registers user-readable, so we can use it as a thermometer! How neat is that! The temperature is stored in registers 0x11 and 0x12 and is reported in 0.25ºC increments, though keep in mind the sensor is only accurate to ±3ºC. [[https://www.raspberrypi.org/forums/viewtopic.php?t=59808#p956491|This forum post]] includes a sample python script that reads those registers and displays the output. It needs to be run with root privileges, and it will briefly unload the RTC kernel module in order to access the device, though this shouldn't matter given how quickly it runs.
 +
 +===== Sensors =====
 +lm-sensors includes a driver that can read the DS3231's temperature sensor. Install the lm-sensors package, then run 'sensors'.
 +
 +<code>
 +ds3231-i2c-1-68
 +Adapter: bcm2835 (i2c@7e804000)
 +temp1:        +30.8°C
 +
 +cpu_thermal-virtual-0
 +Adapter: Virtual device
 +temp1:        +48.9°C
 +</code>
  
 ===== Directly ===== ===== Directly =====
ds3231_pi.txt · Last modified: 2021/07/13 15:27 by john
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0