Arduino Smart Plant Monitor

by brodemoz24 in Circuits > Arduino

2381 Views, 25 Favorites, 0 Comments

Arduino Smart Plant Monitor

1712805711023-ba9dc3eb-eb33-4fcb-bb29-7b7b8ad0cd36_1.png
FRHJC5LLUL8ZMH1.png
1712805809692-8dad3ea5-6811-475f-ab17-3bf1d74fbc1c_1.png
FJTQ7CULUL8ZMHA.png
IMG_5951-min.png
Screenshot 2024-05-04 131048.png

In a world dominated by industrialization and rapid technological advancements, the environment often bears the brunt of our progress. The consequences of the industrial revolution has led to problems such as air and water pollution, e-waste, resource depletion, climate change and so much more!

That's why it's time to step back and take some smart measures in order to protect and nurture our delicate ecosystem.

I envisioned a project built on sustainability that contributed positively to the environment so I decided to use my old electronic parts to create something!


I first asked ChatGPT for some ideas/projects that could help plants until it told me a great idea! I could make a smart pot plant that could monitor the health of a plant and notify you about the conditions of the soil!

Then, I devised a plan to repurpose my spare Arduino UNO and some other parts to create it. Equipped with an OLED display and some sensors, my project would allow me to monitor my plant's health by checking its humidity and temperature!

Not only does this project assist me in caring for my plants, it also has a minimal environmental footprint since I didn't have to purchase any new parts!

Supplies

Arduino_Uno_-_R3.jpg
keyestudio.jpg
soil moisture.jpg
oled display.jpg
button.jpg
resistor.jpg
battery.jpg
jumper wires.jpg

Before we begin, there are a few things required to make this project:


You will need:


An Arduino:

I used an Arduino UNO but something like a Wemos D1 mini will work fine as well!

DS18B20 Temperature Sensor:

I used a Keyestudio temperature sensor which I had lying around.

Soil Moisture Sensor:

Most soil moisture sensors online will work as long as they have a signal pin.

0.96" OLED Display:

For ease of use, I would recommend using an I2C OLED display.

Push Button:

Any push button will work fine for this project.

Resistor:

You will specifically need a 10kΩ resistor to add between the button and the Arduino pins.

Battery:

I recommend using a small 5V rechargeable battery or a USB power source. However, I used a 9V Battery to power the system.

Jumper Wire:

You will need some jumper wires to connect everything up as well as some normal wires to solder onto the button.

Screws:

You will need four M4*12 screws for the bottom cover.

Drill:

You will need a drill to create a hole for the button housing which was around 2-8mm for me.

3D Printer:

You will of course need a 3D Printer to print the pot casing!

Filament:

One of the main themes of this project is sustainability! That's why I recommend using Recycled Filament to print the pot and help the environment! Alternatively, you could use an organic filament such as PLA which is derived from cornstarch.

I used White PLA since I plan to keep it indoors. However, if you want to leave it outside, you may need to choose a different filament.

PS: Check this site for the best filaments to use outside!

Designing & 3D Printing

Screenshot 2024-04-05 223718.png
Screenshot 2024-04-05 223923.png
IMG_1495.png
IMG_1494.png
IMG_1497.png
IMG_1496.png
IMG_1498.png

I modelled most of the main body and screw holes using Fusion 360!

Afterwards, I then used Tinkercad to add the small details to the Pot Plant.


I decided to split and print the pot model into two pieces which consisted of the main body and the base. I did this in order to save plastic on the support materials as well as make it easier to assemble the components later on.


I printed the pot using the following settings:

This led to a total print time of around 20~ hours.


After it was done printing, I used plentiful amounts of hot glue to stick the two main parts together and make it as watertight as possible.

Programming

Screenshot 2024-04-05 233939.png
Screenshot 2024-04-05 234021.png
Screenshot 2024-04-05 234032.png
Screenshot 2024-05-04 131919.png
Screenshot 2024-05-04 131624.png
Screenshot 2024-05-04 131636.png

After completing the hardware connections, it's time to program the Arduino!


I programmed the basics such as reading the soil humidity and temperature into the code by myself and then used Microsoft Paint's new Co-Create feature to have an AI automatically generate some icons for me!

While they weren't perfect, I modified the icons by hand to suit the small OLED display.

Afterwards, I used ChatGPT to organize and automatically add comments to my code to make it more user-friendly and cleaner!


To use my code, follow the steps below!

Start by downloading the provided Arduino sketch and installing the necessary libraries:

  • Adafruit_GFX
  • Adafruit_SSD1306
  • DallasTemperature
  • OneWire

These libraries will be required for the Arduino to communicate with all the modules.


The provided code should work with most soil moisture sensors. However, if you encounter unreliable sensor readings, you may need to adjust the following lines:

