A Flutter mobile application that connects to a PM2.5 sensor via Bluetooth Low Energy (BLE) to monitor air quality measurements in real-time.
- Real-time monitoring of PM1.0, PM2.5, and PM10 particulate matter concentrations
- Bluetooth Low Energy (BLE) connectivity
- Clean Material Design 3 UI
- Permission handling for BLE and location services
- State management using Provider
- Read and plot historical data from the sensor
- Sync time with the sensor
Android | iOS | MacOS | Web | Linux | Windows |
---|---|---|---|---|---|
✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
- Flutter SDK ^3.6.1
- Android: minSdk 19
- iOS: iOS 12.0 or later
- Compatible PM2.5 sensor device with BLE support
flutter_blue_plus
: ^1.35.2provider
: ^6.1.2permission_handler
: ^11.3.1
- Ensure you have Flutter installed and set up properly
- Clone this repository
- Install dependencies:
flutter pub get
- Run the app:
flutter run
The app looks for a BLE device with the following specifications:
- Device Name: "PM2.5 Sensor"
- Service UUID: "91bad492-b950-4226-aa2b-4ede9fa42f59"
- Characteristics:
- PM1.0:
91bad493-b950-4226-aa2b-4ede9fa42f59
(Read, Notify) - PM2.5:
91bad494-b950-4226-aa2b-4ede9fa42f59
(Read, Notify) - PM10:
91bad495-b950-4226-aa2b-4ede9fa42f59
(Read, Notify) - History:
91bad496-b950-4226-aa2b-4ede9fa42f59
(Read) - Time Sync:
91bad497-b950-4226-aa2b-4ede9fa42f59
(Write)
- PM1.0:
- Enable Bluetooth on your device
- Launch the app
- Grant necessary permissions when prompted
- Press "Scan for Sensor" to find and connect to your PM2.5 sensor
- Once connected:
- The app will display real-time readings for PM1.0, PM2.5, and PM10.
- Time will sync with the sensor.
- You can also view historical data by pressing the "View Historical Data" button.
This project is licensed under the MIT License - see the LICENSE file for details.