Thermal IR-Camera: Difference between revisions
Jump to navigation
Jump to search
(→Parts) |
|||
| Line 15: | Line 15: | ||
=== Arduino === | === Arduino === | ||
The Arduino Code | The Arduino Code sadly can only buffer 32 values... and we need to read 35. so the last pixel is missing :-( | ||
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
| Line 94: | Line 94: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== PD === | === PD === | ||
Revision as of 17:13, 17 September 2013
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 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();
}