#COVID-19
We are all going through a crucial junction of time due to COVID-19
.
We are all trying to take preventive measures to stay safe. The necessity of living safe form COVID-19
I was out for searching an IR thermal contactless thermometer for my home, to track unusual body temperature any of my housekeeping staffs, visitors or delivery agents, from long distance and without anyone standing and monitoring.
I found a few devices in the amazon market place. Those are very promising products and much costly. And also there is always a person required to stand and monitor from some distance holding the device. I was a little bit disappointed by seeing the cost and limited ability of the product and also in deep think that how this will be convenient for everyone to buy a costly product and also had to stand to monitor the temperature while surrounded by unseen microscopic threat.
I felt some urge to do something which can help others who needed most and also by writing this it will help others to rethink on the available product design.
I have to build up a complete autonomous IR contactless Temperature device which can be mounted anywhere like a door, apartment gates or community halls anywhere and track the temperature and post the result to any cloud BD Or any incoming webhooks. The build I have done it only cost approx 700 to 900 rupees.
Let's See how we can build this.
Key Components:- Mlx90614 Contactless Ir Infrared Temperature Sensor Module 3 5V for Arduino
- Nodemcu ESP8266 Wifi IOT Development Board as a Microcontroller.
- LCD 16X2 Alphanumeric Display
#include <Wire.h>
#include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
#include <LiquidCrystal_I2C.h>
#include "ESP8266WiFi.h"
#include "ESP8266HTTPClient.h"
int frequency=10; //Specified in Hz
int buzzPin=D5;
int timeOn=1000; //specified in milliseconds
int timeOff=10000; //specified in millisecods
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
const String slack_hook_url = "URL of Slack Web Hook";
const String slack_icon_url = "none";
const String slack_message = "Sick";
const String slack_username = "<SLACK USER NAME/ Channel Name";
// WiFi parameters to be configured
const char* ssid = "<Wifi User Name>";
const char* password = "<Wifi Password>";
void setup() {
Serial.begin(9600);
Serial.println("Adafruit MLX90614 test");
mlx.begin();
lcd.begin(16,1);//Defining 16 columns and 2 rows of lcd display
lcd.clear();
lcd.setCursor(0,0); //Defining positon to write from first row,first column .
WiFi.begin(ssid, password);
// while wifi not connected yet, print '.'
// then after it connected, get out of the loop
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
lcd.print(".");
}
//print a new line, then print WiFi connected and the IP address
Serial.println("");
Serial.println("WiFi connected");
// Print the IP address
Serial.println(WiFi.localIP());
}
bool postMessageToSlack(String msg)
{
const char* host = "hooks.slack.com";
Serial.print("Connecting to ");
Serial.println(host);
// Use WiFiClient class to create TCP connections
WiFiClientSecure client;
const int httpsPort = 443;
if (!client.connect(host, httpsPort)) {
Serial.println("Connection failed :-(");
return false;
}
// We now create a URI for the request
Serial.print("Posting to URL: ");
Serial.println(slack_hook_url);
String postData="payload={\"link_names\": 1, \"icon_url\": \"" + slack_icon_url + "\", \"username\": \"" + slack_username + "\", \"text\": \"" + msg + "\"}";
// This will send the request to the server
client.print(String("POST ") + slack_hook_url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Content-Type: application/x-www-form-urlencoded\r\n" +
"Connection: close" + "\r\n" +
"Content-Length:" + postData.length() + "\r\n" +
"\r\n" + postData);
Serial.println("Request sent");
String line = client.readStringUntil('\n');
Serial.printf("Response code was: ");
Serial.println(line);
if (line.startsWith("HTTP/1.1 200 OK")) {
return true;
} else {
return false;
}
}
void loop() {
Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF());
Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");
Serial.println();
float calibartion = mlx.readObjectTempF() + 5.00;
Serial.println(calibartion);
if(calibartion >= 96.00)
{
postMessageToSlack(String(calibartion)+"F");
}else {
}
lcd.clear();
lcd.setCursor(0,0); //Defining positon to write from first row,first column .
lcd.print(String(calibartion)+"F");;
delay(200);
}
Build Product Preview:This is the hand build product, not 3d printed yet.
Currently, I am looking data to my slack channel direct from the device over the internet. Find the image below how its look.
If you are managed to reach this point of this document that means you find something interesting and maybe you can try to build a superior one. My purpose served by sharing the knowledge with you all.
A small contribution to world. Stay at home Stay healthy and Stay safe.
Thank you.
Abhijit Mukherjee
Comments