Enzo Trevizan
Published © MIT

Temperature sensor

Program to measure the temperature of objects, using a gy-906 temperature sensor.

BeginnerFull instructions provided1 hour218

Things used in this project

Hardware components

Arduino MKR Zero
Arduino MKR Zero
×1
gy-906
×1

Software apps and online services

POWER-KI - Programming Language
PowerBerry POWER-KI - Programming Language

Story

Read more

Schematics

Connections

Code

Power-KI Package

Plain text
No preview (download only).

Arduino Sketch

Arduino
#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

unsigned short crv[3];
#define HEADSAM 0xFAFB

#define CRV_HEAD crv[0]
#define CRV_TEMP crv[1]
byte* buff;

void setup() {
  Serial.begin(9600);

  Serial.println("Adafruit MLX90614 test");  

  mlx.begin();
  CRV_HEAD = HEADSAM;
  buff= (byte*) crv;
}

void loop() {
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); 
    Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC());
    Serial.println("*C");

  CRV_TEMP = mlx.readObjectTempC() ;
  Serial.write(buff, 10);

  Serial.println();
  delay(15);
}

Credits

Enzo Trevizan
2 projects • 0 followers

Comments