Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Kelvin Yong
Published

Contactless Thermometer

This thermometer is used to scan body temperature as required by SOP of COVID 19

BeginnerFull instructions provided5 hours775
Contactless Thermometer

Things used in this project

Hardware components

Cytron Technologies mlx90614
×1
Cytron Technologies nano maker
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Through Hole Resistor, 300 ohm
Through Hole Resistor, 300 ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering

Story

Read more

Schematics

Thermal schematic

Add on resistor in order for SCL, SDA line to be 3.3v because the datasheet of MLX90614 max Voltage is 4V.

Code

Thermal scanning

Arduino
Using Arduino IDE
/**
   ICC. Temperature Module
   I2C for LCD 16x2
   MLX90614 Temperature Sensor, 3.3v
   A4 = SDA
   A5 = SCL
   Hardware Connections:
    Arduino | HC-SR04
    -------------------
      5V    |   VCC
      7     |   Trig
      6     |   Echo
      GND   |   GND
*/
#include <Wire.h>
#include <Adafruit_MLX90614.h>
#include <LiquidCrystal_I2C.h>

//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

// Pins
const int TRIG_PIN = 7;
const int ECHO_PIN = 6;
const int buzzer = 8;


// Anything over 400 cm (23200 us pulse) is "out of range"
const unsigned int MAX_DIST = 23200;
Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {

  // The Trigger pin will tell the sensor to range find
  pinMode(TRIG_PIN, OUTPUT);
  digitalWrite(TRIG_PIN, LOW);

  //Set Echo pin as input to measure the duration of 
  //pulses coming back from the distance sensor
  pinMode(ECHO_PIN, INPUT);
  pinMode(buzzer, OUTPUT);

  // We'll use the serial monitor to view the sensor output
  Serial.begin(9600);
  mlx.begin();

  //LCD Display Configuration
  lcd.begin(16,2);//Defining 16 columns and 2 rows of lcd display
  lcd.backlight();//To Power ON the back light
  //lcd.backlight();// To Power OFF the back light
}

void loop() {

  unsigned long t1;
  unsigned long t2;
  unsigned long pulse_width;
  float cm;
  float inches;
      int v;
    float w;

  // Hold the trigger pin high for at least 10 us
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  // Wait for pulse on echo pin
  while ( digitalRead(ECHO_PIN) == 0 );

  // Measure how long the echo pin was held high (pulse width)
  // Note: the micros() counter will overflow after ~70 min
  t1 = micros();
  while ( digitalRead(ECHO_PIN) == 1);
  t2 = micros();
  pulse_width = t2 - t1;

  // Calculate distance in centimeters and inches. The constants
  // are found in the datasheet, and calculated from the assumed speed
  //of sound in air at sea level (~340 m/s).
  cm = pulse_width / 58.0;
  inches = pulse_width / 148.0;
  lcd.setCursor(0,0);
  lcd.print("Welcome to MOU");
  // Print out results
  if ( pulse_width > MAX_DIST ) {
    Serial.println("Out of range");
  } 
  else {
//    Serial.print(cm);
//    Serial.print(" cm \t");
//    Serial.print(inches);
//    Serial.println(" in");
  if (cm <= 10)
  {
    if (mlx.readObjectTempC() >= 37.5)
    {
     lcd.clear();
     lcd.setCursor(0,1);
     lcd.print("Temp   ");
     lcd.print(mlx.readObjectTempC());
     lcd.print(" C");
     Serial.println((String)"Detected:" + mlx.readObjectTempC() + " C " + " Exit Now");
     lcd.setCursor(4,0);
     lcd.print("Exit now");
     tone(buzzer, 2000);
     delay(300);
     noTone(buzzer);
    }
    if (mlx.readObjectTempC() < 37.5)
    {
    lcd.setCursor(0,1);
    lcd.print("Temp   ");
    lcd.print(mlx.readObjectTempC());
    lcd.print(" C");
    tone(buzzer, 1000);
    delay(100);
    noTone(buzzer);
    Serial.println((String)"Detected:" + mlx.readObjectTempC() + "C");
  }
  }
  delay(3000);
  lcd.clear();
}
}

Credits

Kelvin Yong
3 projects • 3 followers
Government servant in Sarawak. Strong interest in electronic and IOT related.
Contact

Comments

Please log in or sign up to comment.