Overview
Plant Monitor is an IoT-based project for monitoring plant health with ease. The projects consists of three parts:
- IoT: Sensors (for monitoring plant data)
- Database: MongoDB (Atlas, Realm and Chart)
- Cross platform mobile app: Flutter (for getting realtime plant data)
Submission Category:
Action Star
Link to Code
The code for both the app and the IoT part is present in the following GitHub repo:
sbis04 / plant-monitor
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.
Project Description
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:
exports = function(payload){
var atlas = context.services.get("mongodb-atlas");
var coll = atlas.db("plantdata").collection("readings");
try {
if (payload.body)
{
body = EJSON.parse(payload.body.text());
}
coll.insertOne(body);
console.log(body);
} catch (e) {
console.log("Error inserting doc: " + e);
return e.message();
}
};
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.
Top comments (19)
Congratulations Souvik, that is an excellent project but maybe you could explain a little more the connections you used in the ESP32, maybe using some tool like fritzing, thank you very much.
Thanks, I'm thinking of working on a the 3-4 part step by step article series to explain the entire project.
Hello, have you already posted a 3-4 step by step article series to explain this project sir? Because it will massively help me as a student. I badly needed for my major college project.
Looks great!
wow that's a great project
Thanks 😊
This is a great project Souvik, keep up the good work!
Thanks 😊
Useful stuff Souvik, keep it up!!!
Thanks!
Let me know in the comments what do you think about the project 🙂
This is absolutely amazing and astonishing I wish I could learn all of this . But you there did 🔥🔥🔥 work
Great that you liked the project, thanks! 😊 I'm also thinking of creating a step-by-step guide for building the entire project from scratch (it will be 3-4 part series, I'll starting posting them on Dev soon) 😎
Hello good day, you can literally save my college project if you will post the step-by-step guide of this entire project. Please I need your help, thanks for posting this I already cloned the repo and I have some issues along the way, perhaps you can help me?
Lovely! Super cool!
Thanks! 😊
cool!
Thanks! 😊
Hello, I need full tutorial for this project, is there any? Thank you.