Arduino library · Sensors

SparkFun GridEYE AMG88 Library: an example that runs

Yes. You can use the SparkFun GridEYE AMG88 Library online in Mokxi with nothing to install, and the sketch runs in your browser against the simulated part (Thermal camera, AMG8833). The example below, "A heat camera in the serial monitor", runs on the Arduino Uno R3.

Built in on Mokxi: #include <SparkFun_GridEYE_Arduino_Library.h> and it builds, with nothing to install. Free, and no account needed.

What SparkFun GridEYE AMG88 Library does

The Panasonic Grid-EYE 8x8 thermal camera: each pixel in C, F or raw, the thermistor, frame rate, sleep and standby, the moving average and the interrupt levels and table. That is what SparkFun GridEYE AMG88 Library, by SparkFun Electronics, covers. The sketch below uses it on the Arduino Uno: “A heat camera in the serial monitor”.

SparkFun's Grid-EYE library (1.0.x), for the Panasonic AMG88xx 8x8 thermal camera: sixty-four pixel temperatures, the thermistor, frame rate, power modes, the moving average and the interrupt levels.

Use the amg8833 part on the board's SDA and SCL.

The calls follow release 1.0.2 of the library, so a sketch written here builds on a real board too. The example is the one Mokxi's own tests build and run, so what is printed here is what runs.

Library Manager nameSparkFun GridEYE AMG88 Library
AuthorSparkFun Electronics
Include#include <SparkFun_GridEYE_Arduino_Library.h>
Boardsevery board Mokxi compiles for but ATtiny85
In the simulatorSimulated: it runs against the part the way it does on the bench.
Parts it drivesThermal camera, AMG8833

Install it

It builds on every board Mokxi compiles for but ATtiny85.

In Mokxi it is built in: #include <SparkFun_GridEYE_Arduino_Library.h> and the sketch compiles, with no download, no zip and no Library Manager.

On a real board, install "SparkFun GridEYE AMG88 Library" by SparkFun Electronics from the Arduino IDE’s Library Manager (Sketch, Include Library, Manage Libraries), or add SparkFun GridEYE AMG88 Library to lib_deps in PlatformIO. Mokxi follows the calls of release 1.0.2, so a sketch written here builds there too.

What to know in the simulator: The interrupt difference mode and hysteresis are stored but not modeled by the part.

The calls you will use

In the order a sketch meets them.

GridEYE grideye

Makes grideye, the GridEYE object the calls below are made on.

grideye.begin()

Starts it up. Call it once in setup(). Arguments: device address, wire port.

grideye.getPixelTemperature(i)

Returns the pixel temperature as a decimal number. Arguments: pixel addr.

grideye.getDeviceTemperature()

Returns the device temperature as a decimal number.

Example: A heat camera in the serial monitor

On the Arduino Uno R3. It runs in the browser exactly as printed.

sketch.ino · Arduino Uno R3
#include <SparkFun_GridEYE_Arduino_Library.h>
#include <Wire.h>

// Pixels at or below COLD show as '.', at or above HOT as 'O'.
#define HOT 40
#define COLD 20

int pixelTable[64];

GridEYE grideye;

void setup() {
  Wire.begin();
  grideye.begin();
  Serial.begin(115200);
}

void loop() {
  for (unsigned char i = 0; i < 64; i++) {
    pixelTable[i] = map(grideye.getPixelTemperature(i), COLD, HOT, 0, 3);
  }

  for (unsigned char i = 0; i < 64; i++) {
    if (pixelTable[i] == 0) { Serial.print("."); }
    else if (pixelTable[i] == 1) { Serial.print("o"); }
    else if (pixelTable[i] == 2) { Serial.print("0"); }
    else if (pixelTable[i] == 3) { Serial.print("O"); }
    Serial.print(" ");
    if ((i + 1) % 8 == 0) {
      Serial.println();
    }
  }
  Serial.println();
  Serial.print("Pixel 27: ");
  Serial.print(grideye.getPixelTemperature(27));
  Serial.print(" C, thermistor: ");
  Serial.print(grideye.getDeviceTemperature());
  Serial.println(" C");
  Serial.println();
  delay(100);
}

Wiring

  • Arduino Uno R3 A4 to Thermal camera, AMG8833 SDA
  • Arduino Uno R3 A5 to Thermal camera, AMG8833 SCL
  • Arduino Uno R3 5V to Thermal camera, AMG8833 VIN
  • Arduino Uno R3 GND to Thermal camera, AMG8833 GND

Open it in the editor, wired and ready to run

Try SparkFun GridEYE AMG88 Library without installing anything

Open the example, change the sketch, and keep your version in a free account.