Project Smart Plant

by Group 12 in Circuits > Sensors

268 Views, 1 Favorites, 0 Comments

Project Smart Plant

Smart Plant (IOT Project)
photo_2022-06-28_22-05-25.jpg

Our project is called as Smart Plant that will notify you the plant water needed via telegram and also will display the percentage of soil moisture, temperature and humidity of the surrounding on the OLED LCD Display. This Smart Plant helps people who those busy with work and have no time to monitor their plants.

In this Instructables, you will learn how to make Smart Plant by using Soil Moisture sensor and Temperature Humidity sensor. You will also learn on how those sensor works based on the soil moisture level, temperature and humidity of the plant surrounding.

List of Components

photo_2022-06-28_22-15-03.jpg
photo_2022-06-28_23-06-15.jpg
photo_2022-06-28_22-16-14.jpg
photo_2022-06-28_23-10-26.jpg
photo_2022-06-28_23-11-29.jpg
photo_2022-06-28_23-07-40.jpg
photo_2022-06-28_23-12-59.jpg
photo_2022-06-28_23-14-25.jpg

Hardware Components:

  • NodeMCU
  • Jumper Wires
  • Breadboard
  • Soil Moisture sensor
  • Temperature Humidity sensor
  • USB Cable
  • 4-pin 0.96 Blue OLED LCD Display
  • Plant

Software Components:

  • Arduino IDE (installed with esp8266)

Description

ezgif.com-gif-maker.jpg
Temperature Humidity sensor.jpg
photo_2022-06-27_22-59-44.jpg

Functions:

Soil Moisture Sensor - This moisture sensor can be used to determine the amount of moisture in the soil or determine whether there is water nearby, enabling plants in your plants to ask for assistance from people when they are thirsty. The Smart Plant project can let the plants send a message to you like "I need water" when moisture level under 45.

Temperature Humidity Sensor - To sense, measures and reports both moisture and air temperature.

4-Pin Blue OLED LCD Display - To create digital display.

These sensors are very easy to use as you just have to insert the soil moisture sensor into the soil and put the temperature humidity sensor near the plant.

How to Setup Soil Moisture Sensor and Temperature Humidity Sensor Using LCD OLED to NodeMCU

photo_2022-06-28_14-42-46.jpg
photo_2022-06-28_22-25-29.jpg
photo_2022-06-28_22-25-29 (2).jpg
ezgif.com-gif-maker (1).jpg
esp8266.jpg
photo_2022-06-28_22-26-05.jpg
photo_2022-06-27_22-06-11.jpg
photo_2022-06-28_23-14-25.jpg

The wiring connection are made as follows:

1. Connect the three pins of the soil moisture sensor to the three pins on the NodeMCU at the circuit using jumper wires.

- Connect the Vcc from the sensor to the 3.3V pin on the NodeMCU.

- Connect the GND pin to the ground (GND) pin on the NodeMCU.

- Connect the Analog pin to the A0 pin on the NodeMCU.

After completed with wiring connections, you can insert the sensor into the soil like your plant or place it in anywhere you want.

-In this Instructable, I have used water for the Demonstration.

2. Connect the three pins of the temperature and humidity sensors to the three pins on the NodeMCU at circuit using jumper wires.

- Connect the Vcc from the sensor to the 3.3V pin on the NodeMCU.

- Connect the GND pin to the ground (GND) pin on the NodeMCU.

- Connect the DATA pin to the D5 pin on the NodeMCU.

After completed with wiring connections, you can place your sensors at the place that you want to detect or read temperature and humidity sensors.

3. Connect the four pins of the 0.96 OLED Lcd Display to the four pins on the NodeMCU at circuit using jumper wires.

- Connect the Vcc from the sensor to the 3.3V pin on the NodeMCU.

- Connect the GND pin to the ground (GND) pin on the NodeMCU.

- Connect the SCL pin to the D1 pin on the NodeMCU.

- Connect the SDA pin to the D2 pin on the NodeMCU.

