IEEE

IOT Contact Less thermometer Open source project

 IOT Contact Less thermometer
Open source project

 

Project presentation

In response to Covi’d 19 pandemic, RAS Tunisia Chapter is sharing the design of a Low cost contact-less temperature measurement system for human uses.

The human body temperature   is reported by OMS by one the key symptoms that Doctors are considering for patient admission procedures.

In Tunisia A Covid’19 admission system was installed at Tunisia hospital, the first parameter for patients pres-selection is temperature high that 38.6 Celsius.

The proposed device is a los cost contact-less thermometer which may be build and offered to local hospitals.  The system can be assembled form a set of open hard solutions as shown is fig1. It is based on a MLX9067 Sensor .

The device my notify the measured temperature directly on a mobile application with a notification for tempetures higher than 38.5 Cel

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig 1: isis SCHEMATIC Mcu node Board and Mobile Application

 

The needed components for the project are list in table 1 :

Description Reference
Infra red temperature sensor MLX90640 32×24 IR array
Mcu node Board
Battery 9 V Dc
Low cost LCD display 16×2 LCD Display Module with HD44780 Controller

 

The schematic design of the device is given in fig 2,  the source file of this sheet is available on : <link>

2-The MLX90640 Senor

The MLX90640 is a fully calibrated 32×24 pixels thermal IR array in an industry standard 4-lead TO39 package with digital interface.

The MLX90640 contains 768 FIR pixels. An ambient sensor is integrated to measure the ambient temperature of the chip and supply sensor to measure the VDD. The outputs of all sensors IR, Ta and VDD are stored in internal RAM and are accessible through I 2 C. Main characteristics of the sensor are listed below.

 

 

 

 

 

 

Fig 4. MLX90640
Source (MLX9064 DataSheet

 


3- Codes & Bib

A couple of libraries are available for the integration of the MLX9064 senor, a DR Robot library and also a Adafruit library, integration proposed here is made using both codes.

The code allowing the measure the temperature and based on adafruit library is the following:

Key issues are :

  1. Insert the library :
    #include <IR_Thermometer_Sensor_MLX90614.h>
  2. Instantiate a sensor :
    IR_Thermometer_Sensor_MLX90614  MLX90614 = IR_Thermometer_Sensor_MLX90614();
  3. Setup the sensor :
    MLX90614.begin();          // Sensor configuration
  4. Get value from the senor in Celsius  :
    temp = MLX90614.GetAmbientTemp_Celsius();

The code allowing the creation of the web server to communicate the android phone with the thermometer using the library ESPAsyncWebServer  and the ESP8266Wifi library to create access point:

  1. Insert the library :
    #include <ESPAsyncWebServer.h>
  2. Creation of the server :
    AsyncWebServer server(80);
  3. Start of the server :
    server.begin();

The full device code allowing to gather and display a temperature on LCD is listed below :

// Covid’19 response code
// free to copy free to use free to replicate
// by RAS Tunisia Chapter Voluntees
// Chiraz Boudhrioua & IEEE_Senior_Anonymos_Member
#include <LiquidCrystal.h>
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <IR_Thermometer_Sensor_MLX90614.h>float temp=0;
float Covid = 38.5;int sens = 10 ; // a digital input for the sens Button
//                      Rs  E   D4  D5  D6  D7
LiquidCrystal lcd(4,  5,  9,   8,   7,   6);
IR_Thermometer_Sensor_MLX90614 MLX90614 = IR_Thermometer_Sensor_MLX90614();const char *ssid = “ContactLess_thermometer”; //ssid of the access point
const char *password = “ContactLess_thermometer”;  //password of the acces point
IPAddress ipadd (203,114,5,2);  //static ip
IPAddress mask (255,255,255,0);
AsyncWebServer server(80); //informations to send to the mobile phonevoid etatt(AsyncWebServerRequest *request) {
request->send(200, “text/plain”, “ET”+String(eepromReadFloat(100))+”:”+String(urgent));
}void setup() {
MLX90614.begin();  // Sensor configuration
Serial.begin(9600);  // Serial communication config
lcd.begin (16,2);  // dispaly on classical cristal lcd 2 lines 16 caraters/line
pinMode (sens,INPUT);
EEPROM.begin(500);
WiFi.mode(WIFI_AP); //acces point mode
WiFi.softAP(ssid, password);
WiFi.softAPConfig(ipadd,ipadd,mask);Serial.println(“”);
Serial.println(“”);
Serial.print(“Configuring access point…”);
Serial.println(ssid);
Serial.print(“IP address: “);
Serial.println(WiFi.softAPIP());
Serial.println(WiFi.macAddress());
//**************************************************//
//*********** Protocole Communication **************//
//**************************************************//server.on(“/etat”, HTTP_GET, etatt);
server.begin();
Serial.println(“HTTP server started”);
}void display (int line_lcd, int col_lcd, float value)
{
// line_lcd for cursor line 1 or 2
// col_lcd for cursor position 0..15
lcd.setCursor(line_lcd,col_lcd);
lcd.print(“Temp = “);
lcd.print(value);
Serial.print(“Temperature = “);
Serial.print(temp);
}float eepromReadFloat(int address){
union u_tag {
byte b[4];
float fval;
} u;
u.b[0] = EEPROM.read(address);
u.b[1] = EEPROM.read(address+1);
u.b[2] = EEPROM.read(address+2)
u.b[3] = EEPROM.read(address+3);
return u.fval;
}//to save float value to eeprom
void eepromWriteFloat(int address, float value){
union u_tag {
byte b[4];
float fval;
} u;
u.fval=value;EEPROM.write(address  , u.b[0]);
EEPROM.write(address+1, u.b[1]);
EEPROM.write(address+2, u.b[2]);
EEPROM.write(address+3, u.b[3]);
EEPROM.commit();}void loop() {// Read value from sensor
if (sens) { // read only if the botton read is pressed.
temp = MLX90614.GetAmbientTemp_Celsius();
eepromWriteFloat(100,temp);

// Serial.println(temp);  // remove first comments foor tests
// display value on LCD starting at 0.0
display(0,0, temp);
if (temp>Covid){
urgent=1;
lcd.print(” !”);
Serial.println(” !”);
} else urgent=0;
} else {
urgent=0;
temp=0;
eepromWriteFloat(100,temp);
display(0,0, 0);
}
delay(50);
}

