# Raspberry Pi

The Raspberry Pi 3B+ paired with a Grove Base Hat is used as a flexible data logger for the following sensors: **light, temperature, humidity, pressure, wind speed/direction, and rainfall** utilizing the [3D-PAWS Python library](https://github.com/3d-paws/3D-PAWS-Raspberry-Pi). This setup supports both cellular and Wi-Fi connectivity for remote data transmission. The Grove Hat simplifies sensor connections via I2C, UART, or analog ports, while an optional cellular modem can be added for 2G/LTE connectivity. Data is stored locally on an SD card as a backup if cellular or Wi-Fi fails. The 3D-PAWS library provides pre-built scripts for sensor polling and data logging,

### Instruction Slides for Assembling the Data Logger

{% embed url="<https://docs.google.com/presentation/d/1JU07RYiDDo_5ZBtzBfRU4AUMXfluJfyj/edit?ouid=102244773211795243299&rtpof=true&sd=true&usp=sharing>" %}

### Sensors Supported

* Light sensor
* Rain Gauge
* Anemometer
* Wind Vane
* Radiation Shield (Temperature, Pressure, & Relative Humidity)

### Download the 3D-PAWS software

{% embed url="<https://github.com/3d-paws/3D-PAWS-Raspberry-Pi>" %}

## Raspberry Pi Data Logger Architecture

A Raspberry Pi acts as a full local computer that collects sensor data and transmits it directly to data services.

```
Sensors
   ↓
Raspberry Pi Data Logger
   ↓
Local Storage (SD Card)
   ↓
WiFi / Cellular Modem
   ↓
CHORDS Data Portal
   ↓
Grafana Visualization
```

Because the Raspberry Pi runs Linux, it can also perform:

* local data processing
* advanced sensor integration
* custom software execution

{% hint style="info" %}

### Note: The Raspberry Pi 3B+ and 4 models require significantly more power than microcontroller-based options like the Particle Boron. While the Particle Boron can operate efficiently on the smaller Voltaic solar panels and batteries we recommended, the Raspberry Pi 3B+ and 4 typically need a much larger solar panel and battery setup to ensure reliable, continuous operation-especially in remote or off-grid deployments. See below for power requirements and recommendations.

{% endhint %}

## Raspberry Pi 3B+ System Power Budget <a href="#raspberry-pi-3b-system-power-budget" id="raspberry-pi-3b-system-power-budget"></a>

| **Component**              | **Function**                                        | **Supply Voltage**  | **Avg. Current (mA)** | **Peak Current (mA)** | **Notes**                        |
| -------------------------- | --------------------------------------------------- | ------------------- | --------------------- | --------------------- | -------------------------------- |
| **Raspberry Pi 3B+**       | SBC, data logging, control                          | 5 V                 | 400                   | 950                   | WiFi on, HDMI/LEDs off           |
| **Grove Base HAT**         | GPIO expansion, Grove interface                     | 3.3 V               | 5                     | 5                     | Enables Grove sensors            |
| **Adafruit BMP390**        | Pressure & altimeter sensor                         | 3.3 V               | 0.8                   | 0.8                   | I2C, always on                   |
| **Adafruit SHT31-D**       | Temp & humidity sensor                              | 3.3 V               | 0.5                   | 0.5                   | I2C, always on                   |
| **Adafruit MCP9808**       | High-accuracy temp sensor                           | 3.3 V               | 0.2                   | 0.2                   | I2C, always on                   |
| **AS5600**                 | Rotational position sensor for wind vane            | 3.3 V               | 4.5                   | 4.5                   | I2C, always on                   |
| **SI1145**                 | UV/IR/Visible light sensor                          | 3.3 V               | 0.4                   | 0.4                   | I2C, always on                   |
| **2 × SS451A Hall Effect** | Magnetic switch sensors for rain gauge & anemometer | 3.3 V               | 9.0                   | 9.0                   | Each \~4.5 mA, always on         |
| **Buck Converter**         | Voltage regulation                                  | 12–18 V in, 5 V out | —                     | —                     | Assume 85% efficiency            |
| **Total System**           | —                                                   | —                   | **420.4**             | **970.4**             | All sensors powered continuously |

### System Power Profile <a href="#system-power-profile" id="system-power-profile"></a>

**Average Power Consumption:**

* 420.4 mA × 5 V = 2.10 W

With 85% buck converter efficiency:

* 2.10 W ÷ 0.85 ≈ 2.47 W drawn from the battery

**Peak Power Consumption:**

* 970.4 mA × 5 V = 4.85 W

With 85% buck converter efficiency:

* 4.85 W ÷ 0.85 ≈ 5.71 W drawn from the battery

**Solar Panel:**

* A 20 W panel provides ample margin for continuous operation and battery charging.

**Battery Sizing (example, 12 V system):**

For 24 hours runtime at 2.47 W average:

* 2.47 W × 24 h = 59.3 Wh

**For a 12 V battery:**

* 59.3 Wh ÷ 12 V ≈ 4.94 Ah

**Add a Safety Margin**

Add at least 30% extra for cloudy days, battery aging, and inefficiency:

* 4.94 Ah × 1.3 ≈ 6.4 Ah

**Choose a Standard Battery Size**

* **Recommended minimum:** 12V, 7Ah battery (common size)
* ***For more backup (2–3 days), consider a 12V, 12–20Ah battery***

> **Notes:**
>
> * Pi 3B+ current draw is measured with HDMI and LEDs off, WiFi enabled, and no USB peripherals.
> * All sensors are I2C and powered from the Pi’s 3.3 V rail via Grove HAT.
> * Actual current draw may vary with workload and peripherals.
