Skip to content

Python driver for MLX90614 infrared temperature sensors

License

Notifications You must be signed in to change notification settings

sightsdev/PyMLX90614

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMLX90614

Python library for MLX90614 infrared temperature sensors, using smbus2. Compatible with Python 2 and 3.

You might need to enter this command on your Raspberry Pi:

sudo su -c 'echo "Y" > /sys/module/i2c_bcm2708/parameters/combined'

Consider putting it in /etc/rc.local so it's executed each bootup

Usage

First, ensure the device is available on the i2c bus:

$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- 5a -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Within Python, the device can be used like this:

from smbus2 import SMBus
from mlx90614 import MLX90614

bus = SMBus(1)
sensor = MLX90614(bus, address=0x5A)
print sensor.get_amb_temp()
print sensor.get_obj_temp()
bus.close()

Troubleshooting

Older versions of this package used different names for the ambient and object temperature methods. If you get an error like: AttributeError: 'MLX90614' object has no attribute 'get_ambient'. You might need to change any instances of get_ambient to get_amb_temp and any instances of get_object to get_obj_temp.

License

This project is licensed under the terms of the MIT license.

About

Python driver for MLX90614 infrared temperature sensors

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%