Portable Weather Station & Plant Health Monitor

by jorgeeldis in Circuits > Arduino

19 Views, 0 Favorites, 0 Comments

Portable Weather Station & Plant Health Monitor

Aloe Vera (2).png

When caring for plants, flowers, trees, and shrubs, it's important to understand environmental factors such as temperature, humidity, and sunlight exposure in the planting area. This is a simple project that any nature enthusiast can undertake. It requires few materials but is essential for monitoring the weather and assessing plant health.

Supplies

MaterialsInstructables.png
  1. Arduino MEGA - 18$
  2. AM2302 Module (DHT22) - 2$
  3. Photoresistor LDR Module - 1$
  4. 3.5" LCD TFT Screen - 17$
  5. Portable Charger - 10$
  6. USB to Micro USB Cable - 1$
  7. 3D Printed Box - 1$

Total = 50$

Reasoning Behind the Project

Plantsv2.png

At home, I have these plants that require different care, so it’s important to know if the spots where I keep them in sunlight provide the necessary conditions for them to thrive, based on research about the plants I have.

Aloe Vera

Temperature: 20°C - 30°C

Humidity: 30% - 50%

Sunlight: 40% - 60% for 6 hours

Information from: University of Florida IFAS Extension. (2020). Aloe Vera Production Guide.

https://edis.ifas.ufl.edu/publication/HS1331

Red Pagoda

Temperature: 20°C - 30°C

Humidity: 30% - 50%

Sunlight: 50% - 80% for 6 hours

Information from: San Marcos Growers. Crassula capitella ‘Campfire’ Plant Profile.

https://www.smgrowers.com/products/plants/plantdisplay.asp?plant_id=3669

Bonsai Tree

Temperature: 15°C - 25°C

Humidity: 40% - 60%

Sunlight: 50% - 70% for 6 hours

Information from: The Bonsai Guide – Royal Horticultural Society

https://www.rhs.org.uk/advice/profile?PID=530

Fern

Temperature: 18°C - 24°C

Humidity: 60% - 90%

Sunlight: 20% - 40% for 6 hours

Information from: Missouri Botanical Garden – Fern Care

https://www.missouribotanicalgarden.org/PlantFinder/PlantFinderDetails.aspx?taxonid=282747

3D Printing

3DPRINTING.png

Now that I have all the materials, I’m starting to think about how I want to build this. I want it to be as simple as possible and accessible to everyone. The box has three openings: one for the screen and two for the sensors, the AM2302 and the LDR, since both need to be outdoors to receive light and humidity from the environment. I leave the STL files ready to print, i used PETG because of the high temperature resistance.

Schematic

Circuit.png

The schematic consists of four components: the Arduino Mega, the 3.5-inch TFT LCD screen, and the DHT22 and LDR sensors. All of these are powered by the portable battery used. Soldered each pins of the sensors to some AWG10 to connect them to the Arduino MEGA. The screen is basically a HAT so you just have to connect all pins to the corresponding female connectors.

Coding

This was the most complicated part of the project, mainly because of the screen. I had to research the correct library to make the project work perfectly. For the sensors, the libraries worked on the first try. I was able to confirm everything was working perfectly before assembling all the components into the box without any issues. This files must be inside a folder named WeatherStation to work.

The main part of the code is the libraries, you must include the necessary libraries for the project to work correctly, in this case i used.

#include <LCDWIKI_GUI.h> //Core graphics library
#include <LCDWIKI_KBV.h> //Hardware-specific library
#include <AM2302-Sensor.h>
#include <AM2302-Sensor.h>

After this i defined the pins that were gonna be connected to the modules responsible for monitoring the weather and more.

#define SENSOR_PIN 8
int lightSensorPin = A0; // Analog pin
int lightValue;
float sunlight;
AM2302::AM2302_Sensor am2302{SENSOR_PIN};
LCDWIKI_KBV my_lcd(ILI9486,40,38,39,-1,41); //model,cs,cd,wr,rd,reset

There is a function specifically to show information to the screen.

void show_end()
{
my_lcd.Fill_Screen(0, 255, 255);
my_lcd.Set_Draw_color(255, 0, 0);
my_lcd.Set_Text_colour(0, 0, 0);
my_lcd.Set_Text_Size(3);
my_lcd.Set_Text_Mode(5);
my_lcd.Print_String("Plant Health Station!", CENTER, my_lcd.Get_Display_Height()-250);
my_lcd.Print_String("Receiving: " + String(sunlight) + "% sunlight", CENTER, my_lcd.Get_Display_Height()-200);
my_lcd.Print_String("Temperature: " + String(am2302.get_Temperature()) + String(char(0xF6)) + "C", CENTER, my_lcd.Get_Display_Height() - 150);
my_lcd.Print_String("Humidity: " + String(am2302.get_Humidity()) + "%", CENTER, my_lcd.Get_Display_Height()-100);
delay(1000);
}

Then we write our setup function to make everything start up.

void setup()
{
my_lcd.Init_LCD();
my_lcd.Fill_Screen(0x0);
my_lcd.Set_Rotation(1);
Serial.begin(115200);

// set pin and check for sensor
if (am2302.begin()) {
// this delay is needed to receive valid data,
// when the loop directly read again
delay(1000);
}
else {
while (true) {
Serial.println("Error: sensor check. => Please check sensor connection!");
delay(10000);
}
}
}

Finally we finish off with the loop function, to update the modules every 1 second:

void loop()
{
my_lcd.Fill_Screen(0x0);
show_end();
// put your main code here, to run repeatedly:
auto status = am2302.read();

lightValue = abs(analogRead(lightSensorPin)-1023); // 0 (dark) to 1023 (bright)
Serial.print("Light Level: ");
Serial.println(lightValue);

sunlight = (lightValue/1023.0)*100.0;
Serial.print("Sunlight: ");
Serial.println(sunlight);

Serial.print("Temperature: ");
Serial.println(am2302.get_Temperature());

Serial.print("Humidity: ");
Serial.println(am2302.get_Humidity());

delay(1000);
}

Results

Results.jpeg

We obtained results that aligned well with our expectations. I live in a tropical country where the weather behaves unpredictably, some days bring heavy rain, while others are extremely sunny. Humidity levels also vary greatly depending on the weather conditions. For this reason, monitoring our plants is essential in order to understand which types of plants are best suited to our environment and what specific care they require.