Thermal IR-Camera: Difference between revisions
Jump to navigation
Jump to search
(Created page with "320px") |
No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[File:ThermalCam_PD.png|320px]] | [[File:ThermalCam_PD.png|320px]] | ||
Yeah, that's me, dusjagr, smoking a cigarette :-) | |||
[[File:Single-Pixel_rat-detection.png|320px]] | |||
and that's a Rat-in-a-Box | |||
[[File:Rat-in-a-Box.jpg|320px]] | |||
=== 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 :-( | |||
<syntaxhighlight lang="c"> | |||
#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(); | |||
} | |||
</syntaxhighlight> | |||
=== PD === | |||
[[File:IR-cam-pd-patch.png|320px]] | |||
[[File:IR-cam.zip]] | |||
Latest revision as of 12:38, 19 September 2013
Yeah, that's me, dusjagr, smoking a cigarette :-)
and that's a Rat-in-a-Box
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();
}