#define MIN_RAW_VALUE 0
#define MAX_RAW_VALUE 700


Set the MIN_RAW_VALUE to the lowest value observed when the humidity sensor is untouched and MAX_RAW_VALUE to the highest value observed when the sensor is fully immersed in water.


A brief overview of this sketch is that it reads the output from the temperature and soil humidity sensor and then displays the values on the OLED display. Additionally, the code also switches the OLED display on and off depending on whether the push button is pressed! This means that the Arduino can save its power and extend the battery's lifespan.


If you want to have a better understanding of the code, you can read the comments within the Arduino files as it goes into much greater detail!

Assembly

IMG_1516.png
IMG_1517.png
IMG_1518.png
IMG_1519.png
IMG_1536.jpg
IMG_1537.jpg
IMG_1540.jpg
IMG_1542.jpg
IMG_1541.jpg
IMG_1538.jpg

Now that we've got everything ready, it's time to assemble our Smart Plant Monitor!


First, you will need to use your drill to create three holes. The first hole will be on the inside of the pot, directly above the electronics housing. This hole will be used to mount the power button to the pot so the drill bit will need to be the same size as your button.

For example, my button was around 9mm~ wide so I used a 10mm drill bit to drill a hole halfway through the pot plant's wall. Taking care not to completely go through to the other side.

This is because the second hole will be on the other side of the first one. It will hold the 3D-printed button shaft itself as it will improve the pot plant's overall aesthetics!

The button shaft is 2mm in diameter. You may need to create a slightly bigger hole or sand the button down if it doesn't move smoothly after drilled.

Finally, you will also need to drill a small hole (around 5-10mm will work fine) through the "Pot Plant Pillar Cover" to allow the button's wires to pass through!


Now, begin by gluing the push button to the 10mm hole that we created earlier! Then, add a tiny amount of glue to the 3D-printed button shaft and pass it through the 2mm hole and attach it to the push button. Make sure to do this step carefully or else you will not be able to press the button if you get glue in the wrong place!


Afterwards, carefully slot the soil moisture sensor through the tiny hole on the inside of the pot and secure it using hot glue. Make sure to also seal any gaps both inside and out in order to prevent dirt and water from entering the electronics housing.


After that, glue the temperature sensor to the inside of the housing, placing it as close to the top as possible for the most accurate temperature readings!


Then, mount the OLED display to the inside of the pot, bending the wires slightly to fit within the case.


Finally, you can glue both the Button Cover and Pot Plant Pillar Cover ontop of the components to cover them up. Make sure to use hot glue to seal any cracks and you're done assembling the electronics pillar!


Wiring

Schematic.png
Untitled Sketch 2_bb.png
IMG_1521.png
IMG_1525.png
IMG_1526.png
IMG_1523.png

After installing all the parts into the pot plant, place your Arduino board at the bottom of the pot plant and begin wiring everything up!

Simply follow the two fritzing diagrams to connect everything up. You may need to bend the wires at a 90-degree angle to fit within the case, like I did.


If you want to change any of the connections or wiring to your liking, you can always modify the Arduino code and re-upload it to the board!


Wiring


OLED - Arduino

GND - GND

VCC - 5V

SCK - A5

SDA - A4


DS18B20 - Arduino

GND - GND

VCC - 5V

SIGNAL - D2


Soil Moisture Sensor - Arduino

GND - GND

VCC - 5V

SIGNAL- A0


Push Button - Arduino

PIN - GND

PIN - 10kΩ Resistor - D8

*Make sure to add a resistor between the pins!


You will also have to connect your power supply!

For example, if you are using a 5V rechargeable battery, connect the Negative terminal to the GND pin on the Arduino and the Positive terminal to the VIN pin on the Arduino.


Finally, once you're done wiring, make sure to plug in your battery and test out the system. You can verify that the soil humidity sensor is working by placing your fingers across the two terminals and it should display the humidity level on your fingers!

You can also test out the temperature sensor by blowing some warm air onto it and you can verify that the button is working by pressing it a few times to toggle the OLED display between on/off!


Finally, once you've confirmed that everything is working and to your liking, use the four M4*12 screws to secure the base cover to the bottom!

Finished!

IMG_5975-min.png
IMG_5991-min.png
IMG_1530.png
IMG_1531.png
IMG_5974-min.png
IMG_5951-min.png

The final thing to do is to add a plant!

First, gently remove a plant from its original pot, taking care not to damage any roots. Then, place the plant in our Smart Plant Pot and stab the soil with the soil humidity sensor! Make sure to fill any gaps around the plant with additional potting soil, gently pressing it down to secure the plant in place.

Now, sit back, relax, and enjoy the beauty of your newly planted smart garden!

With your Smart Plant Monitor in place, you'll be able to nurture and take care of your plant as well as watch it thrive with confidence!

Happy Planting!