I’ve connected the MLX90614 IR sensor to I2C bus of Jetson Nano using the PyMLX90614 python library.
I’m able to get temperature values from the sensor:
from smbus2 import SMBus
from mlx90614 import MLX90614
TemperatureModule._bus = SMBus(i2cBus)
TemperatureModule._sensor = MLX90614(1, 0x5A)
temperature = TemperatureModule._sensor.get_object_1()
temperature = TemperatureModule._sensor.get_ambient()
Now I’d like to modify some values like SMBUs address (0x0E) or Emissivity(0x04), which is possible by writting to the sensor’s EEPROM. As per the datasheet, the MLX90614 supports Read Word and Write word SMBUS commands.
The mlx90614 library does not include APIs for that (writting), so I’m implementing them myself using the write_word_data function from smbus2:
data = round(65535 * emissivity) # Emissivity is a value between 0.1 and 1.0
TemperatureModule._bus.write_word_data(0x5A, 0x24, 0x00)
TemperatureModule._bus.write_word_data(0x5A, 0x24, int(data))
Sadly is not working.
I appreciate your comments.