The source code can be forward here : <link>

A similar implementation can also be found using adafruit library  and ESPAsyncWebServer library from this link.

// Covid’19 response code
// free to copy free to use free to replicate
// by RAS Tunisia Chapter Voluntees
// Chiraz Boudhrioua & IEEE_Senior_Anonymos_Member
#include <LiquidCrystal.h>
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <Adafruit_MLX90614.h>
float temp=0;
float Covid = 38.5;int sens = 10 ; // a digital input for the sens Button
int sens = 0 ; // a digital input for the sens Button
int urgent;
//                      Rs  E   D4  D5  D6  D7
LiquidCrystal lcd(4,  5,  9,   8,   7,   6);Adafruit_MLX90614 mlx = Adafruit_MLX90614();
const char *ssid = “ContactLess_thermometer”; //ssid of the access point
const char *password = “ContactLess_thermometer”;  //password of the acces point
IPAddress ipadd (203,114,5,2);  //static ip
IPAddress mask (255,255,255,0);
AsyncWebServer server(80);
//informations to send to the mobile phonevoid etatt(AsyncWebServerRequest *request) {
request->send(200, “text/plain”, “ET”+String(eepromReadFloat(100))+”:”+String(urgent));
}void setup() {
mlx.begin();          // Sensor configuration
Serial.begin(9600);   // Serial communication config
lcd.begin (16,2);     // dispaly on classical cristal lcd 2 lines 16 caraters/line
pinMode (sens,INPUT);
EEPROM.begin(500);
WiFi.mode(WIFI_AP); //acces point mode
WiFi.softAP(ssid, password);
WiFi.softAPConfig(ipadd,ipadd,mask);
Serial.println(“”);
Serial.println(“”);
Serial.print(“Configuring access point…”);
Serial.println(ssid);
Serial.print(“IP address: “);
Serial.println(WiFi.softAPIP());
Serial.println(WiFi.macAddress());//**************************************************//
//*********** Protocole Communication **************//
//**************************************************//
server.on(“/etat”, HTTP_GET, etatt);
server.begin();
Serial.println(“HTTP server started”);
}void display (int line_lcd, int col_lcd, float value){
// line_lcd for cursor line 1 or 2
// col_lcd for cursor position 0..15
lcd.setCursor(line_lcd,col_lcd);
lcd.print(“Temp = “);
lcd.print(value);
Serial.print(“Temperature = “);
Serial.print(temp);
}//to read float value from eeprom
float eepromReadFloat(int address){
union u_tag {
byte b[4];
float fval;
} u;
u.b[0] = EEPROM.read(address);
u.b[1] = EEPROM.read(address+1);
u.b[2] = EEPROM.read(address+2);
u.b[3] = EEPROM.read(address+3);
return u.fval;
}//to save float value to eeprom
void eepromWriteFloat(int address, float value){
union u_tag {
byte b[4];
float fval;
} u;
u.fval=value;
EEPROM.write(address  , u.b[0]);
EEPROM.write(address+1, u.b[1]);
EEPROM.write(address+2, u.b[2]);
EEPROM.write(address+3, u.b[3]);
EEPROM.commit();
}void loop() {
// Read value from sensor
if (sens) { // read only if the botton read is pressed.
temp = mlx.readAmbientTempC();
eepromWriteFloat(100,temp);
// Serial.println(temp);  // remove first comments foor tests
// display value on LCD starting at 0.0
display(0,0, temp);
if (temp>Covid){
urgent=1;
lcd.print(” !”);
Serial.println(” !”); }
else urgent=0;
}else {
urgent=0;
temp=0;
eepromWriteFloat(100,temp);
display(0,0, 0);
}
delay(50);
}

4- Mobile application
we have developed a mobile application that communicate with our IOT Thermometry through wifi connection to display the temperature measured by the thermometer and alert you if the person temperature exceeds 38.5 with a phone vibration and also it will display an alert picture.