Non-Contact IR Thermometer: Arduino

 
Model Picture

1. Introduction

Measuring temperature without physical contact is essential for medical safety and industrial monitoring. In this project, we use an Arduino and the MLX90614 Infrared Temperature Sensor. This sensor detects the infrared energy emitted by an object and converts it into a digital temperature reading, allowing us to measure heat from a distance of 2–5 cm.

2. Components

  • Arduino Nano or Uno

  • MLX90614 Contactless IR Temperature Sensor

  • OLED Display (SSD1306 128x64)

  • Active Buzzer

  • Push Button (To trigger the reading)

  • Jumper Wires and Breadboard

  • 9V Battery

3. Circuit and Connections

Arduino Uno Pinout Diagram
Arduino Uno Pinout Diagram


MLX90614 Pinout Diagram
MLX90614 Pinout Diagram

Pinout Diagram SS1306 OLED Display
Pinout Diagram SS1306 OLED Display

Pinout Diagram of Buzzer
Pinout Diagram of Buzzer


KY-004 Push Button Module Pinout Diagram
KY-004 Push Button Module Pinout Diagram


Both the Sensor and the OLED use I2C communication, so they share the same pins:
  • MLX90614 & OLED:

    • VCC → 5V (or 3.3V depending on your module)

    • GND → GND

    • SCL → Arduino A5

    • SDA → Arduino A4

  • Buzzer: Positive → Digital Pin 8, Negative → GND

  • Button: One side → 5V, Other side → Digital Pin 2 (with a 10k resistor to GND)

4. Detailed Step-by-Step Circuit Working

  1. IR Detection: The MLX90614 has a built-in optical filter and a 17-bit ADC. It picks up the thermal radiation from your forehead or an object.

  2. I2C Protocol: The sensor sends the data via the I2C bus (SDA/SCL lines) to the Arduino.

  3. Triggering: The system stays in standby until you press the button (Pin 2).

  4. Displaying: The Arduino processes the data and sends it to the OLED screen.

  5. Feedback: If the temperature is above a certain limit (e.g., 38°C), the buzzer (Pin 8) beeps to alert the user.

5. Libraries to be included

You will need to install these via the Arduino Library Manager:

  • Adafruit_MLX90614.h (For the sensor)

  • Adafruit_SSD1306.h and Adafruit_GFX.h (For the OLED)

6. Code

C++
#include <Wire.h>
#include <Adafruit_MLX90614.h>
#include <Adafruit_SSD1306.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
Adafruit_SSD1306 display(128, 64, &Wire, -1);

const int buttonPin = 2;
const int buzzerPin = 8;

void setup() {
  mlx.begin();
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  pinMode(buttonPin, INPUT);
  pinMode(buzzerPin, OUTPUT);
  display.clearDisplay();
  display.setTextColor(WHITE);
}

void loop() {
  if (digitalRead(buttonPin) == HIGH) {
    float temp = mlx.readObjectTempC();
    display.clearDisplay();
    display.setCursor(0, 10);
    display.print("Temp: ");
    display.print(temp);
    display.print(" C");
    display.display();
    
    if(temp > 37.5) { digitalWrite(buzzerPin, HIGH); delay(500); digitalWrite(buzzerPin, LOW); }
    delay(1000);
  }
}

7. Detailed Step-by-Step Code Working

  1. Initialization: mlx.begin() starts the I2C communication with the temperature sensor.

  2. Read Signal: mlx.readObjectTempC() specifically reads the object temperature (not the ambient air temperature).

  3. OLED Display: The code clears the screen and prints the value in Celsius.

  4. Threshold Alert: A simple if statement checks if the temperature is high (fever detection logic) and triggers the buzzer.

8. Tips

  • Calibration: The sensor is most accurate when the object is 2cm to 5cm away.

  • Ambient Temp: You can also use mlx.readAmbientTempC() to show the room temperature on the same screen.

  • I2C Address: If your OLED doesn't work, check if the address is 0x3C or 0x3D.

9. Uses

  • Health Screening: Checking for fever at entrances.

  • Industrial Monitoring: Checking motor or engine temperatures without stopping them.

  • Cooking: Checking the surface temperature of pans or liquids.

10. Conclusion

The Non-Contact IR Thermometer is a vital tool in modern electronics. By combining I2C sensors with an OLED display, you can create a professional-grade device that is both practical and educational.


Similar Posts you May Be Interested:

https://simplebasicelectronics.blogspot.com/2 026/03/arduino-pir-motion-sensor-alarm.html

https://simplebasicelectronics.blogspot.com/2026/03/arduino-gas-leak-detector-using-mq-2.html

https://simplebasicelectronics.blogspot.com/2026/03/arduino-flame-sensor-fire-alarm.html

https://simplebasicelectronics.blogspot.com/2026/04/arduino-driver-drowsiness-detection.html

https://simplebasicelectronics.blogspot.com/2026/03/diy-arduino-rain-alarm-yl83.html

തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.