Thermal IR-Camera

From SGMK-SSAM-WIKI
Jump to navigation Jump to search

ThermalCam PD.png

Yeah, that's me, dusjagr, smoking a cigarette :-)

Single-Pixel rat-detection.png

and that's a Rat-in-a-Box

Rat-in-a-Box.jpg

Parts

Omron's D6T Series MEMS Thermal Sensors, 4x4 pixel.

also called "human presence sensors" :-)

http://www.mouser.com/ds/2/307/D6T_datasheet_Nov2012-237760.pdf

http://ch.mouser.com/ProductDetail/Omron-Electronics/D6T-44L-06/?qs=IQwVXVmkiFL3XeQ%252bJMEhQw==

Arduino

The arduino code, using the Wire library to communicate with I2C, sadly can only buffer 32 values... and we need to read 35. so the last pixel is missing :-(

#include <Wire.h>



void setup()

{

  Wire.begin();                // join i2c bus (address optional for master)

  Serial.begin(9600);          // start serial communication at 9600bps

}



int reading = 0;

int count=0;

char buf[3];



void loop()

{

  // step 3: instruct sensor to return a particular echo reading

  Wire.beginTransmission(0x0a);

  Wire.write(byte(0x4c));      // sets register pointer to echo #1 register (0x02)

  Wire.endTransmission(false);      // stop transmitting

  // step 4: request reading from sensor

  Wire.requestFrom(0x0a, 32);    // request 2 bytes from slave device #112



  // step 5: receive reading from sensor

  count=0;

  while(count<32)

  {

  if(2 <= Wire.available())    // if two bytes were received

  {

    reading = Wire.read();  // receive high byte (overwrites previous reading)

    reading+= Wire.read()<<8;

    Serial.print(reading);   // print the reading

    Serial.print(" ");

    count+=2;

  }

  }
  //while(Wire.available()<1);
  //reading = Wire.read();

  Serial.println();

}

PD

IR-cam-pd-patch.png

File:IR-cam.zip