⚠️ Very Important: ⚠️ You must power down your Pi before plugging in the electronics for this experiment.
Power down your pi.
Plug in your “T-Cobbler Plus” connector, as shown.
Make sure you get the connector plugged in exactly over the pins as shown! Do not twist the cable/miss any pins, or it will not work.
Power down your pi.
plug connector pins to sensor and pi as shown
Pi 3V to sensor VIN RED
Board GND to sensor GND BLACK
Board SCL to sensor SCL YELLOW
Board SDA to sensor SDA BLUE
From your command line, run the following command to install the necessary library.:
sudo pip3 install adafruit-circuitpython-sht4x
if that doesn't work, try:
sudo pip3 install adafruit-circuitpython-sht4x --break-system-packages
Open the editor “Thonny Python IDE”
Open the file from your downloaded examples : temp_humid.py
You may want to save a copy so you have the original.
Press “Run” in Thonny.
When you press the button you should see "button pressed" in the debug window.
Press “stop” to stop running the file.
Challenges
Can you calculate Fahrenheit and print it?
Add 3 external LEDs and create a minimum of four temperature thresholds, each with its own led color.
Using if statements, add 4 or more conditions that produce a sentence every minute, saying something about the temperature and humidity. Something like: "Humidity is above 80%, are you sweating already?"