The Gravity: Digital Infrared Temperature Sensor (SEN0245) by DFRobot is a high-precision sensor for measuring temperature without the need to physically contact the object. Utilizing infrared technology, it can measure the surface temperature of an object within its field of view. Common applications include temperature monitoring for industrial systems, home automation, environmental monitoring, and hobbyist projects with microcontrollers such as the Arduino UNO.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V to 5V) |
2 | GND | Ground connection |
3 | SDA | I2C Data line |
4 | SCL | I2C Clock line |
#include <Wire.h>
// SEN0245 I2C address is 0x5A (check datasheet for your device)
#define SENSOR_I2C_ADDRESS 0x5A
void setup() {
Wire.begin(); // Initialize I2C
Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
Wire.beginTransmission(SENSOR_I2C_ADDRESS);
// Request a reading from the sensor
Wire.write(0x07); // Command to read temperature (refer to datasheet)
Wire.endTransmission();
Wire.requestFrom(SENSOR_I2C_ADDRESS, 2); // Request 2 bytes from the sensor
if (Wire.available() == 2) {
// Read the bytes if available and combine them
byte highByte = Wire.read();
byte lowByte = Wire.read();
int tempRaw = (highByte << 8) | lowByte;
// Convert the raw temperature to Celsius (refer to datasheet for conversion)
float temperature = tempRaw * 0.02 - 273.15;
// Print the temperature to the Serial Monitor
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
}
delay(1000); // Wait for 1 second before next reading
}
Q: Can the sensor measure the temperature of liquids? A: No, the sensor is designed for non-contact temperature measurement of solid surfaces.
Q: What is the maximum distance for accurate temperature measurement? A: The effective distance depends on the object's size and the sensor's field of view. For best results, keep the object within a few centimeters of the sensor.
Q: How can I integrate this sensor with other microcontrollers? A: The sensor uses the I2C protocol, which is supported by most microcontrollers. Refer to your microcontroller's documentation for specific I2C implementation details.
For further assistance, please refer to the DFRobot SEN0245 datasheet and the community forums for additional support and resources.