After completed with wiring connections, lcd will display all output that you want to display from your coding in Arduino IDE.

Preparing Arduino IDE

2022-06-28.png
2022-06-28 (1).png
  1. Go to Tools.
  2. Go to Board > ESP8266 Boards(3.0.2) > Choose NodeMCU 1.0 (ESP-12E Module)
  3. Then, go to Port and choose the right port.

Ready for writing and uploading coding.

Setup Telegram for Notification

photo_2022-06-29_00-35-56 (3).jpg
photo_2022-06-29_00-35-56 (2).jpg
photo_2022-06-29_00-35-56.jpg
photo_2022-06-28_23-42-50.jpg

We use telegram to give notification for soil moisture.

The telegram bot was connected with NodeMCU by using API key and ID. So message can be receive at your telegram.

Writing Coding

const int sensor_pin = A0;

DHT dht(DHTPIN, DHTTYPE);

CTBot myBot;

String ssid = "UniSZA-WiFi";

String pass = "unisza2016";

String token = "5558281589:AAF3AcSIaOIKh9iwzXfLniZX7_jUfY3i9ns";

const int id = 206056779;

void setup() {

Serial.begin(9600);

Serial.println("BISMILLAHIRAHMANIRAHHIM");

myBot.wifiConnect(ssid,pass);

myBot.setTelegramToken(token);

dht.begin();

if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {

Serial.println(F("SUCCESS "));

for(;;);

}

delay(1000);

display.clearDisplay();

display.setTextColor(WHITE);

if (myBot.testConnection()) {

Serial.println("Good Connection");

} else {

Serial.println("Bad Connection");

}

myBot.sendMessage(id, "Hello User SMART PLANT,");

Serial.println("Sent");

}

void loop() {

delay(1000);

//read soil moisture, temperature and humidity

float t = dht.readTemperature();

float h = dht.readHumidity();

float moisture_percentage = ( 100.00 - ( (analogRead(sensor_pin)/1023.00) * 100.00 ) );

// clear display

display.clearDisplay();

//display soil moisture

display.setCursor(0,0);

display.setTextSize(1);

display.setTextColor(WHITE);

display.println("Moisture: ");

display.setCursor(0,7);

display.setTextSize(1);

display.setTextColor(WHITE);

display.setCursor(0,10);

display.print(moisture_percentage);

display.print("");

display.setTextSize(1);

display.setTextColor(WHITE);

display.print(" %");

display.display();

// display temperature

display.setTextSize(1);

display.setCursor(0,20);

display.print("Temperature: ");

display.setTextSize(1);

display.setCursor(0,30);

display.print(t);

display.print(" ");

display.setTextSize(1);

display.cp437(true);

display.write(167);

display.setTextSize(1);

display.print("C");

// display humidity

display.setTextSize(1);

display.setCursor(0, 40);

display.print("Humidity: ");

display.setTextSize(1);

display.setCursor(0,50);

display.print(h);

display.print(" %");

display.display();

moisture_percentage = ( 100.00 - ( (analogRead(sensor_pin)/1023.00) * 100.00 ) );

Serial.print("Soil Moisture = ");

Serial.print(moisture_percentage);

Serial.println("%");

if(moisture_percentage <=45){

Serial.println("I need water");

myBot.sendMessage(id, "I need water");

}

else if(moisture_percentage <=60){

Serial.println("I am happy");

}

else{

Serial.println("I am so wet");

}

delay(1000);

}

Ready for compile and upload.

Result

photo_2022-06-28_22-05-25 (2).jpg
photo_2022-06-28_22-04-30.jpg
photo_2022-06-28_23-42-50.jpg
photo_2022-06-28_23-43-54.jpg
photo_2022-06-28_23-45-38.jpg

The output reference is visible on the serial monitor. You also will be notified by telegram about your plant water needed. There is an OLED LCD that display the plant percentage of soil moisture, temperature and percentage of humidity.

That's all from us, Group 12. I really hope you found this Instructable to be very helpful.

Thank You!!