Ezekiel A. Mitchell | Seattle University | May 30, 2024
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.
- 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
- Python 3.x
- Enviro pHAT library
- CSV module (comes with Python standard library)
- Threading module (comes with Python standard library)
-
Set up your Raspberry Pi:
- Install Raspbian on your Raspberry Pi.
- Connect the Enviro pHAT sensor to the GPIO header of the Raspberry Pi.
-
Update and upgrade your system:
sudo apt update sudo apt upgrade
-
Install Python & pip (if not already installed):
sudo apt install python3 python3-pip
-
Install the Enviro pHAT library:
sudo pip3 install envirophat
-
Clone the repository:
git clone https://gitlab.com/ezekielmitchell/project_2030.git cd envirophat-data-collection
-
Run the script
python3 main.py
in the case you are prompted to run the script as root
sudo python3 main.py
-
Data Logging:
- The collected data will be saved to envirophat_data.csv in the same directory as the script.
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)