Contactless Thermometer
This simple Arduino project can be used to monitor your own temperature every morning or used in public places as contact less thermometer.
Components and supplies
1
Rotary Potentiometer, 10 kohm
1
Resistor 220 ohm
1
Buzzer, Piezo
1
Alphanumeric LCD, 16 x 2
1
Arduino UNO
1
Infrared Thermometer-MLX90614ESF-BAA
1
Breadboard (generic)
2
Resistor 47.5k ohm
1
Ultrasonic Sensor - HC-SR04 (Generic)
Apps and platforms
1
Arduino IDE
Project description
Code
Untitled file
arduino
1/* 2 Name: StayHome.ino 3 Created: 4/15/2020 8:36:19 PM 4 Author: T@f335 5*/ 6 7 8 9/* 10 11This Sketch is for a contactless, automatic temperature reader to avoid human contact, 12in a effort to reduce covid-19 contaminations. 13This works using the MLX90614 sensor to accurately measure body temperature. 14 15-it also uses a 16x2 LCD display 16-a HC-SR04 Ultrasonic Sensor 17 18the project uses a ultra sound sensor to detect the distance between, 19the user and the sensor, if this distance is within the specified limits, 20the reading will start after a 10 milliseconds delay,the temperature 21will then be display in lcd and 3 short sound will be made by a active 22buzzer to catch the attention of the reader to lcd screen 23 24*/ 25 26/* 27LCD Hookup 28 29 * LCD RS pin to digital pin 12 30 * LCD Enable pin to digital pin 11 31 * LCD D4 pin to digital pin 5 32 * LCD D5 pin to digital pin 4 33 * LCD D6 pin to digital pin 3 34 * LCD D7 pin to digital pin 2 35 * LCD R/W pin to ground 36 * LCD VSS pin to ground 37 * LCD VCC pin to 5V 38 * 10K resistor: 39 * ends to +5V and ground 40 * wiper to LCD VO pin (pin 3) 41 42 HC-SR04 Hookup 43 44 *Pin 8 to "Trig" 45 *Pin 9 to Echo 46 *VCC 5V 47 *Gnd to Ground 48 49 50 MLX90614 Hookup 51 52 VDD ------------------ 3.3V 53 VSS ------------------ GND 54 SDA ------------------ A4 55 SCL ------------------ A5 56 57*/ 58 59 60#include <LiquidCrystal.h> 61#include <Wire.h> 62#include <SparkFunMLX90614.h> 63 64const int triggerPin = 8; 65const int echoPin = 9; 66 67 68// This pin is used by a active buzzer to notify the user that temperature is ready to read 69const int buzzerPin1 = 10; 70 71 72 73IRTherm Therm; 74 75LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 76 77 78 79void setup() { 80 81 pinMode(triggerPin, OUTPUT); 82 pinMode(echoPin, INPUT); 83 84 Therm.begin(); 85 Therm.setUnit(TEMP_C); // set the unit of measurement to celsius 86 87 lcd.begin(16, 2); 88 89 pinMode(buzzerPin1, OUTPUT); //Set the buzzer pin 90 digitalWrite(buzzerPin1, LOW); 91} 92 93void loop() { 94 95 if (GetMeasuredDistance() <= 8 && Therm.read()) // the value of 8 cm can be tweacked to adjust the reading distance 96 { 97 delay(10); 98 lcd.print("Your temp is :"); 99 lcd.setCursor(0,1); 100 lcd.print(String(Therm.object(), 2) + "* C"); 101 102 for (int i = 0; i < 3; i++); 103 { 104 digitalWrite(buzzerPin1, HIGH); 105 delay(10); 106 digitalWrite(buzzerPin1, LOW); 107 delay(10); 108 } 109 } 110 111 else if (GetMeasuredDistance() >= 20) 112 { 113 lcd.print("Come closer :)"); 114 } 115 116 else { 117 lcd.print("The Ambiant temperature is :"); 118 lcd.setCursor(0,1); 119 lcd.print(String(Therm.ambient(), 2) + "*C"); 120 } 121 122 delay(500); 123} 124 125int GetMeasuredDistance() 126{ 127 128 long duration; 129 130 digitalWrite(triggerPin, LOW); 131 delayMicroseconds(5); 132 133 digitalWrite(triggerPin, HIGH); 134 delayMicroseconds(10); 135 digitalWrite(triggerPin, LOW); 136 137 duration = pulseIn(echoPin, HIGH); 138 139 return duration * 0.034 / 2; // This return a distance in cm 140} 141 142 143 144
StayHome
arduino
1/* 2 Name: StayHome.ino 3 Created: 4/15/2020 8:36:19 PM 4 Author: T@f335 5*/ 6 7 8 9/* 10 11This Sketch is for a contactless, automatic temperature reader to avoid human contact, 12in a effort to reduce covid-19 contaminations. 13This works using the MLX90614 sensor to accurately measure body temperature. 14 15-it also uses a 16x2 LCD display 16-a HC-SR04 Ultrasonic Sensor 17 18the project uses a ultra sound sensor to detect the distance between, 19the user and the sensor, if this distance is within the specified limits, 20the reading will start after a 10 milliseconds delay,the temperature 21will then be display in lcd and 3 short sound will be made by a active 22buzzer to catch the attention of the reader to lcd screen 23 24*/ 25 26/* 27LCD Hookup 28 29 * LCD RS pin to digital pin 12 30 * LCD Enable pin to digital pin 11 31 * LCD D4 pin to digital pin 5 32 * LCD D5 pin to digital pin 4 33 * LCD D6 pin to digital pin 3 34 * LCD D7 pin to digital pin 2 35 * LCD R/W pin to ground 36 * LCD VSS pin to ground 37 * LCD VCC pin to 5V 38 * 10K resistor: 39 * ends to +5V and ground 40 * wiper to LCD VO pin (pin 3) 41 42 HC-SR04 Hookup 43 44 *Pin 8 to "Trig" 45 *Pin 9 to Echo 46 *VCC 5V 47 *Gnd to Ground 48 49 50 MLX90614 Hookup 51 52 VDD ------------------ 3.3V 53 VSS ------------------ GND 54 SDA ------------------ A4 55 SCL ------------------ A5 56 57*/ 58 59 60#include <LiquidCrystal.h> 61#include <Wire.h> 62#include <SparkFunMLX90614.h> 63 64const int triggerPin = 8; 65const int echoPin = 9; 66 67 68// Active Buzzer Pin(Piezo) 69const int buzzerPin = 10; 70 71 72 73IRTherm Therm; 74 75LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 76 77 78 79void setup() { 80 81 pinMode(triggerPin, OUTPUT); 82 pinMode(echoPin, INPUT); 83 84 Therm.begin(); 85 Therm.setUnit(TEMP_C); // set the unit of measurement to celsius 86 87 lcd.begin(16, 2); 88 89 pinMode(buzzerPin, OUTPUT); //Set the buzzer pin 90 digitalWrite(buzzerPin, LOW); 91} 92 93void loop() { 94 95 if (GetMeasuredDistance() <= 8 && Therm.read()) // the value of 8 cm can be tweaked to adjust the reading distance 96 { 97 98 lcd.print("Your temp is :"); 99 lcd.setCursor(0,1); 100 lcd.print(String(Therm.object(), 2) + "* C"); 101 102 for (int i = 0; i < 3; i++); 103 { 104 digitalWrite(buzzerPin, HIGH); 105 delay(10); 106 digitalWrite(buzzerPin, LOW); 107 delay(10); 108 } 109 } 110 111 else if (GetMeasuredDistance() >= 20) 112 { 113 lcd.print("Come closer :)"); 114 } 115 116 else { 117 lcd.print("The Ambiant temperature is :"); 118 lcd.setCursor(0,1); 119 lcd.print(String(Therm.ambient(), 2) + "*C"); 120 } 121 122 delay(5000); 123} 124 125int GetMeasuredDistance() 126{ 127 128 long duration; 129 130 digitalWrite(triggerPin, LOW); 131 delayMicroseconds(5); 132 133 digitalWrite(triggerPin, HIGH); 134 delayMicroseconds(10); 135 digitalWrite(triggerPin, LOW); 136 137 duration = pulseIn(echoPin, HIGH); 138 139 return duration * 0.034 / 2; // This return a distance in cm 140} 141 142 143 144
Untitled file
arduino
1/* 2 Name: StayHome.ino 3 Created: 4/15/2020 8:36:19 PM 4 Author: T@f335 5*/ 6 7 8 9/* 10 11This Sketch is for a contactless, automatic temperature reader to avoid human contact, 12in a effort to reduce covid-19 contaminations. 13This works using the MLX90614 sensor to accurately measure body temperature. 14 15-it also uses a 16x2 LCD display 16-a HC-SR04 Ultrasonic Sensor 17 18the project uses a ultra sound sensor to detect the distance between, 19the user and the sensor, if this distance is within the specified limits, 20the reading will start after a 10 milliseconds delay,the temperature 21will then be display in lcd and 3 short sound will be made by a active 22buzzer to catch the attention of the reader to lcd screen 23 24*/ 25 26/* 27LCD Hookup 28 29 * LCD RS pin to digital pin 12 30 * LCD Enable pin to digital pin 11 31 * LCD D4 pin to digital pin 5 32 * LCD D5 pin to digital pin 4 33 * LCD D6 pin to digital pin 3 34 * LCD D7 pin to digital pin 2 35 * LCD R/W pin to ground 36 * LCD VSS pin to ground 37 * LCD VCC pin to 5V 38 * 10K resistor: 39 * ends to +5V and ground 40 * wiper to LCD VO pin (pin 3) 41 42 HC-SR04 Hookup 43 44 *Pin 8 to "Trig" 45 *Pin 9 to Echo 46 *VCC 5V 47 *Gnd to Ground 48 49 50 MLX90614 Hookup 51 52 VDD ------------------ 3.3V 53 VSS ------------------ GND 54 SDA ------------------ A4 55 SCL ------------------ A5 56 57*/ 58 59 60#include <LiquidCrystal.h> 61#include <Wire.h> 62#include <SparkFunMLX90614.h> 63 64const int triggerPin = 8; 65const int echoPin = 9; 66 67 68// This pin is used by a active buzzer to notify the user that temperature is ready to read 69const int buzzerPin1 = 10; 70 71 72 73IRTherm Therm; 74 75LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 76 77 78 79void setup() { 80 81 pinMode(triggerPin, OUTPUT); 82 pinMode(echoPin, INPUT); 83 84 Therm.begin(); 85 Therm.setUnit(TEMP_C); // set the unit of measurement to celsius 86 87 lcd.begin(16, 2); 88 89 pinMode(buzzerPin1, OUTPUT); //Set the buzzer pin 90 digitalWrite(buzzerPin1, LOW); 91} 92 93void loop() { 94 95 if (GetMeasuredDistance() <= 8 && Therm.read()) // the value of 8 cm can be tweacked to adjust the reading distance 96 { 97 delay(10); 98 lcd.print("Your temp is :"); 99 lcd.setCursor(0,1); 100 lcd.print(String(Therm.object(), 2) + "* C"); 101 102 for (int i = 0; i < 3; i++); 103 { 104 digitalWrite(buzzerPin1, HIGH); 105 delay(10); 106 digitalWrite(buzzerPin1, LOW); 107 delay(10); 108 } 109 } 110 111 else if (GetMeasuredDistance() >= 20) 112 { 113 lcd.print("Come closer :)"); 114 } 115 116 else { 117 lcd.print("The Ambiant temperature is :"); 118 lcd.setCursor(0,1); 119 lcd.print(String(Therm.ambient(), 2) + "*C"); 120 } 121 122 delay(500); 123} 124 125int GetMeasuredDistance() 126{ 127 128 long duration; 129 130 digitalWrite(triggerPin, LOW); 131 delayMicroseconds(5); 132 133 digitalWrite(triggerPin, HIGH); 134 delayMicroseconds(10); 135 digitalWrite(triggerPin, LOW); 136 137 duration = pulseIn(echoPin, HIGH); 138 139 return duration * 0.034 / 2; // This return a distance in cm 140} 141 142 143 144
StayHome
arduino
1/* 2 Name: StayHome.ino 3 Created: 4/15/2020 8:36:19 PM 4 Author: T@f335 5*/ 6 7 8 9/* 10 11This 12 Sketch is for a contactless, automatic temperature reader to avoid human contact, 13in 14 a effort to reduce covid-19 contaminations. 15This works using the MLX90614 sensor 16 to accurately measure body temperature. 17 18-it also uses a 16x2 LCD display 19-a 20 HC-SR04 Ultrasonic Sensor 21 22the project uses a ultra sound sensor to detect 23 the distance between, 24the user and the sensor, if this distance is within the 25 specified limits, 26the reading will start after a 10 milliseconds delay,the temperature 27will 28 then be display in lcd and 3 short sound will be made by a active 29buzzer to catch 30 the attention of the reader to lcd screen 31 32*/ 33 34/* 35LCD Hookup 36 37 38 * LCD RS pin to digital pin 12 39 * LCD Enable pin to digital pin 11 40 * LCD 41 D4 pin to digital pin 5 42 * LCD D5 pin to digital pin 4 43 * LCD D6 pin to digital 44 pin 3 45 * LCD D7 pin to digital pin 2 46 * LCD R/W pin to ground 47 * LCD VSS 48 pin to ground 49 * LCD VCC pin to 5V 50 * 10K resistor: 51 * ends to +5V and 52 ground 53 * wiper to LCD VO pin (pin 3) 54 55 HC-SR04 Hookup 56 57 *Pin 8 to 58 "Trig" 59 *Pin 9 to Echo 60 *VCC 5V 61 *Gnd to Ground 62 63 64 MLX90614 65 Hookup 66 67 VDD ------------------ 3.3V 68 VSS ------------------ GND 69 70 SDA ------------------ A4 71 SCL ------------------ A5 72 73*/ 74 75 76#include 77 <LiquidCrystal.h> 78#include <Wire.h> 79 80//You must have this library installed 81 to use the MLX90614 82#include <SparkFunMLX90614.h> 83 84const int triggerPin 85 = 8; 86const int echoPin = 9; 87 88 89// Active Buzzer Pin(Piezo) 90const 91 int buzzerPin = 10; 92 93 94 95IRTherm Therm; 96 97LiquidCrystal lcd(12, 11, 98 5, 4, 3, 2); 99 100 101 102void setup() { 103 104 pinMode(triggerPin, OUTPUT); 105 106 pinMode(echoPin, INPUT); 107 108 Therm.begin(); 109 Therm.setUnit(TEMP_C); 110 // set the unit of measurement to celsius 111 112 lcd.begin(16, 2); 113 114 pinMode(buzzerPin, 115 OUTPUT); //Set the buzzer pin 116 digitalWrite(buzzerPin, LOW); //clear the buzzer 117 pin 118} 119 120void loop() { 121 122 if (GetMeasuredDistance() <= 8 && Therm.read()) 123 // the value of 8 cm can be tweaked to adjust the reading distance 124 // the 125 sensor reading field will be 8 cm x 2 = 16 cm 126 127 { 128 delay(10); 129 130 lcd.print("Your temp is :"); 131 lcd.setCursor(0,1); 132 lcd.print(String(Therm.object(), 133 2) + "* C"); 134 135 for (int i = 0; i < 3; i++); 136 { 137 digitalWrite(buzzerPin, 138 HIGH); 139 delay(10); 140 digitalWrite(buzzerPin, LOW); 141 142 delay(10); 143 } 144 } 145 146 else if (GetMeasuredDistance() 147 >= 20) 148 { 149 lcd.print("Come closer :)"); 150 } 151 152 else 153 { 154 lcd.print("The Ambiant temperature is :"); 155 lcd.setCursor(0,1); 156 157 lcd.print(String(Therm.ambient(), 2) + "*C"); 158 } 159 160 delay(4000); 161 162 lcd.clear(); 163} 164 165int GetMeasuredDistance() 166{ 167 168 long duration; 169 170 171 digitalWrite(triggerPin, LOW); 172 delayMicroseconds(5); 173 174 digitalWrite(triggerPin, 175 HIGH); 176 delayMicroseconds(10); 177 digitalWrite(triggerPin, LOW); 178 179 180 duration = pulseIn(echoPin, HIGH); 181 182 return duration * 0.034 / 2; // 183 This return a distance in cm 184} 185 186 187 188
StayHome
arduino
1/* 2 Name: StayHome.ino 3 Created: 4/15/2020 8:36:19 PM 4 Author: T@f335 5*/ 6 7 8 9/* 10 11This 12 Sketch is for a contactless, automatic temperature reader to avoid human contact, 13in 14 a effort to reduce covid-19 contaminations. 15This works using the MLX90614 sensor 16 to accurately measure body temperature. 17 18-it also uses a 16x2 LCD display 19-a 20 HC-SR04 Ultrasonic Sensor 21 22the project uses a ultra sound sensor to detect 23 the distance between, 24the user and the sensor, if this distance is within the 25 specified limits, 26the reading will start after a 10 milliseconds delay,the temperature 27will 28 then be display in lcd and 3 short sound will be made by a active 29buzzer to catch 30 the attention of the reader to lcd screen 31 32*/ 33 34/* 35LCD Hookup 36 37 38 * LCD RS pin to digital pin 12 39 * LCD Enable pin to digital pin 11 40 * LCD 41 D4 pin to digital pin 5 42 * LCD D5 pin to digital pin 4 43 * LCD D6 pin to digital 44 pin 3 45 * LCD D7 pin to digital pin 2 46 * LCD R/W pin to ground 47 * LCD VSS 48 pin to ground 49 * LCD VCC pin to 5V 50 * 10K resistor: 51 * ends to +5V and 52 ground 53 * wiper to LCD VO pin (pin 3) 54 55 HC-SR04 Hookup 56 57 *Pin 8 to 58 "Trig" 59 *Pin 9 to Echo 60 *VCC 5V 61 *Gnd to Ground 62 63 64 MLX90614 65 Hookup 66 67 VDD ------------------ 3.3V 68 VSS ------------------ GND 69 70 SDA ------------------ A4 71 SCL ------------------ A5 72 73*/ 74 75 76#include 77 <LiquidCrystal.h> 78#include <Wire.h> 79#include <SparkFunMLX90614.h> 80 81const 82 int triggerPin = 8; 83const int echoPin = 9; 84 85 86// Active Buzzer Pin(Piezo) 87const 88 int buzzerPin = 10; 89 90 91 92IRTherm Therm; 93 94LiquidCrystal lcd(12, 11, 95 5, 4, 3, 2); 96 97 98 99void setup() { 100 101 pinMode(triggerPin, OUTPUT); 102 103 pinMode(echoPin, INPUT); 104 105 Therm.begin(); 106 Therm.setUnit(TEMP_C); 107 // set the unit of measurement to celsius 108 109 lcd.begin(16, 2); 110 111 pinMode(buzzerPin, 112 OUTPUT); //Set the buzzer pin 113 digitalWrite(buzzerPin, LOW); 114} 115 116void 117 loop() { 118 119 if (GetMeasuredDistance() <= 8 && Therm.read()) // the value 120 of 8 cm can be tweaked to adjust the reading distance 121 { 122 123 lcd.print("Your 124 temp is :"); 125 lcd.setCursor(0,1); 126 lcd.print(String(Therm.object(), 127 2) + "* C"); 128 129 for (int i = 0; i < 3; i++); 130 { 131 digitalWrite(buzzerPin, 132 HIGH); 133 delay(10); 134 digitalWrite(buzzerPin, LOW); 135 136 delay(10); 137 } 138 } 139 140 else if (GetMeasuredDistance() 141 >= 20) 142 { 143 lcd.print("Come closer :)"); 144 } 145 146 else 147 { 148 lcd.print("The Ambiant temperature is :"); 149 lcd.setCursor(0,1); 150 151 lcd.print(String(Therm.ambient(), 2) + "*C"); 152 } 153 154 delay(5000); 155} 156 157int 158 GetMeasuredDistance() 159{ 160 161 long duration; 162 163 digitalWrite(triggerPin, 164 LOW); 165 delayMicroseconds(5); 166 167 digitalWrite(triggerPin, HIGH); 168 169 delayMicroseconds(10); 170 digitalWrite(triggerPin, LOW); 171 172 duration 173 = pulseIn(echoPin, HIGH); 174 175 return duration * 0.034 / 2; // This return 176 a distance in cm 177} 178 179 180 181
Downloadable files
circuit diagram
circuit diagram
circuit diagram
circuit diagram
Comments
Only logged in users can leave comments