Introduction: Smart Irrigation System

Picture of Smart Irrigation System

This project is created for the Digilent Design Contest 2015. It is a smart irrigation system which controlled by a ChipKit MX3 board. The board is monitored by an android device, but can work stand alone. The system check the sensor values and if the values are outside the presetted values then start the irrigation or if the temperature is to high then start the airing.

You can monitor the whole system with an android device and you can override it with a single button. The buttons can start and stop the irrigation and airing, also give feedback about temperature, light level, moisture and its raining or not. If its raining then the automatic irrigation will disabled for a certain time.

Parts:

  • ChipKit MX3 board
  • PmodALS - Ambient Light Sensor
  • PmodTMP3 - Temperature Sensor
  • PmodWiFi - 802.11b WiFi Interface
  • GWS Servo Kit
  • H Bridge
  • Mini Water Pump
  • Rain sensor
  • 3 x Moisture sensor
  • Water tank
  • Power source
  • Silicone water pipe
  • Wires
  • Greenhouse

WARNING: This water pump need about 8A to start so choose the right H Bridge and Power supply!

Step 1: Build the Greenhouse

Picture of Build the Greenhouse

To build the greenhouse you only need wood fibreboard (MDF) and plastic sheet roll. The top part need to be removable. The nails are used to fix the parts.

Step 2: Using MPIDE

Picture of Using MPIDE
  1. To install the MPIDE just download the compressed directory for your OS version. (download)
  2. To use MPIDE with the Chipkit MX3 board: Tools -> Board -> ChipKit -> ChipKit MX3
  3. For further details on using MPIDE visit this link

Step 3: Programming the ChipKit MX3

I put a part of my MPIDE code below. This part is reading the sensor values in every 10 minutes and sends to the android device if its connected.

I created a library to read the sensors you can download it from attachments.

This is the function to test the library:

void readSensors()
{ Feedback = ""; char numstr[5]; //Temperature tempValue = sensor.temp( addr ); Serial.print("Temp: "); Serial.println(tempValue); Feedback = Feedback + itoa(tempValue, numstr, 10) + " "; //Light level lightValue = sensor.light(); Serial.print("Light: "); Serial.println(lightValue); Feedback = Feedback + itoa(lightValue, numstr, 10) + " "; //Moisture 1 moistureValue = sensor.moisture(A1); Serial.print("Moisture 1: "); Serial.println(moistureValue); Feedback = Feedback + itoa(moistureValue, numstr, 10) + " "; //Moisture 2 moistureValue = sensor.moisture(A2); Serial.print("Moisture 2: "); Serial.println(moistureValue); Feedback = Feedback + itoa(moistureValue, numstr, 10) + " "; //Moisture 3 moistureValue = sensor.moisture(A3); Serial.print("Moisture 3: "); Serial.println(moistureValue); Feedback = Feedback + itoa(moistureValue, numstr, 10) + " "; //Rain rainValue = sensor.rain(); Serial.print("Rain: "); Serial.println(rainValue); Feedback = Feedback + itoa(rainValue, numstr, 10) + " "; Serial.print(""); Serial.println(Feedback); tcpClient.println(Feedback); }

Step 4: Android Application

Picture of Android Application

The android application was written in Android Studio for Android 4.4.2 (API17) and over.

With this application we can monitor the system and send commands to the board. The android app is a TCP client what automatically connect to the board on start.

To use the android application with your board you need to change the SERVERPORT and SERVER_IP to your server port and ip.

Code:

private static final int SERVERPORT = 44300;
private static final String SERVER_IP = "your ip";

The project is in pre evaluation form so the full source code will be uploaded just in final form.

Step 5: All Together

Picture of All Together

In this step we can see all parts together.

On the first picture we can see:

  • Power supply
  • H Bridge
  • ChipKit MX3 board
  • Water tank
  • Mini water pump

On the second picture are:

  • Light sensor
  • Temperature sensor
  • GWS servo motor
  • 3 x Moisture sensors
  • Rain sensor

Depending on which moisture sensor value is over the pre set value the servo motor moves to the right pot and start the irrigation. The wiring can be various depending on board pin setup.

Step 6: The Result

The result will be seen on a video but encountered a problem with the H Bridge because our Dual H Bridge is capable of max 2A but the water pump need at least 8A to start, so the video will be available soon!

Comments

asatayoussef (author)2016-04-22

hello

please i can't find the code source and the video

thanks

asatayoussef (author)2016-04-16

hello

please i can't find the code source and the video

thanks

Digilent MakerSpace (author)2015-07-28

Great job! Your project was featured on the Digilent blog. Keep up the fantastic work! https://blog.digilentinc.com/index.php/smart-irrigation-system/

yay2010 (author)2015-05-13

you can use relays with the H bridge to make it capable to deal with that 8Amps water pump

IrrigationSystem (author)yay20102015-05-14

Thank you for the help ! :) But in the end we resolved the problem:

We appreciate your help ! :)

yay2010 (author)IrrigationSystem2015-05-14

optocouple gd choice
gd luck in ur next massive projects

IrrigationSystem (author)yay20102015-05-14

Thanks ! You too :)

Diparna (author)2015-04-22

Can u tell me what is the overall cost for this project? I am thinking about installing it in my garden. Thnx

IrrigationSystem (author)Diparna2015-04-29

Sorry for the late answer, huh i don't know really but around 200 € i got them for free because i go on a contest. But you can repleace the parts with cheaper board and sensots im sure! :)

EvolvedAwesome (author)2015-04-15

Awesome!

Thanks !

Sabre00 (author)2015-04-14

Very nice indeed. If it isn't too late ot for sure in the full scale model, you can add water level sensors to your reservoir. This can alert you somehow as to when your water level is below a safe level. I know some water pumps don't like to pump air. but great work.

IrrigationSystem (author)Sabre002015-04-15

Thanks for the tip! :-)

tomatoskins (author)2015-04-14

This is cool! Any plans on making this life size?

Thanks, im glad to hear that! Yes, I want to implement it at home in life size.

Oh, please share that as well!

For sure ! :)