The GY906 is a digital temperature sensor module based on the MLX90614 infrared sensor. It is designed to measure the temperature of objects without requiring direct contact, utilizing infrared radiation. This makes it an excellent choice for non-invasive temperature measurement in a wide range of applications. The GY906 is widely used in medical devices, HVAC systems, robotics, and industrial automation, where accurate and reliable temperature readings are essential.
The module communicates using the I2C protocol, making it easy to integrate with microcontrollers such as the Arduino UNO. Its compact size and high precision make it a versatile and user-friendly component for temperature sensing projects.
The GY906 module has four pins, as described in the table below:
Pin Name | Description | Notes |
---|---|---|
VIN | Power supply input | Connect to 3.3V or 5V |
GND | Ground | Connect to the ground of the circuit |
SCL | Serial Clock Line (I2C) | Connect to the SCL pin of the microcontroller |
SDA | Serial Data Line (I2C) | Connect to the SDA pin of the microcontroller |
Adafruit_MLX90614
library from the Arduino Library Manager.#include <Wire.h>
#include <Adafruit_MLX90614.h>
// Create an instance of the MLX90614 sensor
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("GY906 Temperature Sensor Test");
if (!mlx.begin()) {
Serial.println("Error: Could not find a valid MLX90614 sensor!");
while (1); // Halt execution if sensor initialization fails
}
}
void loop() {
// Read object and ambient temperatures
double objectTemp = mlx.readObjectTempC();
double ambientTemp = mlx.readAmbientTempC();
// Print the temperatures to the Serial Monitor
Serial.print("Object Temperature: ");
Serial.print(objectTemp);
Serial.println(" °C");
Serial.print("Ambient Temperature: ");
Serial.print(ambientTemp);
Serial.println(" °C");
delay(1000); // Wait 1 second before the next reading
}
No Data or Incorrect Readings:
0x5A
).Sensor Not Detected:
Adafruit_MLX90614
library is installed and included in the code.Inaccurate Temperature Readings:
Q: Can the GY906 measure the temperature of liquids?
A: Yes, the GY906 can measure the temperature of liquids as long as the liquid's surface is visible to the sensor and within its field of view.
Q: What is the maximum distance for accurate temperature measurement?
A: The effective distance depends on the size of the target object and its emissivity. For small objects, the sensor should be placed closer for accurate readings.
Q: Can I use the GY906 with a 3.3V microcontroller?
A: Yes, the GY906 is compatible with both 3.3V and 5V systems.
Q: How do I change the I2C address of the sensor?
A: Changing the I2C address requires reprogramming the sensor's EEPROM. Refer to the MLX90614 datasheet for detailed instructions.