Arduino IR thermometer using the MLX90614 IR temperature sensor
Dear friends welcome to another Blog! Today we are going to build a very interesting and useful project:an Infrared Thermometer with an LCD display using Arduino. Without any further delay,let’s get started!
The Nokia 5110 LCD shield for Arduino and the MLX90614 IR temperature sensor. Since the Nokia 5110 is my favorite display to use with Arduino, this shield became my favorite at once since it makes things so much easier.We don’t need to connect wires any more in order to use it which makes prototyping a lot faster. It also has a small joystick embedded. And the price of it is less than 4$, which is great! I combined these two items in order to build this IR thermometer! The project is capable of measuring the temperature of an object without touching it, from a small distance. It can measure temperatures from -70 degrees Celsius to 380 degrees. The accuracy is about 0.5 degree in room temperature which is great! Let’s see the project in action.If I point the sensor at the cutting mat, the temperature it measures is 21 degrees.Now, if I point the sensor at my palm, the temperature rises to 32 degrees Celsius. You may wonder why it does not measure 36.6 degrees Celsius. That’s because the skin temperature of a human, is different of the body temperature which is 36.6. The normal skin temperature of a person is between 32 and 35 degrees Celsius. Let’s measure the temperature of more objects….Cool isn’t it?
Let’s now see how to build this project.
Components:
- Arduino UNO
- LCD Shield
- IR Sensors
- Connecting Wires
- Breadboard
All we need is an Arduino Uno, the Nokia 5110 LCD shield and the MLX90614 IR sensor module.The sensor uses the I2C protocol so, it is extremely easy to make it work with Arduino. Vcc goes to Arduino 5V. Ground goes to Arduino GND. SCL goes to analog pin 5 of the Arduino Uno. Lastly, SDA goes to analog pin 4 of the Arduino. As you can see the shield has all the pins of the Arduino Uno exposed so it is very easy to work with it. Now we are ready to power up the project. After displaying a splash screen for a few seconds,the project starts measuring the temperature. Now let’s see the software side of the project.The code of the project is very easy as well. We use the Adafruit MLX90614 library for the sensor, and the Nokia 5110 Graph library for the display. At first we define if we want the temperature to be displayed in degrees Celsius or Fahrenheit. Next, the code, all it does is to read the object temperature from the sensor and display it on the screen.The sensor can also measure ambient temperature but we are not using this feature today. If you don’t have the LCD shield but you have a Nokia 5110 LCD display you can use the code with a small change. Just change the pin number in this line of code here to match your connection.
Connections:
#include <LCD5110_Graph.h>
#include <Wire.h>
#include <Adafruit_MLX90614.h>
LCD5110 lcd(2,3,4,6,5); //Use this line with the shield
char TEMPERATURE = 'C';
extern uint8_t SmallFont[]; extern uint8_t BigNumbers[]; extern uint8_t uic[]; extern uint8_t uif[]; extern uint8_t splash[]; Adafruit_MLX90614 mlx = Adafruit_MLX90614();void setup(){Serial.begin(9600);lcd.InitLCD(60); mlx.begin(); lcd.drawBitmap(0, 0, splash, 84, 48); lcd.update(); delay(3000); }
void loop() { String temperature=""; lcd.clrScr(); if(TEMPERATURE == 'C') { temperature = String(mlx.readObjectTempC(),1); lcd.drawBitmap(0, 0, uic, 84, 48); }else { temperature = String(mlx.readObjectTempF(),1); lcd.drawBitmap(0, 0, uif, 84, 48); } if(temperature.length()>4) { temperature.remove(3,2); } Serial.println(temperature); lcd.setFont(BigNumbers); if(temperature.length()==4) { lcd.print(temperature,5,19); }else { lcd.print(temperature,15,19); } lcd.update(); delay(1000); }
I am really impressed with the performance of this sensor and the applications that it may have. I have a couple of projects in mind that are going to use this sensor. Do you find this sensor useful and if so how do you plan to use it? Please post any ideas in the comments section below. I am once more impressed with the power of Arduino hardware and software. With less than 20$ and within hours one is able to build such useful devices. This project is very clear demonstration of that. The time that anyone can build almost anything has come. Enjoy it!I post Blog about DIY projects every alternative Project. I love making things and I believe that anyone can make things, anyone can become a maker. That’s why I created this Website, in order to share my knowledge with the community and learn from the community. I hope you will join us. Until next Blog, Read, Learn, Build!
Stay Home Stay Safe!!!
Comments
Post a Comment
If you have any doubts ,Please let me know.