Skip to content

MLX90615 Module

This module implements Zerynth driver for the MLX90165 sensor (datasheet).

The default communication protocol is I2C.

To use this module create a MLX90615 instance by passing the I2C peripheral name to which it is connected to.

Using the module is simple:

from melexis.mlx90615 import mlx90615
import streams

streams.serial()

mlx = mlx90615.MLX90615(I2C0)

while True:
    print("Temperature:",mlx.temperature())
    sleep(1000)

MLX90615 class

class MLX90615(drvname,clock=100000)

Creates a MLX90615 instance using the MCU I2C circuitry drvname (one of I2C0, I2C1, … check pinmap for details). The created instance is configured and ready to communicate. clock is configured by default in slow mode.

MLX90615 inherits from i2c.I2C, therefore the method start() must be called to setup the I2C channel before any temperature can be read.

temperature()

Returns the object temperature in Celsius. The object temperature is the temperature of the object the mlx90615 is pointing towards.

ambient()

Returns the ambient temperature in Celsius. The ambient temperature is the temperature inside the MLX90615 package.

raw()

Returns the raw infrared readings (signed, 16 bits).