Arduino Automatic Plant Watering System

24,154

246

43

About: I'm an Electronics Engineer who likes to make Doze Lamps, Lumen Powered Thingamajigs, Almighty Brainy Buttons, Tweeting Weather Stations and share them on Instructables.

Meet Sprout - the Modern Indoor Planter which automatically waters your plants, herbs, vegetables, etc and will revolutionize your gardening game.

It consists of an integrated water reservoir from which water is pumped & keeps the plant's soil hydrated.

A soil moisture sensor is calibrated such that it periodically measures the moisture of the soil thereby regulating the water flow. If the soil is too dry, the water pump automatically switches ON and goes OFF when the soil moisture has reached the desired level.

If you're the person who underwaters their plants, Sprout will ensure you will never have to worry about being a bad gardener again. And if you're the sort of person who overwaters their plants to compensate for absenteeism, it means your not in danger of drowning your plants or seeds.

Sprout's water reservoir capacity is around 500 ml / 17 fl oz, which allows you to neglect your plants for as long as a month before it needs a refill.

The optional Bluetooth feature can be used to manually toggle & control the water pump wirelessly from your smartphone.

Develop:
Are you a programmer, engineer or designer who has a great idea for a new feature/design in Sprout? Maybe you're just a beginner or you've spotted a bug? Feel free to grab our code, schematics, 3D design files & laser cutting files from Github and tinker with it.

Sprout: GitHub

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Electronic Design

Electronic Components List:-
Arduino Nano: AliExpress
DC Water Pump: AliExpress
Soil Moisture Sensor: AliExpress
HC-05 Bluetooth Module: AliExpress
LM7805 Voltage Regulator: AliExpress
IRF540 MOSFET: AliExpress
220 Ohm Resistor: AliExpress
IN4001 Diode: AliExpress
Header Pin Strips: AliExpress
DC Barrel Jack: AliExpress
Screw Terminal Block: AliExpress
PCB: AliExpress
AC-12VDC Adapter: AliExpress

Tools:-
Soldering Iron: AliExpress
Solder Wire: AliExpress

Power Block

The 7805 regulates the supply voltage and reduces it to a constant 5V making it suitable to run the Arduino & Soil Moisture Sensor.

Pump Control

The MOSFET acts as a switch which is controlled by the Arduino. We use the MOSFET since the Arduino cannot directly power the DC Pump. The resistor connected to the gate of the MOSFET prevents the MOSFET from getting damaged. The flyback diode connected across the pump provides a path for dissipation of stored energy when the pump is switched off. The Anode of the Diode is connected to the Drain of the MOSFET. The Cathode of the Diode is connected to the 9V supply rail. The Source of the Diode is connected to GND.

Moisture Sensor
The sensor feeds an analog value to the Arduino. The threshold level of moisture is calibrated by the user depending on the type of plant used.

Bluetooth Module

Uses Serial Communication to transfer data between the Arduino and your Smartphone.

Step 2: Electronic Assembly

A 1x Scale printable PCB as well as the board view and schematic is available in the GitHub repository.

Sprout: GitHub/Electronics

The repository also contains an A4 size PDF which contains multiple PCB's on a single page. This can be used to make multiple PCB's at a time for mass production

Solder all the components according to the given Schematics.

The editable Eagle files are available below.

You can Order the PCB here: PCBWay

Step 3: Software & Bluetooth Configuration

Software

The Moisture Sensor is connected to an Analog Input pin of the Arduino. A threshold value determines whether the Pump should be ON/OFF.

You can find the code at Sprout: GitHub/Code

Feel free to modify & contribute to the GitHub repository.

Smartphone App & Bluetooth Configuration

The HC-05 Bluetooth module is the intermediate block between the Smartphone & Arduino. It uses Serial Communication to send data from the Smartphone to the Arduino & acts as a Remote Control.

The app transmits the value '48' or '49' which represent 'ON' & 'OFF' respectively. The pump can hence be controlled wirelessly.

Simply open the app, scan for discoverable devices & pair with the HC-05 module. then click on 'Switch Mode' and toggle the onscreen button.

The app is available at Bluetooth App

Step 4: Mechanical Design

The main body of Sprout is a 30cm X 15cm X 19cm Box made out of MDF.

All Mechanical Design steps have been clearly demonstrated in the video attached at the start of the Instructable. You can also check it out at Sprout: Video/Mechanical Design

The box is divided into two sections:

  1. The larger section contains the Soil & Plants
  2. The smaller section is further divided into two more sections such that one section contains the Circuit Board while the other contains the Water Reservoir.

The water reservoir is a 500ml plastic bottle.

