For the individual assignment, I designed and fabricated a custom sensor extension PCB that allows me to extend the reach of my SHT45 temperature/humidity sensors throughout the beehive. The board interfaces with the Adafruit PCA9548 I²C multiplexer, which connects to the Raspberry Pi 5.
Sensor — Adafruit SHT45 with PTFE Membrane
For the input device, I'm using the Adafruit Sensirion SHT45 precision temperature and humidity sensor with a PTFE filter membrane. I have 3 of these sensors for the Smart Beehive project — one per hive box. The PTFE membrane makes them suitable for high-humidity environments like the inside of a beehive — it protects the sensor element from water and contaminants while still allowing accurate readings.
SHT45 Specifications
- Interface: I²C (address 0x44)
- Temperature accuracy: ±0.1°C
- Humidity accuracy: ±1% RH
- PTFE membrane: Protects against water, dust, and contaminants
- Voltage: 3.3V
- Quantity: 3 (one per hive box)
Sensor Extension Board — Longer Cable Runs
I have 3 SHT45 sensors that will be placed in each hive box to monitor temperature and humidity at different levels. The problem is the longest STEMMA QT / Qwiic cable I can get from Adafruit is only 300mm — not long enough to reach from the multiplexer at the bottom of the hive up through the boxes to where the sensors need to sit.
So I designed a simple extension board with two female connectors on either end. By chaining a 300mm cable into the extension board and then another 300mm cable out the other side, I can double (or triple) the reach. The board is just a pass-through — it connects VCC, GND, SDA, and SCL straight through from one connector to the other. Simple, but it solves the cable length problem without needing to solder custom-length cables.
The extension board uses the same STEMMA QT / Qwiic connector system from Adafruit — a standardized 4-pin JST SH connector that carries I²C (SDA, SCL, 3.3V, GND). This makes the whole sensor system modular and easy to work with: sensors, multiplexer, and extension boards all click together with the same cables. No soldering, no custom wiring — just plug and go.
Designing the Board
Schematic — simple pass-through connecting VCC, GND, SDA, and SCL between two STEMMA QT connectors
PCB layout — two connectors with traces routing the I²C signals straight through
3D board preview — compact extension board with connectors on each end
Milling & Soldering the Extension Board
Milled sensor extension board — ready for soldering
Soldered extension board with both STEMMA QT connectors attached
Connector Rotation Fix
After I plugged everything together for the first time, I discovered an issue — the STEMMA QT cables can only be plugged in one way (they're keyed), and both connectors on my board were facing the same direction. This meant the pin order was mirrored between the two connectors — SDA on one side was connecting to SCL on the other, and vice versa. The signal wasn't passing through correctly.
The fix was to rotate one of the connectors 180° on the board so that when a cable plugs into each side, the pins line up correctly: VCC→VCC, GND→GND, SDA→SDA, SCL→SCL. I made this change to the design, resoldered the connector, and tested again — this time it worked perfectly.
Extension board plugged into the sensor chain — connector rotation fixed
Successful test — sensor readings coming through the extension board after the connector rotation fix
Multiplexer Wiring — Adafruit PCA9548
Each SHT45 sensor is connected to the Adafruit PCA9548 I²C multiplexer, which allows the Pi to talk to all 3 sensors (they all share the same I²C address 0x44). The multiplexer sits at address 0x70 on the I²C bus and switches between channels to read each sensor individually.
| Pi GPIO | Mux Pin | Wire Color |
|---|---|---|
| 3V3 | VIN | Red |
| GND | GND | Black |
| GPIO 3 (SCL) | SCL | Yellow |
| GPIO 2 (SDA) | SDA | Blue |
Sensor channel assignments:
- Sensor 1 → Mux Channel 0
- Sensor 2 → Mux Channel 1
- Sensor 3 → Mux Channel 2
Each sensor connects to the multiplexer via STEMMA QT cables (and extension boards where needed for longer runs). The whole chain is: Pi → Multiplexer → STEMMA QT cable → Extension board (if needed) → STEMMA QT cable → SHT45 sensor. The modularity of the STEMMA QT system makes it easy to add, remove, or reposition sensors without any rewiring.
Reading the Sensor — Python on Raspberry Pi 5
Raspberry Pi 5 as the Microcontroller
For this project, the Raspberry Pi 5 serves as the microcontroller that reads the input devices. While the Pi 5 is technically a single-board computer, it functions as a microcontroller in this context — it has GPIO pins, an I²C bus, runs embedded Python code to interface directly with hardware, and controls the sensor system in real time. The custom board I designed (the sensor extension PCB) is part of the I²C circuit that connects the sensors to the Pi's I²C bus, enabling the Pi to read the SHT45 sensors over longer cable distances than would otherwise be possible.
With the extension board in place, the full signal chain is: Raspberry Pi 5 → I²C → PCA9548 Multiplexer → STEMMA QT cable → Extension Board → STEMMA QT cable → SHT45 sensor. The Pi reads temperature and humidity data from each sensor through the multiplexer using Python and the Adafruit CircuitPython libraries.
Libraries Used
adafruit-circuitpython-sht4x— driver for the SHT45 sensoradafruit-circuitpython-tca9548a— driver for the PCA9548 I²C multiplexeradafruit-circuitpython-busdevice— I²C bus abstraction
Installation
pip3 install adafruit-circuitpython-sht4x adafruit-circuitpython-tca9548a
Code — Reading 3 SHT45 Sensors via Multiplexer
# read_sensors.py
# Reads temperature and humidity from 3x SHT45 sensors
# connected via PCA9548 I2C multiplexer on Raspberry Pi 5
import time
import board
import adafruit_sht4x
import adafruit_tca9548a
# Initialize I2C bus and multiplexer
i2c = board.I2C()
mux = adafruit_tca9548a.TCA9548A(i2c)
# Sensor locations in the hive
sensor_labels = ["Bottom Box", "Middle Box", "Top Box"]
while True:
print(f"--- Hive Sensor Readings ---")
for channel in range(3):
try:
sensor = adafruit_sht4x.SHT4x(mux[channel])
sensor.mode = adafruit_sht4x.Mode.NOHEAT_HIGHPRECISION
temperature = sensor.temperature
humidity = sensor.relative_humidity
print(f" {sensor_labels[channel]}: {temperature:.1f}°C | {humidity:.1f}% RH")
except Exception as e:
print(f" {sensor_labels[channel]}: Error - {e}")
print()
time.sleep(5)
Example Output
--- Hive Sensor Readings ---
Bottom Box: 33.2°C | 58.4% RH
Middle Box: 34.7°C | 62.1% RH
Top Box: 35.1°C | 65.8% RH
Relating Measurements to Physical Properties
The SHT45 measures two physical properties:
- Temperature (°C) — The sensor contains a tiny heating element and thermistor. It measures the thermal energy of the air passing through the PTFE membrane. Inside a healthy beehive, the brood nest is maintained at approximately 34–36°C by the bees. Readings outside this range can indicate problems — too cold means the colony is struggling, too hot could mean overheating or direct sun exposure.
- Relative Humidity (% RH) — The sensor has a capacitive humidity element that changes capacitance as water vapor is absorbed. Bees maintain hive humidity around 50–70% RH. High humidity (>80%) can promote mold growth and disease, while low humidity can dry out developing brood. The PTFE membrane is critical here — it prevents liquid water and contaminants from reaching the sensor while still allowing water vapor through for accurate readings.
By placing sensors at three levels in the hive (bottom, middle, top), I can monitor the temperature and humidity gradient. Heat rises, so the top box is typically warmest. This data helps assess colony health without opening the hive and disturbing the bees.
Design Files
Sensor Extension Board: