Plant monitoring system using IoT, MongoDB, and Flutter
Plant Monitor
IoT based plant monitoring system which is connected to MongoDB. This is a Flutter app to display the realtime data from the sensors attached to the plant on a mobile device.
License
Copyright 2022 Souvik Biswas
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
A detailed description of all the three parts of this project is present below.
IoT: Sensors
ESP32 module is used for collecting data, processing and uploading to the MongoDB database. It is a low powered microcontroller integrated with WiFi and Bluetooth.
DHT11 sensor is used for measuring raw temperate and humidity data from the surroundings of the plant.
LDR is used for calculating the light intensity that the plant is receiving.
Soil Moisture sensor module is used to measure the moisture or the water level of the soil. The sensor includes a potentiometer to set the desired moisture threshold.
Database: MongoDB
MongoDB Atlas provides cloud database service using AWS, Azure, and Google Cloud. It also has various automation tools for performing various backend functionalities and comes with visualization tools. The services that are used in this project are described below.
Atlas is used as the main cloud database for storing the sensor readings along with timestamps.
Realm Function is defined to easily store the sensor data from the ESP32 module. A HTTP Endpoint is created to access the MongoDB database from the ESP32.
The following function is used for storing the sensor data:
Charts are used to visualize the sensor readings directly inside the MongoDB web app.
For this project I have created four charts:
Plant Light (%): Amount of light intensity plant is receiving
Plant Humidity (%): Humidity around the plant
Plant Moisture (%): Amount of water present in the soil
Plant Temperature (°C): Current temperature around the plant
Mobile app: Flutter
To use the Realm data inside the Flutter application I have created a modified version of the flutter_mongodb_realm plugin to support Dart null safety and run it on the latest version of the Flutter SDK.