The MDF box has 8 separate interlocking faces which can be laser cut and slotted into each other.

The Laser Cutting files, Fusion 360 Design file (3D Design file), isometric as well as orthogonal views of each face can be found at Sprout: GitHub/Mechanical Design

You can also find editable Illustrator files in the GitHub repository which can be modified to your specific requirements/dimensions and then can be laser cut.

Step 5: Mechanical Assembly: Bottle Preparation

The water reservoir is a 500ml plastic bottle. A typical 500ml plastic Soda bottle can be used for this.

The maximum diameter of the bottle should be 74mm. The maximum diameter of the cap of the bottle should be 50mm. The maximum height from the base of the bottle to the lowest part of the cap should be 18.5 cm.

The bottle must be cut about 50mm above its base so that the pump can be placed within it. Holes must be cut into the bottle such that the Outlet Pipe and Power wires can be fed through the bottle.

Once the Outlet Pipe and wires have been taken out through their respective holes, the bottle can be sealed again. To seal the bottle we must use an Epoxy Compound which will harden within a few hours. This will prevent any water from leaking out.

The water can be refilled from the top of the bottle by simply opening its cap.

Step 6: Mechanical Assembly: Box Preparation

Once you have successfully laser cut the 8 different faces of the box, Apply several coats of a high-quality wood varnish to each side of each face.This makes it highly water repellant & makes it resistant to moisture & humidity.

Mount the Power Jack on the Back Plate too & connect it to the Circuit Board.

Mount the Circuit Board on the Back Plate of the Box such that it fits within their respective section.

Pull the Pump Outlet Pipe through the given holes such that it reaches the Plant soil section. Do the same for the Moisture Sensor wires.

Don't forget to connect the Water Pump to the Circuit Board as shown in the Schematic

Begin interlocking the different faces of the Box and ensure that bottle fits snuggly into its designated area.

Apply wood glue or an adhesive to seal the entire box

All these steps have been demonstrated in the Video found at the Start of this Instructable.

Step 7: Mechanical Assembly: Cement

This step will determine the out texture & final finish of the box as well as give the planter another protective coating.

Apply glue to each face of the box. Then sprinkle some cement over the glue. Use the remaining circular MDF piece which was cut from the Top Plate to smoothen the cement across the surface of each face of the box. Repeat this step for each face of the box as demonstrated in the video.

Once the cement dries, sprinkle with water every 6 hours for 1 day. This will allow the cement to cure, with no cracks and will also prevent water from leaking.

Step 8: Add the Soil & Plants

Once the cement has cured, fill the box with soil.

Remember to heat seal the end of the Outlet pipe before making a hole in it for the dripper. The dripper is used to regulate the water coming out of the pipe so that the water does not flow out of the planter.

Place the Soil Moisture Sensor inside the soil.

Power Sprout through the Power Jack at the Back Plate & make sure fill the water reservoir to the full level.

Test whether everything works and you should be done.

Epilog Challenge 9

Runner Up in the
Epilog Challenge 9

Arduino Contest 2017

Runner Up in the
Arduino Contest 2017

Remote Control Contest 2017

Participated in the
Remote Control Contest 2017

2 People Made This Project!

Recommendations

  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

43 Discussions

None
luislucian

16 days ago

Hello. I was delighted with your project and went on to realize it. When I went to test the assembly, I found that the on / off functions work in reverse! - ie the humidity sensor placed in the wet environment starts the water pump, and removing it and placing it in dry environment, stops the pump. I have carefully checked the assembly several times and it is according to your scheme. Which bar could be the cause? Do I use a different type of sensor than the one you use - can it be the case? . Can you help me with suggestions? Anyway, thank you for sharing this project

20191004_092746.jpg20191004_092905.jpg
4 replies
None
Jonathanrjpereiraluislucian

Reply 15 days ago

Hello,

Instead of changing the circuit. You can simply change the main code.

You can replace the value passed within the Pump() function call in the main loop.

All you need to do is change the value from 0 to 1 and 1 to 0.

For example, change Pump(0) to Pump(1) and vice versa within the main code loop.

Hope this helps. Feel free to ask anymore questions. I'm really happy you made it and I hope everything works.

None
luislucianJonathanrjpereira

Reply 15 days ago

Thanks for the reply. I saw the suggestion to modify the command from the code and I will do this on the next assembly. Currently, we have solved the problem, by eliminating the sensitivity control circuit humidity sensor and adapting to the two electrodes the circuit made of a transistor and two resistors, according to the attached drawing. It works perfectly! Thank you very much

diagram senzor umiditate.png
None
Jonathanrjpereiraluislucian

