Project tutorial
Arduino Based IR Thermometer with TFT Display and TMP006

Arduino Based IR Thermometer with TFT Display and TMP006 © CC BY

Just a simple infrared thermometer.

  • 3,072 views
  • 0 comments
  • 9 respects

Components and supplies

Apps and online services

About this project

Arduino based IR thermometer with TFT display and TMP006

Just a simple infrared thermometer

DIAGRAM

See commented part in the code

B.O.M.

  • Arduino ProMini (3.3V)
  • 2.2" TFT LCD display (ILI9341)
  • Adafruit TMP006 breakout board

Code

TMP006 infrared thermometerArduino
/*
HARDWARE CONNECTIONS
PROMINI   ILI9341
PIN       PIN

GND       -->  GND
VCC(3.3)  -->  VCC
10        -->  CS
8         -->  RESET
9         -->  D/C
11        -->  SDI(MOSI)
13        -->  SCK
VCC(3.3)  -->  LED
12        -->  SDO(MISO)

PROMINI   TMP006
PIN       PIN

GND       -->  GND
VCC(3.3)  -->  VCC
A5        -->  SCL
A4        -->  SDA

*/


#define SDA_PORT PORTD
#define SDA_PIN 3   //define the SDA pin         
#define SCL_PORT PORTD
#define SCL_PIN 2   //define the SCL pin

#include <Average.h>
#include "SPI.h"
#include "ILI9341_due_config.h"
#include "ILI9341_due.h"
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_TMP006.h"

Adafruit_TMP006 tmp006;
/*
#include "Arial_bold_14.h"
#include "SystemFont5x7.h"
#include "Verdana_digits_24.h"
#include "fixednums8x16.h"
#include "fixednums15x31.h"
#include "roboto32.h"
#include "jokerman_255.h"
*/
#include "roboto32.h"
#include "allFonts.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 13
#define TFT_RST 8
#define TFT_MISO 12

ILI9341_due tft = ILI9341_due(TFT_CS, TFT_DC, TFT_RST);

float tobj = 0;
float tobjavg = 0;
char tobjf[8];
float tamb = 0;
float tambavg = 0;
char tambf[8];

// Color set
#define  BLACK           0x0000
#define RED             0xF800
#define GREEN           0x07E0
//#define BLUE            0x001F
#define BLUE            0x102E
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0 
#define ORANGE          0xFD20
#define GREENYELLOW     0xAFE5 
#define DARKGREEN       0x03E0
#define WHITE           0xFFFF

uint16_t  color;
uint16_t  colorFONDO = BLACK;

Average<float> avetobj(10);
Average<float> avetamb(10);

void setup()
{
  tmp006.begin();
  tft.begin();
    tft.fillScreen(BLUE);
    tft.setTextColor(WHITE, BLUE);
   tft.setFont(SystemFont5x7);
    tft.setTextScale(3);
    
    tft.printAt("Tobj", 0, 10);
    tft.printAt("Tamb", 0, 50);
    tft.printAt("C", 210, 10);
    tft.printAt("C", 210, 50);
    tft.setArcParams(100);
}

void loop()
{
tobj = tmp006.readObjTempC();
tamb = tmp006.readDieTempC();

  avetobj.push(tobj);
  tobjavg = avetobj.mean();

  avetamb.push(tamb);
  tambavg = avetamb.mean();

  dtostrf(tobjavg,5, 2, tobjf);
  dtostrf(tambavg,5, 2, tambf); 


  tft.printAtPivoted(tobjf,100,10, gTextPivotTopLeft);
  tft.printAtPivoted(tambf,100,50, gTextPivotTopLeft);
//tft.fillArc(120, 200, 40, 10, 0, tobjavg, WHITE);
 delay(100);
}

Comments

Similar projects you might like

GPS Location Display With GPS And TFT Display Shields

Project tutorial by Boian Mitov

  • 8,803 views
  • 5 comments
  • 23 respects

An Adequate Thermometer

Project tutorial by Jayraj Desai

  • 3,707 views
  • 1 comment
  • 9 respects

Soil Moisture Sensor With LCD Display

Project tutorial by Patel Darshil

  • 19,351 views
  • 4 comments
  • 37 respects

Arduino Based Weather Station with Remote Sensor Unit

Project showcase by antiElectron

  • 8,937 views
  • 7 comments
  • 45 respects

Arduino-based Digital Scale with HX711 and VFD Display

Project showcase by antiElectron

  • 5,590 views
  • 0 comments
  • 22 respects
Add projectSign up / Login