ezekielmitchell / Project-2030

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enviro pHAT Sensor Data Collection

Ezekiel A. Mitchell | Seattle University | May 30, 2024

Table of Contents

Introduction

This project was created for my data structures and algorithms course for Spring 2024. It utilizes a Raspberry Pi and the Enviro pHAT sensor to collect and log environmental data such as temperature and light levels. The data is collected in real-time and stored in a CSV file for further analysis.

Hardware Requirements

  • Raspberry Pi (any model with GPIO header)
  • Enviro pHAT sensor
  • MicroSD card with Raspbian installed
  • Power supply for Raspberry Pi
  • Internet connection for Raspberry Pi

Software Requirements

  • Python 3.x
  • Enviro pHAT library
  • CSV module (comes with Python standard library)
  • Threading module (comes with Python standard library)

Installation

  1. Set up your Raspberry Pi:

    • Install Raspbian on your Raspberry Pi.
    • Connect the Enviro pHAT sensor to the GPIO header of the Raspberry Pi.
  2. Update and upgrade your system:

    sudo apt update
    sudo apt upgrade
    
  3. Install Python & pip (if not already installed):

    sudo apt install python3 python3-pip
    
  4. Install the Enviro pHAT library:

    sudo pip3 install envirophat
    
  5. Clone the repository:

    git clone https://gitlab.com/ezekielmitchell/project_2030.git
    cd envirophat-data-collection

Usage

  1. Run the script

    python3 main.py

    in the case you are prompted to run the script as root

    sudo python3 main.py
  2. Data Logging:

  • The collected data will be saved to envirophat_data.csv in the same directory as the script.

Project Structure

    envirophat-data-collection/
│
├── main.py               # Main script for data collection
├── envirophat_data.csv   # Output CSV file with sensor data
├── README.md             # Project documentation
└── requirements.txt      # List of dependencies (if needed)

About


Languages

Language:Python 100.0%