Skip to content

MRU-Earth-and-Enviromental-Science/Low-Cost-Sensors

Repository files navigation

╔═════════════════════════════════════════════════════════════════════════╗
β•‘                                                                         β•‘
β•‘     β–ˆβ–ˆβ•—      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•—      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β•‘
β•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•  β•‘
β•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘     β•‘
β•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘     β•‘
β•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β•     β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘     β•‘
β•‘     β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•  β•šβ•β•β•β•šβ•β•β•       β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•   β•šβ•β•     β•‘
β•‘                                                                         β•‘
β•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—       β•‘
β•‘       β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•       β•‘
β•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—       β•‘
β•‘       β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β•β•β–ˆβ–ˆβ•‘       β•‘
β•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘       β•‘
β•‘       β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•       β•‘
β•‘                                                                         β•‘
β•‘             DRONE-BASED AIR QUALITY MONITORING SYSTEM                   β•‘
β•‘                                                                         β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

🚁 Real-time Environmental Monitoring from the Sky

Measure. Monitor. Protect. A cutting-edge air quality monitoring system designed for DJI Matrice drones, capable of measuring and logging key environmental parameters in real-time.

License DJI ROS Noetic Made with Love


πŸ› οΈ Tech Stack

ESP32 Raspberry Pi C++ Python TypeScript PlatformIO Linux Bash Electron Next.js


πŸ“Š System Overview

Data Transport Diagram

✨ Features

🌑️ Comprehensive Sensor Suite

  • COβ‚‚ (Carbon Dioxide) in ppm
  • CO (Carbon Monoxide) in ppm
  • CHβ‚„ (Methane) in ppm
  • NOβ‚“ (Nitrogen Oxides) in ppm
  • PM2.5 Particulate Matter in ΞΌg/mΒ³
  • VOCs (Volatile Organic Compounds)
  • Temperature & Humidity readings

πŸ–₯️ Modern Dashboard

  • Real-time data visualization
  • Live graphs and metrics
  • CSV export for data analysis
  • Built with Electron + TypeScript + Next.js
  • Powered by Python backend
  • Designed with v0.dev

πŸ”Œ Wireless Communication

  • ESP-NOW protocol for long-range transmission
  • Low latency data streaming
  • Reliable connection between drone and ground station
  • Real-time telemetry updates

πŸ€– ROS Integration

  • ROS Noetic for robust communication
  • UART connection between Raspberry Pi & ESP32
  • GPS data extraction from DJI drone
  • Modular architecture for easy expansion

πŸ› οΈ Hardware Design

  • Custom PCB (designed in-house)
  • 3D-printed casing for DJI Matrice 210V2
  • Weather-resistant enclosure
  • Matrice 350RTK support coming soon

⚑ Developer Experience

  • PlatformIO for streamlined development
  • Hot-reload dashboard during development
  • Automated build scripts
  • Comprehensive documentation

πŸ› οΈ Getting Started (Software)

1. Prerequisites

  • Familiarity with Git, terminal and basic UNIX commands
  • Recommended: Linux host (Windows/Mac supported but requires extra configuration)
  • Required Tools
    • C++ Compiler
      • Linux: sudo apt install build-essential
      • Mac: Xcode Command Line Tools (xcode-select --install)
      • Windows: Install MinGW or use WSL
    • VSCode (Or IDE of your choice)
    • Platform IO Extension for VSCode
    • ROS Noetic (This software was built in 2025 on Ubuntu 20.04)
    • [Optional but Recommended] PlatformIO Core CLI for terminal workflows

2. Clone the Repository on the Machine Used to Deploy to ESP32

cd ~
git clone https://github.com/MRU-Earth-and-Enviromental-Science/Low-Cost-Sensors.git
cd Low-Cost-Sensors
code . # Open in VSCode (or editor of your choice)

3. Upload Code to ESP32 on the Drone

  • Connect your ESP32 dev board via USB.
  • Open the Drone_System Directory on Visual Studio Code.
cd ~/Low-Cost-Sensors/drone_esp32
  • Use PlatformIO to build and upload:
    • Click the right-facing arrow (➀) at the bottom of VSCode, or
# If using PIO command line
pio run --target upload

PlatformIO will automatically detect your environment and upload the firmware to the board.

4. Configure the ESP32 on Ground Station

cd ~/Low-Cost-Sensors/ground_station/ground_esp32
  • Use PlatformIO to build and upload the code to the ESP32. (same as above)

5. Raspberry Pi Set-Up

  • Running any Linux Distro between 16.04 and 20.04 (This was developed on Ubuntu 20.04 Server, Raspberry Pi 3)
  • Requires ROS Noetic (Base) to be installed
  • Requires a C++ compiler
  • Requires CMake > 3.0
  • Clone this repo on the Pi
cd ~
git clone https://github.com/MRU-Earth-and-Enviromental-Science/Low-Cost-Sensors.git
  • Clone the DJI OSDK and DJI OSDK ROS Packages
cd ~
git clone https://github.com/dji-sdk/Onboard-SDK.git

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
git clone https://github.com/dji-sdk/Onboard-SDK-ROS/tree/master/src/dji_osdk_ros

Run the install script to setup the rest of the code

cd ~/Low-Cost-Sensors
chmod +x install_sdk.sh
./install_sdk.sh

6. Setting Up and Running the Dashboard

  • Install the Dashboard from the 'Releases Section' of the GitHub repo linked below for your system.
    • For Windows: Download the .exe file.
    • For Mac: Download the .dmg file.
    • For Linux: Download the .AppImage file and make it executable:
  • Alternatively, you can clone the sensor-dashboard submodule and build from source (must have npm installed):
# Clone the sensor-dashboard submodule
cd ~/Low-Cost-Sensors
git submodule update --init --recursive

cd ground_station/sensor-dashboard

npm install --legacy-peer-deps
npm run dev

# in a new terminal, run the following command to start the dashboard
npm run electron-dev

# to run the backend
python3 -m venv venv
source venv/bin/activate # This is a UNIX command for windows run: venv\Scripts\activate
pip3 install -r requirements.txt

python3 serial_backend.py # Run this in the venv

🧰 Hardware Used

  • ESP32 Dev Module (WROVER-E based)
  • Raspberry Pi 3
  • K30 COβ‚‚ Sensor
  • MQ Series Gas Sensors (e.g., MQ-7 for CO, MQ-135 for NOβ‚“, MQ-4 for CHβ‚„)
  • Plantower PMS7003 (PM2.5 Sensor)
  • SGP30 (VOC Sensor)
  • DHT11 (Temperature & Humidity)
  • UART to USB Cable (Drone to Pi connection)
  • Custom PCB Ordered from JLC PCB (Found in Repo)
  • Bill of Materials Found in Repo

Casing

  • STEP and STL Files available to mount to Matrice210

πŸ“„ License

This project is licensed under the MIT License.

πŸ› οΈ Developed By

Mount Royal University, Faculty of Science and Technology, Department of Earth and Environmental Science

Gwen O'Sullivan β€” Vice Dean of Science and Technology @ MRU
Shivam Walia β€” Mechatronics Engineering @ UWaterloo

❓ Questions

shivamwalia2006 [at] gmail [dot] com
gosullivan [at] mtroyal [dot] ca

About

Sensor System Mounted to Drones 🚁

Resources

License

Stars

Watchers

Forks