You can easily wire this breakout to any microcontroller, we'll be using an Arduino. You can use any other kind of microcontroller as well as long as it has I2C clock and I2C data lines.
I2C Wiring
- Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V (red wire on STEMMA QT version)
- Connect GND to common power/data ground (black wire on STEMMA QT version)
- Connect the SCL pin to the I2C clock SCL pin on your Arduino. (yellow wire on STEMMA QT version)
On an UNO & '328 based Arduino, this is also known as A5, on a Mega it is also known as digital 21 and on a Leonardo/Micro, digital 3
- Connect the SDA pin to the I2C data SDA pin on your Arduino. (blue wire on STEMMA QT version)
On an UNO & '328 based Arduino, this is also known as A4, on a Mega it is also known as digital 20 and on a Leonardo/Micro, digital 2
By default, the I2C address is 0x69. If you solder the jumper on the back of the board labeled "Addr", the address will change to 0x68.
Download Adafruit_AMG88xx library
To begin reading sensor data, you will need to install the Adafruit_AMG88xx library.
Start up the IDE and open the Library Manager:
Type in AMG88xx until you see the Adafruit Library pop up. Click Install!
We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
Load Test
Open up File->Examples->Adafruit_AMG88xx->amg88xx_test and upload to your Arduino wired up to the sensor. This example just connects to the sensor and reads the internal thermistor to test your connections.
Once uploaded to your Arduino, open up the serial console at 9600 baud speed to see the internal thermistor reading. If you get a reading of ~26° degrees (room temperature) then everything is wired and working correctly!
Pixel Array Output
OK now that we know the sensor is working, let's read actual thermal data. Load up File -> Examples -> Adafruit_AMG88 -> pixels_test
Upload the code, and open the serial console at 9600 baud rate. You should see a printout of the array of readings every second. Each number is the detected temperature in Celsius, and in the 8x8 grid order that comes from the sensor
The numbers should increase if you put your hand or face above the sensor. They'll decrease if you hold up something cold in front of the sensor eye
Adafruit_AMG88xx amg;
Initialize the sensor using
status = amg.begin(); if (!status) { Serial.println("Could not find a valid AMG88xx sensor, check wiring!"); while (1); }
to read the pixels you will need an array to place the readings into. Once you have one, you can call readPixels. Make sure the array you create is big enough by using the pre-defined AMG88xx_PIXEL_ARRAY_SIZE macro.
float pixels[AMG88xx_PIXEL_ARRAY_SIZE]; amg.readPixels(pixels);
Text editor powered by tinymce.