The Adafruit PCT2075 is a digital temperature sensor module that offers high-accuracy temperature measurements using I2C communication. This sensor is based on the PCT2075 temperature sensor IC and is designed for easy integration into a wide range of electronic projects, including environmental monitoring, system temperature feedback, and IoT applications.
Pin Number | Pin Name | Description |
---|---|---|
1 | VDD | Power supply (2.7V to 5.5V) |
2 | SDA | I2C Data line |
3 | SCL | I2C Clock line |
4 | OS | Over-temperature Shutdown output (active low) |
5 | GND | Ground |
#include <Wire.h>
// PCT2075 I2C address (default)
#define PCT2075_ADDRESS 0x28
// Register addresses
#define TEMP_REGISTER 0x00
void setup() {
Wire.begin(); // Initialize I2C
Serial.begin(9600); // Start serial communication
}
void loop() {
Wire.beginTransmission(PCT2075_ADDRESS);
Wire.write(TEMP_REGISTER); // Point to the temperature register
Wire.endTransmission();
Wire.requestFrom(PCT2075_ADDRESS, 2); // Request 2 bytes from the sensor
if (Wire.available() == 2) {
int tempRaw = Wire.read() << 8 | Wire.read(); // Read the temperature value
float temperature = tempRaw / 256.0; // Convert to Celsius
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
}
delay(1000); // Wait for 1 second before reading again
}
Q: Can I change the I2C address of the sensor? A: Yes, the PCT2075 has configurable I2C addresses. Refer to the datasheet for instructions on setting a different address.
Q: What is the maximum distance for the I2C bus? A: I2C is typically used for short distances, but with proper bus buffering and lower speeds, it can be extended. Keep the lines as short as possible for reliable communication.
Q: How do I calibrate the sensor? A: The PCT2075 is factory-calibrated. However, if you need to adjust the readings, this should be done in software by applying an offset.
Q: Is the sensor waterproof? A: No, the Adafruit PCT2075 is not waterproof. Protect it from moisture and liquids to ensure proper operation.