AMG8833 Infrared Sensor howto
Many pages of search returned an abridged datasheet that is only useful if you intent to use an external library.
Basic
ConnectionThe AMG8833 seems to cope with a very basic / minimal
Hello World
The most basic thing I could think to do to check the sensor at least sort of works, a "Hello Word" if you will is to read the first byte of pixel data... and.. it worked!
This is with the sensor on the breadboard pointing at the ceiling
# i2cget -y 1 0x68 128
0x6b
Holding my hand over it
# i2cget -y 1 0x68 128
0x79
Making sense of the numbers
# i2cget -y 1 0x68 128
0x6b
# i2cget -y 1 0x68 129
0x00
the high byte is 0, so no need to do anything complicated.
0x6b is 0b0000_0110_1011 = decimal 107.
Each integer increment is 0.25°C.
107 x 0.25°C = 26.75°C. My hand would have been 30.25°C
Efficiencies
Reading the entire grid in bytes, is tedious... and slow... 389ms to read all 64 pixels (and this was the lo bytes ONLY).
#!/bin/bash
for i in {0..63}; do
lb=$(($i*2+128))
lb=`i2cget -y 1 0x68 $lb `
b=$(($lb))
m=$(($i%8))
if [ $m -eq 0 ]; then echo "" ; fi
echo -n "$b,"
done
echo ""
Negative ° and 2's complement
Holding an item from the freezer over the sensor I read lb=0xfc hb=0x0f giving me
0b1111_1111_1100
-000_0000_0011 (take the sign and invert)
-000_0000_0100 (add 1)
gives you -4°C
But I'm too impatient to continue this in bash.
Python and block read
<I'm going to come back to this with a higher resolution device>