Project tutorial
IR Thermometer, Stopwatch, Cooking Timer, Inactivity Tracker

IR Thermometer, Stopwatch, Cooking Timer, Inactivity Tracker © GPL3+

USB LiPo battery powered, Arduino-based non-contact IR thermometer, stopwatch, inactivity tracker, cooking timer with alarm & 7-Seg Display.

  • 3,099 views
  • 2 comments
  • 22 respects

Components and supplies

Apps and online services

About this project

Idea

This is a story about making an pocket carry-able USB stick like IR Thermometer made using Arduino programming and some other stuff. The device will also have stopwatch function, kitchen timer and inactivity tracker function.

IR Thermometer is an IR radiation-based temperature sensing device which allows for the measurement of the average temperature of a surface it's facing - most probably with Wien's displacement law or Stefan–Boltzmann law from highs school physics.

A stopwatch is a basic time measurement device used in sports, scientific experiment, etc. to measure lapsed time. Today, hardware stopwatches (the analog type) are kind of extinct and replaced by a so-called smartphone app. A kitchen timer is a device that alerts cook by buzzing an alarm set such that something being cooked needs checking.

An inactivity tracker is a periodic timer that alerts a person to move after every X amount of time. This helps one to get a minute break from idle state and practice healthy life.

Hardware Description

The finished device looks like this:

Here is a nice description picture of the thing:

Making The Thing!

Step 1: Gather all the ingredients, imagine and make a mental map of what goes where!

Take measurements, make necessary holes, place components and solder.

Step 2: Use heat shrink tube and 0 Ohm resistors to interconnect things, 1k resistors on display segment pins, and solder according to the schematic.

Step 3: Interconnect both layers.

Step 4: Upload test code and check if everything operates. If so, align top and bottom layer with toothpicks and warp on both ends with thin tape.

Now, fill the gap with the hot glue and wait 5 minutes. Now, your sturdy device is ready to roll.

Writing the Software

Here, we will use our good old friend, Arduino IDE, to write the program.

Before we get into code, let's get an idea how the hardware connections affect the code. The small white momentary push button is the menu selector switch which is interrupt driven; the same goes for the big red push button - connected for falling edge INT 0 and INT 1 on Digital Pin 2 and 3.

Digital pin 4 is the buzzer driver pin and A0 is the laser driver pin. A1, A2, A3 are display digit pins; pins 5-12 are segment pins. A4, A5 Digital Pins are for I2C communication with the IR sensor.

Finally, thanks to Dean Reading for the Arduino 7-Segment Library and Limor Fridge for the Arduino MXL90614 Library - life made easy! Based on their library example, the basic code is developed - right now only Ambient and Object Temperature detection function is enables.

I will add the other functions soon! So, stay tuned.

Action!

Here are some temperature measurement results photo and a video - enjoy!

IR sensor in action

Note!

  • The IR Sensor has 90 degree field of view, which means it is not measuring the temperature of the point where the laser pointer is shining, rather it is averaging the temperature of objects on its view plane.
  • The system runs with 4.2 volt fully charged Li-Po battery and should operate with at least 3.7 volts without worries.
  • Laser is directly driven from MCU pin and buzzer is driven through transistor.
  • One of the digital pin powers the 3.3V regulator and the IR sensor.
  • 11 pins are required to direct drive the 7 segment display.
  • The device is rechargeable from the USB port of PC/Laptop. From the USB, 5 volts are reduced to 4.2 with a diode and a resistor in series - simple charging circuit where the blue LED glows while charging.
  • The program can be updated through the 3 blue male header pins (Reset,RX,TX) connected through the external USB-FTDI (serial) device, which is detected as Adruino in Arduino IDE.

Code

Test Code Ver 0.1C/C++
Beta
// Thanks to Lady Ada and Read for MLX90614 and Sevseg library !

#include "SevSeg.h"
#include <Wire.h>
#include <Adafruit_MLX90614.h>


