Webdroid Edutech
Published

Non-Contact Infrared Thermometer Using Arduino

This project demonstrates how to build a non-contact infrared thermometer using an Arduino Uno.

BeginnerProtip2 hours74
Non-Contact Infrared Thermometer Using Arduino

Things used in this project

Hardware components

5V Passive Buzzer
×1
16 X 2 LCD display
×1
2S LiPo Battery
×1
Jumper Wires
×1
Arduino Uno
×1
Breadboard
×1
Ultrasonic Sensor
×1
MLX90614 infrared temperature sensor
×1

Story

Read more

Code

Arduino code to read temperature data from the MLX90614 sensor

Arduino
#include <Wire.h>
#include <Adafruit_MLX90614.h>
#include <NewPing.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
#define TRIG_PIN 9
#define ECHO_PIN 10
#define BUZZER_PIN 6
#define MAX_DISTANCE 100
NewPing sonar(TRIG_PIN, ECHO_PIN, MAX_DISTANCE);

void setup() {
    Serial.begin(9600);
    mlx.begin();
    pinMode(BUZZER_PIN, OUTPUT);
}

void loop() {
    delay(500);
    int distance = sonar.ping_cm();
    
    if (distance > 0 && distance <= 10) {
        delay(2000); // Allow time for stable reading
        float temp = mlx.readObjectTempC();
        Serial.print("Temperature: ");
        Serial.print(temp);
        Serial.println(" °C");
        
        if (temp > 30.0) {
            tone(BUZZER_PIN, 1000, 500); // High temperature alert
        } else {
            tone(BUZZER_PIN, 500, 500);  // Low temperature alert
        }
    }
}

Credits

Webdroid Edutech
12 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.