Build Your Own Scientific Sensors with Raspberry Pis (2025 Edition)

Raspberry Pi on lab bench

In recent years, the Raspberry Pi has become one of the most powerful, low-cost tools for scientific data collection, monitoring, and analysis. Whether you’re measuring stream temperatures in a remote watershed, tracking air quality in an urban corridor, or logging soil moisture in an agricultural field — a Raspberry Pi can do the job for under $100.

This guide walks through:

  • What Raspberry Pis are best for scientific use
  • Popular sensor types and applications
  • Example projects (with code)
  • How to set up remote access & networking
  • Tips for reliable, field-deployable sensor systems

What is a Raspberry Pi?

The Raspberry Pi is a credit-card sized computer that runs Linux, has GPIO pins (General Purpose Input/Output), and supports a wide range of sensors. It’s cheap, durable, and programmable with Python.

Most of our scientific Raspberry Pi projects utilize the Raspberry Pi 5, Raspberry Pi 4, Pi 400, or Raspberry Pi Zero 2 W. We are making the assumption here that your RPi has access to power. However, in the field, that may not always be the case. Stay tuned for more on that. We are also using the RPi 4 here as an example. Mainly because this is our primary field unit. It has lower power demands than the RPi 5 and has a robust offering of tested mobile power solutions.


What You’ll Need

Raspberry Pi kit

Essential Components:

Item Use Amazon Link
Raspberry Pi 4 (4GB) Core computer Check price
MicroSD card (32GB+) OS + data storage Check price
Power supply (USB-C, 5V 3A) Stable power Check price
DS18B20 digital temp sensor High-accuracy water/soil temp Check price
DHT22 sensor Humidity + temperature Check price
Breadboard + jumper wires Prototyping Check price
Plastic enclosure (IP65+) Weatherproof housing Check price

Optional:

  • GPS module for tagging locations
  • WiFi/4G dongle for remote sync
  • Solar power bank for field deployments

Field Sensor Type Use Case
Hydrology DS18B20 Monitor stream or groundwater temp
Ecology PIR motion sensor Wildlife trap camera or presence logging
Air Quality MQ135 / PMS5003 Measure CO2, PM2.5/PM10
Agriculture Soil moisture probes Irrigation control + drought detection
Geology Accelerometer Earth tremor logging
Climate DHT22 + BMP280 Air temp, humidity, pressure logging

These sensors are cheap (under $15), reliable, and easily replaceable — perfect for distributed deployments or long-term field studies.


Example Project: DIY Temperature Logger

Let’s walk through building a simple water/soil temperature logger using a DS18B20 digital sensor and Raspberry Pi 4.

Wiring

  • Connect DS18B20 to GPIO pin 4
  • Add a 4.7kΩ resistor between VCC and data pin
  • Use a waterproof DS18B20 if deploying in wet conditions

🐍 Python Code

import os
import glob
import time

# Load kernel modules
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')

# Find sensor file
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'

def read_temp_raw():
    with open(device_file, 'r') as f:
        lines = f.readlines()
    return lines

def read_temp():
    lines = read_temp_raw()
    while lines[0].strip()[-3:] != 'YES':
        time.sleep(0.2)
        lines = read_temp_raw()
    temp_pos = lines[1].find('t=')
    if temp_pos != -1:
        temp_string = lines[1][temp_pos+2:]
        temp_c = float(temp_string) / 1000.0
        return temp_c

while True:
    temperature = read_temp()
    print(f"Current Temp: {temperature:.2f}°C")
    time.sleep(60)

Store output to a .csv file or push to Google Sheets/InfluxDB for visualization.


Remote Access + Networking

Want to monitor sensors from your laptop or phone?

Option 1: WiFi

  • Use Raspberry Pi Zero 2 W or Pi 4 with built-in WiFi
  • Run a Flask or FastAPI app for local dashboard
  • Use Tailscale or Zerotier for secure remote access (recommended)

Option 2: 4G/LTE Modem

  • Add a USB modem or HAT (e.g. Sixfab LTE Base HAT)
  • Connect Pi to mobile network in the field
  • Upload sensor data to cloud every hour/day

Bonus: Sync Your Data to the Cloud

  • Google Sheets API for quick team access
  • InfluxDB + Grafana for beautiful time-series dashboards
  • Dropbox or S3 for dead-simple CSV syncing
  • Use crontab + rsync or Python’s requests to automate uploads

Real-World Example Use Cases

Aquatic Ecology – Stream Temperature Network

Researchers deploy dozens of Pi-based loggers with waterproof DS18B20s in alpine streams. Data is logged every 15 mins, backed up daily, and synced via LTE signal.

Urban Climate Monitoring

A network of Pi Zero 2s + DHT22 sensors are mounted on rooftops in a city. Data is pushed to an InfluxDB instance via LTE.

Forest Soil Sensors

Raspberry Pis control soil moisture and temperature probes at 5cm/20cm depths. Used to study belowground drought stress. Solar powered with 10,000mAh banks.


Tips for Reliable Field Deployment

  • Use sealed IP65+ enclosures with cable glands
  • Add desiccant packets inside cases
  • Power with solar + USB battery banks
  • Schedule reboots and backups via cron
  • Add logging and failsafes to catch sensor disconnections

For long deployments, a watchdog timer or remote SSH check-in script is highly recommended.


Where to Buy Parts

You can find Raspberry Pis and compatible sensors on:

We recommend bundling your purchases into kits — many of the top sellers on Amazon include everything you need to get started.

Browse Raspberry Pi sensor kits on Amazon


Final Thoughts

The Raspberry Pi has made scientific sensing accessible to everyone — from grad students on tight budgets to large research teams deploying networked environmental stations. With just a few components and basic Python skills, you can log temperature, detect motion, measure air quality, or monitor crop conditions — all with a device that fits in your palm.

Whether you’re logging data in the field or creating a classroom project that shows real-world data in real time, Raspberry Pis are the backbone of open science sensors in 2025.

Build your own scientific sensor kit on Amazon