1. Introduction
The MLX90614 is a non-contact temperature sensor that measures temperature using infrared radiation. It can measure the temperature of objects without touching them, making it ideal for medical and industrial applications with the Raspberry Pi.
2. Components
- Raspberry Pi 4 Model B
- MLX90614
- Jumper wires
- Breadboard (optional)
3. Circuit and Connections
| MLX90614 Pin | Raspberry Pi |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | GPIO2 (Pin 3) |
| SCL | GPIO3 (Pin 5) |
👉 Default I2C Address: 0x5A
4. Detailed Step By Step Circuit Working
- Sensor detects infrared radiation from object
- Converts IR energy into temperature data
- Internal processing gives digital output
- Data transmitted via I2C protocol
- Raspberry Pi reads object and ambient temperature
5. Libraries to be Included
sudo apt update
sudo apt install python3-smbus i2c-tools
pip3 install smbus2 mlx90614
Enable I2C:
sudo raspi-config
→ Interface Options → I2C → Enable
6. Code (Python)
from mlx90614 import MLX90614
import smbus2
import time
bus = smbus2.SMBus(1)
sensor = MLX90614(bus, address=0x5A)
while True:
ambient = sensor.get_ambient()
object_temp = sensor.get_object()
print("Ambient Temp: {:.2f} °C".format(ambient))
print("Object Temp: {:.2f} °C".format(object_temp))
print("------------------------")
time.sleep(1)
7. Detailed Step By Step Code Working
- Initializes I2C bus
- Creates MLX90614 sensor object
- Reads:
- Ambient temperature
- Object temperature
- Displays values continuously
8. Tips
- Use
i2cdetect -y 1to confirm address - Avoid glass/plastic obstruction
- Maintain proper distance (2–5 cm)
- Keep sensor clean
- Avoid strong sunlight interference
9. Uses
- Non-contact thermometers
- Industrial temperature monitoring
- Human body temperature measurement
- Smart home automation
- Fire detection systems
10. Conclusion
The MLX90614 sensor enables accurate temperature measurement without physical contact. It is ideal for modern IoT and automation systems using Raspberry Pi.