Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cyrusmeh/1c7d51b29deed5bf2d3fdee3823a3b56 to your computer and use it in GitHub Desktop.

Select an option

Save cyrusmeh/1c7d51b29deed5bf2d3fdee3823a3b56 to your computer and use it in GitHub Desktop.
In this project, we'll walk you through the process of building a simple thermometer using the WeMos D1 Mini, AMG8833 thermal camera, and a TM1637 4-digit 7-segment display module. You'll learn how to measure temperature with the thermal camera, transmit the data to the WeMos D1 Mini, and display the temperature in Celsius on the 7-segment displ…
#include <Wire.h>
#include <Adafruit_AMG88xx.h>
#include <TM1637Display.h>
// Define pins for TM1637 module
#define CLK D5
#define DIO D6
Adafruit_AMG88xx amg;
TM1637Display display(CLK, DIO);
void setup() {
Serial.begin(115200);
Wire.begin();
// Initialize the AMG8833 thermal camera
if (!amg.begin()) {
Serial.println("Could not find a valid AMG88xx sensor, check wiring!");
while (1);
}
// Initialize the TM1637 display
display.setBrightness(7); // Brightness range: 0-7
}
void loop() {
float pixels[64]; // AMG8833 has 8x8 pixels
amg.readPixels(pixels);
float maxTemp = pixels[0];
for (int i = 1; i < 64; i++) {
if (pixels[i] > maxTemp) {
maxTemp = pixels[i];
}
}
int tempInt = (int)maxTemp; // Convert float to integer for display
Serial.print("Max Temp: ");
Serial.print(maxTemp);
Serial.println(" C");
// Display temperature on 7-segment display
display.showNumberDec(tempInt);
delay(1000); // Update every second
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment