MLAB-project / pymlab

Library for interfacing with MLAB modules in Python
https://www.mlab.cz
GNU General Public License v3.0
10 stars 1 forks source link

SHT25 sensor temperature resolution #1

Closed kaklik closed 8 years ago

kaklik commented 10 years ago

SHT25 temperature sensor output seem to have improper granularity around 0.75 deg.

kaklik commented 7 years ago

This issue was correctly solved by adding SMBus_read_i2c_block and SMBus_write_i2c_block method to python-smbus module. https://github.com/MLAB-project/i2c-tools/blob/master/py-smbus/smbusmodule.c#L560-L607

This code improvement was verified on ODROID-C1+ with SHT31 sensor which has the same problem with data readout.

geozor@odroid:~/repos/pymlab/examples$ sudo ./sht31_example.py 1
SHT31 sensor readout example 

Sensor status: {'Heater': False, 'System_reset': False, 'Invalid_command': False, 'Checksum': 225, 'Alert_pending': False, 'T_alert': False, 'RH_alert': False, 'Invalid_checksum': False} Temperature and Humidity: (22.679484245059896, 55.95941100175479)
Sensor status: {'Heater': False, 'System_reset': False, 'Invalid_command': False, 'Checksum': 225, 'Alert_pending': False, 'T_alert': False, 'RH_alert': False, 'Invalid_checksum': False} Temperature and Humidity: (22.679484245059896, 55.99298084992752)
Sensor status: {'Heater': False, 'System_reset': False, 'Invalid_command': False, 'Checksum': 225, 'Alert_pending': False, 'T_alert': False, 'RH_alert': False, 'Invalid_checksum': False} Temperature and Humidity: (22.69283588921951, 55.93804837109941)
Sensor status: {'Heater': False, 'System_reset': False, 'Invalid_command': False, 'Checksum': 225, 'Alert_pending': False, 'T_alert': False, 'RH_alert': False, 'Invalid_checksum': False} Temperature and Humidity: (22.69283588921951, 55.95941100175479)
Sensor status: {'Heater': False, 'System_reset': False, 'Invalid_command': False, 'Checksum': 225, 'Alert_pending': False, 'T_alert': False, 'RH_alert': False, 'Invalid_checksum': False} Temperature and Humidity: (22.666132600900283, 55.91058213168536)