Welcome to MicroPython MLX90614 Library’s documentation!

Contents:

mlx90614 module

MLX90614

class mlx90614.MLX90614(i2c[, address])

The basic class for handling the communication with the sensor.

The i2c parameter is an initialized I²C bus, and the optional address specifies which sensor to connect to, if you have more than one and have changed their addresses with the Addr pin.

read_ambient_temp()

Get the ambient temperature in Celcius

read_object_temp()

Get the object temperature in Celcius

Usage Examples

Connect your sensor in following way:

  • vin3V
  • gndgnd
  • sclgpio5
  • sdagpio4

Now, to make basic measurement:

import mlx90614
from machine import I2C, Pin
i2c = I2C(scl=Pin(5), sda=Pin(4))
sensor = mlx90614.MLX90614(i2c)
print(sensor.read_ambient_temp())
print(sensor.read_object_temp())

To perform continuous measurement:

import time
while True:
    print(sensor.read_ambient_temp(), sensor.read_object_temp())
    time.sleep_ms(500)

Indices and tables