Your shopping cart is empty!
Measure Temperature Using PCT2075 Sensor And Maker Pi Pico
- Hussien Jawhar Sathik
- 08 Jul 2022
- Tutorial
- 960
Introduction
In this simple tutorial it is demonstrated how to interface the PCT2075 temperature sensor with Maker Pi Pico and display the value on the Sparkfun RGB LCD. The PCT2075 temperature sensor by NXP is a replacement for the common i2C temperature sensor, LM75. The PCT2075 can be configured to work in three different states which means 27 PCT2075s can be connected on the same bus. And the breakout board comes with the STEMMA QT JST SH connector which allows the user get going without the needing to solder.
Video
Hardware Setup
This are the devices used in this tutorial
The connection between the devices are done as shown in the figure below
Coding
Below is the code in this tutorial
#include
#include
#include
Adafruit_PCT2075 PCT2075;
SerLCD lcd;
void setup() {
Wire.begin();
lcd.begin(Wire);
PCT2075 = Adafruit_PCT2075();
lcd.clear();
lcd.setBacklight(255, 255, 255);
lcd.setContrast(3);
lcd.setCursor(0,0);
lcd.print("Raspb Pi Pico");
lcd.setCursor(0,1);
lcd.print("Adafruit PCT2075");
delay(3000);
Serial.begin(115200);
Serial.println("Adafruit PCT2075 Test");
if (!PCT2075.begin()) {
Serial.println("Couldn't find PCT2075 chip");
while (1);
}
Serial.println("Found PCT2075 chip");
}
void loop() {
Serial.print("Temperature: ");
Serial.print(PCT2075.getTemperature());
Serial.println(" C");
lcd.clear();
lcd.print("Temperature: ");
lcd.setCursor(0,1);
lcd.print(PCT2075.getTemperature());
lcd.println(" C");
delay(1000);
}
Thank You
Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.
"Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for a better application."