Connecting "SHT-30 Mesh-protected Weather-proof Temperature/Humidity Sensor" to Raspberry Pi

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
test_2024_abc
 
Posts: 1
Joined: Tue May 23, 2023 8:58 am

Connecting "SHT-30 Mesh-protected Weather-proof Temperature/Humidity Sensor" to Raspberry Pi

Post by test_2024_abc »

Hi.

I need some guidance on the "SHT-30 Mesh-protected Weather-proof Temperature/Humidity Sensor".

1. Can I simply use the following short code to read values from the sensor? See, https://learn.adafruit.com/adafruit-sht ... cuitpython

Code: Select all

import board
import busio
import adafruit_sht31d
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_sht31d.SHT31D(i2c)
print('Humidity: {0}%'.format(sensor.relative_humidity))
print('Temperature: {0}C'.format(sensor.temperature))
Or is it recommended to use smbus and do the calculations yourself?

Code: Select all

import smbus
import time
bus = smbus.SMBus(1)
bus.write_i2c_block_data(0x44, 0x2C, [0x06])
......
2. What type of cables are needed to connect the sensor to Raspberry Pi? Are "Female/Female Jumper Wires" sufficient to connect the four sensor pins to the Raspberry Pi?

Thank you very much.

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: Connecting "SHT-30 Mesh-protected Weather-proof Temperature/Humidity Sensor" to Raspberry Pi

Post by adafruit_support_carter »

The first code approach should work:
https://learn.adafruit.com/adafruit-sht ... ng-2997653
Note that you'll need to do some initial setup on the Pi to install Blinka:
https://learn.adafruit.com/circuitpytho ... rypi-linux

For wiring, it's sort of up to you. The basic connections would be:
  • SHT30 brown/red wire to Pi 3.3V
  • SHT30 black wire to Pi GND
  • SHT30 yellow wire to Pi SCL
  • SHT30 green/blue wire to Pi SDA
The spade style connectors on the SHT30 won't directly connect, so some adapting will be needed. Are you OK with cutting those spade connectors off?

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”