#define PIN_PWR_SENESOR 13
#define PIN_PWR_LASER A0
#define PIN_PRESS_SWITCH1 2
#define PIN_PRESS_SWITCH2 3
#define PIN_BUZZER_ALERM 4

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
SevSeg sevseg; //Instantiate a seven segment controller object


volatile int test =0;
volatile int test2 = 0;
float T_amb;
float T_obj;



void setup() {
   pinMode(PIN_PRESS_SWITCH1, INPUT_PULLUP);
  attachInterrupt(0, SW1, FALLING);// Interrupt for Swithc 1

  pinMode(PIN_PRESS_SWITCH2, INPUT_PULLUP);
  attachInterrupt(1, SW2, FALLING);// Interrupt for Swithc 2
  pinMode(PIN_PWR_SENESOR, OUTPUT);
    pinMode(PIN_PWR_LASER, OUTPUT);
       pinMode(PIN_BUZZER_ALERM, OUTPUT);
    digitalWrite(PIN_PWR_SENESOR,HIGH); // powers the regulator + IR sensor
    digitalWrite(PIN_PWR_LASER,LOW);
       digitalWrite(PIN_BUZZER_ALERM,LOW);
  
  byte numDigits = 3;   
  byte digitPins[] = {A1, A2, A3};
  byte segmentPins[] = {11, 9, 7, 6, 5, 10, 8, 12};
  bool resistorsOnSegments = false; // Use 'true' if on digit pins
  byte hardwareConfig = COMMON_ANODE; // See README.md for options
     
  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
  sevseg.setBrightness(100);
   mlx.begin();
}

void loop() {
  static unsigned long timer = millis();
  static int seconds = 0;
  
  if (millis() >= timer) {
    seconds++; // 100 milliSeconds is equal to 1 deciSecond
    timer += 1000; 
    if (seconds == 100000) { // Reset to 0 after counting for 1000 seconds.
      seconds=0;
      
    }
    sevseg.setNumber(T_obj, 1);
  }
  if(test==0)
  {
// T_amb = mlx.readAmbientTempC();
 T_obj = mlx.readObjectTempC(); 
sevseg.setNumber(T_obj, 0);
  sevseg.refreshDisplay(); 
   sevseg.refreshDisplay(); 
    sevseg.refreshDisplay(); 
     sevseg.refreshDisplay(); // Must run repeatedly
  }
if (test==1)
{
  T_amb = mlx.readAmbientTempC();
//  T_amb=T_amb*10;
  sevseg.setNumber(T_amb, 1);
  sevseg.refreshDisplay(); 
   sevseg.refreshDisplay();
    sevseg.refreshDisplay(); 
     sevseg.refreshDisplay(); // Must run repeatedly
     
}
}

void SW1()
{
  
  test=1;
  digitalWrite(PIN_PWR_Laser,HIGH);
}
void SW2()
{
  test=0;
  digitalWrite(PIN_PWR_Laser,HIGH);}

Schematics

Circuit
https://circuits.io/circuits/3636001-the-unnamed-circuit
Ckt yjyev51wgb

Comments

Similar projects you might like

Arduino Kitchen Timer

Project tutorial by Team I and myself

  • 54,448 views
  • 37 comments
  • 77 respects

Multifunctional Watch With Arduino Uno

Project showcase by shaqibmusa94

  • 3,739 views
  • 2 comments
  • 8 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,849 views
  • 17 comments
  • 75 respects

Integrated Solar ChargeController, Inverter, PowerBank, Lamp

Project tutorial by Shahariar

  • 7,755 views
  • 16 comments
  • 30 respects

Ultrasonic Sensor with Alarm, LCD and Temperature

Project tutorial by MichDragstar

  • 4,645 views
  • 7 comments
  • 19 respects

Alexa BBQ/Kitchen Thermometer with IoT Arduino and e-Paper

Project tutorial by Roger Theriault

  • 2,388 views
  • 0 comments
  • 9 respects
Add projectSign up / Login