Skip to content

hleve/rpi_data_collection

Repository files navigation

Open Source Raspberry Pi Based Data Collection

This is an open-source project for Data Collection based on low-cost Raspberry Pi single-board computers, low-cost sensor modules, 3D-printed housings, and Python code to generate human-readable data in the form of spreadsheets, either Excel (.xls) or Comma-Separated Values (.csv) files.

Goal

Python-based code for collecting data on Raspberry Pi Zero 2 W from external sensors and writing it to an internal microSD card as an Excel file. The code can be run through a simple terminal command outlined below.

This device can be used as a modular biometric and environmental data collection device or as a standalone data collection device.

The goal of this project is on making the entire process as user-friendly and accessible as possible.

Navigation

For first time setup: Directions for First Time Setup

For information on Modules: Sensors and Modules

For 3D printable enclosures: 3D Files or in a collection on Printables.com

Python File Explanation and Directions

File organization and Directions for how to use specific configurations.

To Collect Both Camera and GPS Data

Run collect_camera_gps.py to run the gps module and camera module data collection sequence

Hardware Configuration

graph LR;
A[Battery Module] --> R[Raspberry Pi Zero]
R <--> B[Camera Module]
R <--> C[GPS Module]
Loading

Directions

  1. Navigate to the directory
    cd rpi_data_collection
    
  2. Run the Python file
    python3 collect_camera_gps.py
    
    

To Collect Only Camera Data

Run camera_only.py to run the camera module data collection sequence

Hardware Configuration

graph LR;
A[Battery Module] --> R[Raspberry Pi Zero]
R <--> B[Camera Module]
Loading

Directions

  1. Navigate to the directory
    cd rpi_data_collection
    
  2. Run the Python file
    python3 camera_only.py
    
    

To Collect Camera Data while inputing filler GPS Data

Run fake_gps.py to run the gps module and camera module data collection sequence with filler data for the GPS

Hardware Configuration

graph LR;
A[Battery Module] --> R[Raspberry Pi Zero]
R <--> B[Camera Module]
R <--> C[GPS Module]
Loading

Directions

  1. Navigate to the directory
    cd rpi_data_collection
    
  2. Run the Python file
    python3 fake_gps.py
    
    

Sensors and Modules

Supported Sensors and Modules

  • GPS Module: Provides geotagging data for mapping in GIS applications.
  • Camera Module: Collects environmental data and facial data for later use with computer vision analysis.
  • Battery Module: PiSugar battery that enables wireless operation of the data collection device.

Future Sensors and Modules

  • Microphone Module: Measures environmental noise levels for noise pollution data collection.
  • Thermometer Module: Measures environmental heat levels for heat island data collection.
  • Heartrate Sensor: Measures heart rate to detect stress for biometric data collection.

Directions for First Time Setup

To add code to a Raspberry Pi Zero 2 W and run it headlessly, follow these steps:

  1. Connect to the Raspberry Pi Zero 2 W via SSH. Use a tool like PuTTY (Windows) or Terminal (Mac/Linux) to establish an SSH connection. Ensure that the Raspberry Pi is connected to the same network as your computer.

  2. Once connected, navigate to the desired directory to add your code. For example, you can use the following command to navigate to the home directory:

    cd ~
    
  3. Clone the repository using the following command:

    git clone https://github.com/hleve/rpi_data_collection.git
    
    
    
  4. After the cloning process is complete, navigate into the cloned repository directory:

    cd rpi_data_collection
    
  5. Install Requirements and Pandas (might require a virtual environment or venv)

    python3 -m venv .venv source .venv/bin/activate python3 -m pip install -r requirements.txt cd rpi_data_collection
    
    sudo apt-get install python3-pandas
    
  6. If you receive the following error while trying to install pandas: dpkg was interrupted, you must manually run sudo dpkg --configure -a to correct the problem.n error when trying to install pandas, run the following code as suggested:

    sudo dpkg --configure -a
    
  7. Install requirements.txt

    sudo apt-get install requirements.txt
    

To run from terminal or SSH

  1. Navigate to the directory
    cd rpi_data_collection
    
  2. Run the Python file
    python3 collect_camera_gps.py
    

License

This project is licensed under the Apache 2.0 License

About

Raspberry Pi Based Data Collection Device

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages