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.
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.
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
File organization and Directions for how to use specific configurations.
Run collect_camera_gps.py to run the gps module and camera module data collection sequence
graph LR;
A[Battery Module] --> R[Raspberry Pi Zero]
R <--> B[Camera Module]
R <--> C[GPS Module]
- Navigate to the directory
cd rpi_data_collection
- Run the Python file
python3 collect_camera_gps.py
Run camera_only.py to run the camera module data collection sequence
graph LR;
A[Battery Module] --> R[Raspberry Pi Zero]
R <--> B[Camera Module]
- Navigate to the directory
cd rpi_data_collection
- Run the Python file
python3 camera_only.py
Run fake_gps.py to run the gps module and camera module data collection sequence with filler data for the GPS
graph LR;
A[Battery Module] --> R[Raspberry Pi Zero]
R <--> B[Camera Module]
R <--> C[GPS Module]
- Navigate to the directory
cd rpi_data_collection
- Run the Python file
python3 fake_gps.py
- 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.
- 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.
To add code to a Raspberry Pi Zero 2 W and run it headlessly, follow these steps:
-
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.
-
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 ~
-
Clone the repository using the following command:
git clone https://github.com/hleve/rpi_data_collection.git
-
After the cloning process is complete, navigate into the cloned repository directory:
cd rpi_data_collection
-
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
-
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
-
Install requirements.txt
sudo apt-get install requirements.txt
- Navigate to the directory
cd rpi_data_collection
- Run the Python file
python3 collect_camera_gps.py
This project is licensed under the Apache 2.0 License