Introduction
The LoRaSense RGB Pi HAT is an all-in-one Raspberry Pi expansion board that replaces multiple modules with a single, compact PCB. It combines long-range LoRa (433 MHz), a high-precision temperature & humidity sensor, a programmable RGB LED (and WS2812B header), plus a 220 VAC/10 A relay—all stackable on your Pi’s 40-pin header
Key Features
- I²C Temp & Humidity
- SHT31 sensor, ±0.2 °C and ±2 % RH accuracy
- SX1278 LoRa 433 MHz
- Up to 10 km line-of-sight, ultra-low power
- High-Voltage Relay
- 220 VAC / 10 A switching for pumps, fans, lights
- RGB LED + WS2812B Header
- Status indicator or mood lighting, programmable via GPIO
- UART & GPIO Expansion
- Terminal blocks for ESP32/STM32/Arduino + 8 extra GPIOs
- Stackable 40-Pin Header
- Add more HATs without losing any pins or functionality
Hardware Design
1. PCB Layout
- 4-layer FR-4, ground pours for EMI control, four 3 mm mounting holes
2. Module Placement
- SX1278 module for optimal antenna performance
- Relay isolated from sensor lines to minimize noise
3. Antenna Interface
- SMA connector for an external LoRa antenna
# Assembly & Software
- Getting Started PDF
- Pinout, wiring diagrams, soldering tips
1. Read SHT31 via `adafruit-circuitpython-sht31d`
2. Send/receive LoRa packets with `pySX127x`
3. Control relay & RGB LED based on sensor thresholds
- Node-RED Flow
- Optional example for MQTT-over-LoRa and dashboard
# Usage Examples
- Smart Greenhouse
- Automated irrigation when humidity < 40 % RH via HAT relay
- Remote Weather Station
- Hourly temp/humidity uplinks to The Things Network → InfluxDB
- Alert System
- Flash LED red if T > 35 °C or humidity > 80 %