Reply 15 days ago

I'm glad it works. Don't forget to attach a photo of it under the 'I made it' section.

None
Khushi02

3 months ago

Hi! How do you attach the arduino nano to the breadboard? Should the wiring be exactly the same as the picture?

7 replies
None
JonathanrjpereiraKhushi02

Reply 3 months ago

You can connect the Arduino Nano and other electronic components to a breadboard as shown in the breadboard schematic (Step 1).

None
JonathanrjpereiraKhushi02

Reply 3 months ago

I connected my 9V DC power adapter. The adapter acts as the power supply for the entire circuit.

None
JonathanrjpereiraKhushi02

Reply 3 months ago

The 9V power adapter also goes to the input of the 7805 voltage regulator (reduces the 9V to 5V). The output of the voltage regulator is connected to the VIN pin of the Arduino. This is shown in the breadboard schematic.

None
Khushi02Khushi02

Reply 3 months ago

Also, can you post a picture of the nano physically connected to the breadbpard?

None
JonathanrjpereiraKhushi02

Reply 3 months ago

Unfortunately, I don't have a picture of the Nano physically connected to the other components using the breadboard.

But you can still follow the breadboard schematic.

None
william.a.murphy.jr

4 months ago

Great project. Can't wait to start. Boards have arrived and just waiting for last of the electronics to show up. One question about the electronics... The power supply is 12v and (just going off the breadboard diagram) it looks like the pump is drawing right off the 12v bus. But the pump is rated at 5v. Shouldn't it be drawing off the 5v bus? Also 7805 is rated for 8v input. Should we be using a lower voltage power supply anyway? Did you have problems with the 7805 overheating?

5 replies
None
wmurphy41william.a.murphy.jr

Reply 3 months ago

Just about done. All wired, programmed, and assembled. Just need to put the concrete finish on it. Will do that on Thursday when we've got a day off here in the US. No issues with the 12.5 volt and the pump. Probably too much voltage, but it does not run for extended periods (and I added a pump timeout to make sure of that - see below).

Made a few adjustments that others may use:
- I've enhanced the code a bit: Timeout so that pump does not burn out if the resevoir runs out of water (or if the moisture sensor comes out of the soil); More controls through the phone commands (start, stop, pulse, reset timeout, bump limit up, bump down, check moisture level).

- I used the HM10 card so that it works with iPhone. I also used the a digital pin for the serial communication with the card. When the card was going through Tx/Rx, it was interfering with my ability to upload programs. I'd have to pull the card out, upload, then put the card back. OK with a breadboard. Won't work with a soldered board. (BTW, this required a software change too.)

- Adjusted the center divider in the storage side so that it's removable. I have the circuit board hot glued to that board, so now it's easy to pull that board out to reprogram.

- Used a soldered prototype board instead of the pcb board. Not an improvement. I just made some changes to the wiring design and don't know how to make a PCB design.

I think that's it. When I'm done, I'll take some pix and upload to I Made This. I'll need someone at work to give me a tutorial on github and then I'll post my updated plant.ini.

None
wmurphy41wmurphy41

Reply 3 months ago

Oh... One other thing. To seal off the silicon tube, just shoot in a plug of glue from a hot glue gun. Works like a champ.

Ignore my last about the pump PS. 5v is too low for the pump and the 12v PS works fine. A couple comments: Anyone who has an iPhone should get an HM-10 bluetooth module instead of the HC-05. Nothing else needs to change. I've made some tweaks to the software to make sure the pump shuts itself off in case the reservoir runs out of water and some features that let you check the moisture setting from your phone and then adjust the limit up or down. I'll post those when I share through the IMadeIt button.

I'm really glad someone has finally decided to Make the Project.

I recommend contributing any changes to the code/circuit schematic via the Sprout GitHub repository. It makes it easier for multiple developers to simultaneously collaborate and work on bugs and other new features.

In the Eagle Schematic, I have indicated that the Power supply is 9V.

I had no problems with the 7805. According to the datasheet, the 7805 Input Voltage max (Recommended Operating Conditions) is 25V.

Hence in the Fritzing breadboard diagram, I indicated that the power supply can either be 9V or 12V. i.e. If you use a 9V(12V) supply, you will need to use a 9V(12V) pump accordingly.

At the time of publishing of the Instructable, the Aliexpress listing was for a 9V pump. It seems like they have changed it to 5V since then. Hence I will make the appropriate change to the link.

None
TonyD155

6 months ago

Nice Project. I know the point is to digitally control the watering to prevent overwatering, but what are you doing for the proper drainage that every plan needs?