Coder Social home page Coder Social logo

juandi-m / openweather-quality Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 1.79 MB

This project hosts the code for and arduino and Raspberry Pi project that aims to measure: Humidity, Temperature, Pressure, Particulate Matter, Sunlight UV, Luminosity and Sonic pollution

C++ 5.96% Python 9.55% CSS 29.31% HTML 19.07% JavaScript 36.10%

openweather-quality's Introduction

Weather and Air Quality Station Project

Python C++ Arduino Raspberry Pi Flask AWS

This comprehensive project combines the power of Arduino Uno R3 and Raspberry Pi 4 to establish a dual-purpose monitoring station that tracks both indoor and outdoor weather conditions as well as air quality metrics. It harnesses a variety of sensors to collect environmental data, and features a Flask-based dashboard for the visualization of the gathered data, providing insights into weather patterns and air quality.

Components Required

  • Arduino Uno R3: Serves as the primary controller for reading from various environmental sensors.
  • Raspberry Pi 4: Acts as the central processing unit for handling data collection, processing, and visualization through a web dashboard.
  • BME280 Sensor: Measures temperature, humidity, and atmospheric pressure.
  • TSL2591 Sensor: Detects light intensity.
  • VEML6075 Sensor: Monitors UV index, providing UVA and UVB radiation levels.
  • MQ135 Sensor: Assesses air quality by detecting various gases.
  • SDS011 Sensor: Measures particulate matter concentrations (PM2.5 and PM10).
  • Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H: Captures audio for sound pollution monitoring.
  • Assorted cables and connectors: For interfacing the sensors with the Arduino and Raspberry Pi.
  • Resistors for I2C pull-up (optional): 2.2kΩ to 10kΩ, if needed, to stabilize the I2C bus.

Dashboard

Here is a sneak peek of our Dashboard:

Dashboard Preview

Sensor Connections to Arduino Uno R3

Sensor Connection Pins Additional Components Notes
BME280 I2C A4 (SDA), A5 (SCL), 3.3V, GND None
TSL2591 I2C A4 (SDA), A5 (SCL), 3.3V, GND None
VEML6075 I2C A4 (SDA), A5 (SCL), 3.3V, GND None
MQ135 Analog Any A0 to A5, 5V, GND None
SDS011 Serial D2 (RX), D3 (TX), 5V, GND None Use SoftwareSerial library

Connecting Arduino to Raspberry Pi 4

  1. Arduino Uno R3 is connected to the Raspberry Pi 4 using a USB cable. The Arduino acts as a serial device to the Raspberry Pi.
  2. Verify the device name on the Raspberry Pi, usually /dev/ttyACM0 or /dev/ttyUSB0, by checking connected devices.

Software Setup

Arduino

  • Load the provided arduinoSensors.ino sketch onto the Arduino. This sketch is designed to read data from the connected sensors and send it to the Raspberry Pi via serial communication.

Raspberry Pi

  • Python Dependencies: Install necessary libraries such as pySerial for serial communication, and Flask for the web dashboard.
    pip install pyserial Flask
  • Sound Sensor Script: Use raspberyMicSensor.py to capture and analyze sound levels for sound pollution data.
  • Flask Dashboard: Run backendFlask.py within the dashboard directory to start the web server and serve the dashboard interface.

Data Handling and Visualization

  • The environmental data collected by the Arduino is sent to the Raspberry Pi, where it is processed and stored. The sound pollution data is also processed on the Raspberry Pi.
  • A Flask-based web dashboard, accessible through any web browser, visualizes the collected environmental and sound data. The dashboard provides a real-time view of the data through the dashboard.html template styled with style.css.

Project Structure

OpenWeather-Quality
│
├── README.md # Project documentation
├── arduinoSensors.ino # Arduino script for environmental sensors
├── raspberyMicSensor.py # Python script for Raspberry Pi sound sensor
│
└── dashboard # Dashboard application directory
├── backendFlask.py # Flask backend script
│
├── static # Directory for static files
│ └── style.css # CSS styles for the dashboard
│
└── templates # Directory for HTML templates
└── dashboard.html # HTML template for the dashboard

Conclusion

This guide outlines the setup for a comprehensive weather and air quality monitoring station. The system is designed for flexibility, allowing for adjustments and additions based on specific project requirements and goals. Detailed documentation for sensor connections, software setup, and dashboard operation is provided to ensure a smooth project execution and deployment.

openweather-quality's People

Contributors

juandi-m avatar

Stargazers

 avatar Esteban Alfaro avatar  avatar Ricardo Zuñiga Juarez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.