Intel Automated Gardening System

by opengreenenergy in Circuits > Arduino

22101 Views, 434 Favorites, 0 Comments

Intel Automated Gardening System

DSC03865.JPG
Screenshot_2015-10-22-14-57-08.png
5628bcb367400cd2eb0016d3.jpeg
5628be2c2e7fb6d3ed000788.jpeg
Intel Automated Gardening System

[ Play Video ]

Hello Everyone !!!

This is my first Instructabe on Intel Edison. This instructable is a guide for making an automated watering (Drip Irrigation) system for small potted plants or herbs by using an Intel Edison and other cheap electronic sensors. This is perfect to grow an indoor herb plants.But this idea can be implemented for a larger system.

I am belong to a village and we have our own firm.During staying at my village we were getting plenty of fresh vegetables/herb leaves from our firm(see above images).But now the situation is different,as I am staying in a city no more fresh vegetables/herb leaves.I have to buy these from the store which are not at all fresh.Apart from these they are grown by using harmful pesticides which is not good for health.So I am planning to firming herbs at my balcony which is completely fresh and harmless.But firming is a time consuming process. I always forget to give water in my flower plants. This leads to give the idea of automated gardening system.

The system is designed to sense soil moisture, amount of light falling on the plants and water flow rate . When the moisture content in the soil is too low, the system will give command to start a pump and water the soil.The flow meter monitor the water consumption.

Apart from this the Intel Edison will transmit information on moisture level,ambient light and flow rate to the web .You can monitor all the data from your smart phone by using Blynk apps.Then a twit can be send to your account automatically if the moisture falls below a given threshold value.

Care for the environment has become very important in recent years and there is an increasing demand for "green" applications that can help reduce CO2 emissions or make a more efficient management of energy consumed.To make the project more reliable and eco friendly, I used solar power to power the whole system.

Parts Required

1. Intel Edison Board (Amazon)

2.Moisture Sensor ( Amazon )

3. Flow Sensor ( Amazon )

4.DC pump ( Amazon )

5.Photocell /LDR ( Amazon )

6. MOSFET (IRF540 or IRL540 ) ( Amazon )

7. Transistor ( 2N3904) ( Amazon )

8. Diode (1N4001 ) ( Amazon )

9. Resistors ( 10K x2 ,1K x1, 330R x1)

10. Capacitor -10uF ( Amazon )

11. Green LED

12. Double side Prototype Board ( 5cm x 7cm) ( Amazon )

13. JST M/F connectors with wires ( 2 pin x 3, 3pin x1) ( eBay )

14. DC Jack- Male ( Amazon )

15. Header Pins ( Amazon )

16.Solar Panel 10W ( Voc = 20V-25V) ( Amazon )

17. Solar Charge Controller ( Amazon )

18. Sealed Lead Acid Battery ( Amazon )

Tools Required :

1. Soldering Iron ( Amazon )

2. Wire Cutter /Stripper ( Amazon )

3.Hot Glue Gun ( Amazon )

4.Drill ( Amazon )

How the System Works

Blynk Dash Board.jpg
blynk-app-820x420.jpg

The heart of the project is Intel Edison board.It is hooked up to the various sensors (like soil moisture,light,temperature,water flow etc) and a Water Pump.The sensors monitor the different parameters like Soil Moisture, Sun Light and Water flow/ Consumption then fed to Intel Board. Then the Intel board process the data coming from the sensors and give command to the Water Pump for watering the plant.

The various parameters are then send to web through the the Intel Edison inbuilt WiFi.Then it is interfaced with Blynk apps for monitoring the plant from your Smartphone/Tablets.

For easy understanding I divided the projects in to smaller sections as below

1. Getting Started With Edison

2. Power Supply for the Project

3. Connecting and testing the Sensors

4. Making Circuit / Shield

5. Interfacing with Blynk App

6.Software

7. Preparing the Enclosure

8.Final Testing

Setting of Intel Edison

5623240767400c489e0007d5.jpeg
562325b450e1b6ce8a000dd2.jpeg

I buy this Intel Edison and Arduino Expansion Board from Amazon. I am very unlucky as did not get it from Instructable Campaign. I am familiar with Arduino, but I found getting up and running with the Intel Edison to be a bit difficult. Anyway after few days of try, I found its quite easy to use.I will guide you,by the following few steps to get started quickly.So don't scare :)

Just follow the following instructables which well cover how to get started with Edison

If you are absolute beginner then follow the following Instructable

An Absolute Beginners Guide To The Intel Edison

If you are Mac user then follow the following Instructable

REAL beginner's guide to setting up the Intel Edison (with Mac OS)

Apart from these Sparkfun and Intel have a great tutorials to getting started with Edison.

1. Sparkfun Tutorial

2. Intel Tutorial

Download the all the required software from the Intel website

https://software.intel.com/en-us/iot/hardware/edison/downloads

After downloading the software, you have to installed the drivers,IDE and OS

Drivers :

1. FTDI Driver

2. Edison Driver

IDE :

Arduino IDE

Flashing the OS :

Edison with Yocto Linux Image

After installing all ,you have to set up for WiFi connection

Power Supply

5623246a4936d45f90000366.jpeg
5627a49d937ddb4603000feb.jpeg
IMG_20151029_110105.jpg
563469eb4fbade796300047c.jpeg
IMG_20151029_110340.jpg
IMG_20151029_111110.jpg
IMG_20151029_111441.jpg
IMG_20151029_110539.jpg

We need power for this project for two purpose

1. To power the Intel Edison (7-12V DC) and different sensors( 5V DC)

2. To run the DC pump (9V DC)

I choose a 12V sealed lead acid battery for power the entire project.Because I got it from a old computer UPS.Then I thought to use Solar Power to charge the battery.So now my project is completely reliable and eco friendly.

See the above images for preparing the Power Supply.

The Solar Charging System is consists of two main components

1. Solar Panel : It convert sun light to electrical energy

2.Solar Charge Controller : To charge the battery in a optimum way and control the load

I have written 3 instructables on making a Solar Charge Controller.So you can follow it to make your own.

ARDUINO-SOLAR-CHARGE-CONTROLLER

If you don't want to make, then just buy it from eBay or Amazon.

Connection :

Most of the charge controller have commonly 3 terminals : Solar,Battery and load.

Connect the Charge Controller to the Battery first, because this allows the Charge Controller to get calibrated to appropriate system voltage. Connect the negative terminal first and then positive. Connect the solar panel(negative first and then positive) At last connect to the DC load terminal.In our case the load is Intel Edison and DC pump.

But Intel Board and pump needs a stable voltage.So a DC-DC buck converter is connected at DC load terminal of the Charge controller.

Moisture Sensor

IMG_20151018_091839.jpg
IMG_20151018_091855.jpg
IMG_20151018_092103.jpg
IMG_20151018_093221.jpg
5623233a2e7fb67d55000d08.jpeg

The moisture sensors working is based on the resistivity of water to determine the moisture level of the soil. The sensors measure the resistance between two separate two probes by sending a current through one of them and reading a corresponding voltage drop due to a known resistor value.

The more water the lower the resistance, and using this we can determine threshold values for moisture content.When the soil is dry, the resistance will be high and the LM-393 will show a high value on the output.When the soil is wet, it will show a low value in the output.

LM-393 DRIVER (moisture sensor) -> Intel Edison

GND -> GND

5 V -> 5

VOUT -> A0

Test Code :

int moist_sensor_Pin = A0;    // Sensor is connected to analog pin A0

int moist_sensor_Value = 0;  // variable to store the value coming from the sensor
 
void setup() {
   Serial.begin(9600);  
}
 
void loop() {
  // read the value from the sensor:
  moist_sensor_Value = analogRead(moist_sensor_Pin);    
  delay(1000);          
  Serial.print("Moisture sensor Reading = " );                       
  Serial.println(moist_sensor_Value);                   
}


Light Sensor

lder_bb.png
562480f82e7fb67d00000afb.jpeg
5624814d50e1b67da40001fa.jpeg

To monitor the amount of sun light falling on the plant we need a light sensor.You can buy a ready made sensor for it.But I prefer to make my own by using a photocell/LDR.It is very low cost, easy to get in many sizes and specifications.

How it Works ?

A Photocell is basically a resistor that changes its resistive value (in ohms) depending on how much light is shining onto the squiggly face.Higher the amount of light falling on it,lower the resistance and vice versa.

To know more on the Photocell, click here

Bread Board Circuit :

The light sensor can be made by making a voltage divider circuit with upper resistance (R1) as Photocell/LDR and a and lower resistance (R2) as a 10K resistor.See the circuit shown above.

To know more on it , you can see the adafruit tutorial.

Connection :

LDR one pin ---> 5V

Junction -----> A1

10K Rresistor one pin ---> GND

Optional noise filter circuit : Connect a 0.1uF capacitor across the 10K resistor to filter out the unwanted noise.

Test Code:

Result :

The serial monitor reading shows that the sensor value is higher for bright sun light and lower during the shadow.

int LDR = A1;     // LDR is connected to analog pin A1

int LDRValue = 0;      //that’s a variable to store LDR values
void setup()
  {
    Serial.begin(9600);          //start the serial monitor with 9600 buad
  }
 
void loop()
  {
    LDRValue = analogRead(LDR);      //reads the ldr’s value through LDR 
     Serial.print("Light Sensor Value: ");
     Serial.println(LDRValue);       //prints the LDR values to serial monitor
     delay(50);        //This is the speed by which LDR sends value to arduino
  }

Make the Light Sensor

56248e312e7fb67d00000b44.jpeg
IMG_20151019_114238.jpg
IMG_20151019_114743.jpg
IMG_20151020_112250.jpg

If you have a Seeedstudio groove light sensor then you can skip this step.But I do not have groove sensor, so I made my own.If you will make no doubt you will learn more and feels great pleasure after completion.

Take two pieces of wires with desired length and stripped out the insulation at the ends.Connect a two pin JST connector at the end.You can buy connector with wires also.

The photocell have long legs which still needs to have its clipped down to short stubs to match the lead wires.

Cut two short pieces of heat-shrink to insulate each leg.Insert the heat shrink tube to the wires.

Then the photocell is soldered onto the end of the lead wires.

Now the sensor is ready.So you can just easily strap this to the desired location.The 10K resistor and 0.1uF capacitor will be solder on the main circuit board which I will explain later.

Flow Sensor

5623228367400c31c9000195.jpeg
562323df45bceb470000023c.jpeg
56232416937ddb0c040003c1.jpeg
562324472e7fb67d0000056c.jpeg

The flow sensor is used to measure liquid flowing through a pipe / container.You may think why we need this sensor. There two main reasons

1.To measure the amount of water used to water the plants , to prevent wastage

2. To switch off the pump to avoid dry run.

How the Sensor Works ?

It works on the principle of “Hall Effect”.A voltage difference is induced in a conductor perpendicular to the electric current and the magnetic field perpendicular to it. A small fan/propeller rotor is placed in the path of the liquid flowing, when the liquid flows the rotor rotates. The shaft of the rotor is connected to a hall effect sensor. It is an arrangement of a current flowing coil and a magnet connected to the shaft of the rotor. Thus a voltage/pulse is induced as this rotor rotates. In this flow meter, for every litre of liquid passing through it per minute it outputs about few pulses.The flow rate in L/hr can be calculated by counting the pulses from the output of the sensor.The Intel Edison will do the counting job.

The Flow Sensors comes with three wires:

1. Red/VCC (5-24V DC Input)

2.Black/GND (0V)

3. Yellow/OUT (Pulse Output)

Preparing the Pump Connector : The pump comes with JST connector and wires.But the female connector in my stock did not match with it and the wire length is also small.So I cut the original connector and solder a new connector with suitable size.

Connection :

Sensor ------> Intel

Vcc ----> 5V

GND----> GND

OUT ----> D2

Test Code :

The pulse out pin of the flow sensor is connected to digital pin 2. The pin-2 serves as an external interrupt pin.

This is used to read the output pulses coming from the water flow sensor. When the Intel board detects the pulse, it immediately triggers a function.

To know more on Interrupt you can see the Arduino Reference page.

The test code is taken form SeeedStudio. For more details you can see here

Note : For flow calculation you have to changei the equation as per your pump data sheet.

// reading liquid flow rate using Seeeduino and Water Flow Sensor from Seeedstudio.com
// Code adapted by Charles Gantt from PC Fan RPM code written by Crenn @thebestcasescenario.com // http:/themakersworkbench.com http://thebestcasescenario.com http://seeedstudio.com volatile int NbTopsFan; //measuring the rising edges of the signal int Calc; int hallsensor = 2; //The pin location of the sensor void rpm () //This is the function that the interupt calls { NbTopsFan++; //This function measures the rising and falling edge of the hall effect sensors signal } // The setup() method runs once, when the sketch starts void setup() // { pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input Serial.begin(9600); //This is the setup function where the serial port is initialised, attachInterrupt(0, rpm, RISING); //and the interrupt is attached } // the loop() method runs over and over again, // as long as the Arduino has power void loop () { NbTopsFan = 0; //Set NbTops to 0 ready for calculations sei(); //Enables interrupts delay (1000); //Wait 1 second cli(); //Disable interrupts Calc = (NbTopsFan * 60 / 73); //(Pulse frequency x 60) / 73Q, = flow rate in L/hour Serial.print (Calc, DEC); //Prints the number calculated above Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a new line }

DC Pump

IMG_20151018_091744.jpg
IMG_20151018_091642.jpg
IMG_20151018_091708.jpg
IMG_20151020_091211.jpg
pump driver.png

The pump is basically a geared down DC motor, so it has a lot of torque. Inside the pump is a ‘clover’ pattern of rollers. As the motor turns, the clover presses on the tube to press the fluid though. The pump does not need to be primed and in fact can self-prime itself with water a half meter with ease.

The pump is not a submersible type.So it never touches the fluid and makes this an excellent choice for small gardening.

Driver Circuit :

We can't power the pump directly from the Edision pins as the Edison pins can only supply a small amount of current. So to drive the pump we need a separate driver circuit.The driver can be make by using a n Channel MOSFET.

You can see the driver circuit shown in above picture.

The pump have two terminals.The terminal marked with a red dot is positive.See the image.

The Dc pump is recommend to run at 3V to 9V . But our power source is 12V battery.To achieve the desired voltage we need to step down the voltage.This is done by a DC Buck Converter.The out put is set to 9V by adjusting the on board potentiometer.

Note : If you are using IRL540 MOSFET then no need to make the driver circuit as it is logic level.

Preparing the Pump Connector:

Take two pin JST connector with wire.Then solder the red wire to the polarity with dot mark and black wire to the other terminal.

Note: Please do not test long time with no-load, inside is with plastic leaves, can't suction impurity.

Prepare the Sield

56249a8867400c489e000f83.jpeg
IMG_20151019_124015.jpg
IMG_20151019_124709.jpg
56249ab567400c31c90004a5.jpeg
IMG_20151019_125308.jpg
IMG_20151019_125418.jpg

As I did not have groove shield for sensors connection.To make the connection easier, I made my own.

I used a double sided prototype board ( 5 cm x 7 cm) for making it.

Cut 3 strips of straight male header pin as shown in picture.

Insert the header to the Intel female headers.

Place the prototype board just above it and mark the position by a marker.

Then solder all the headers.

Make the Cicrcuit

Intel Automated Gardening.png
IMG_20151020_085446.jpg
IMG_20151020_090944.jpg
IMG_20151020_091521.jpg
IMG_20151020_094046.jpg
IMG_20151020_095916.jpg
5625e7ad67400c31c9000cff.jpeg
IMG_20151020_112358.jpg
562712e92e7fb6f55000131e.jpeg

The shield is consists of :

1. Power Supply Connector ( 2 pin )

2. Pump Connector (2 pin ) and its driver circuit ( IRF540 MOSFET ,2N3904 Transistor,10K and 1K Resistors and 1N4001 anti parallel diode)

3. Sensor Connectors :

  • Moisture sensor - The connector for moisture sensor is made with 3 pin straight male headers.
  • Light Sensor - The light sensor connector is a 2 pin JST female connector, the associated circuit (10K resistor and 0.1uF Capacitor) is made on the shield
  • Flow Sensor : The flow sensor connector is a 3 pin JST female connector.

4. Pump LED : A green LED is used for knowing the pump status. ( Green LED and 330R resistor )

Solder all the connectors and other components as per the schematic shown above.

Install Blynk App and Library

Screenshot_2015-10-22-14-22-54.png
Screenshot_2015-10-22-15-05-28.png

As the Intel Edision have inbuilt WiFi, I thought to connect it with my router and monitor the plants from my Smartphone.But making a suitable apps need some sorts of coding. I searched for simple option so that any one with little experience can make it.The best option I found is using the Blynk App.

Blynk is an app that allows full control over Arduino, Rasberry, Intel Edision and many more hardware.It is compatible for both Android and IPhone.Right now the Blynk app is available with free of cost.

You can download the app from the following link

1. For Android

2. For Iphone

After downloading the app, installed it on your smartphone.

Then you have to import the library on to your Arduino IDE.

Download the Library

When you run the app for the first time, you need to sign in – so enter an email address and password.

Click the “+” at the top-right of the display to create a new project.Then name it.I named it " Automated Garden ".

Select the target hardware Intel Edision

Then click “E-mail” to send that auth token to yourself – you will need it in the code

Making the Dashboard

Screenshot_2015-10-22-15-05-50.png
Screenshot_2015-10-22-15-05-57.png
Screenshot_2015-10-22-15-06-45.png
Screenshot_2015-10-22-15-08-32.png
Screenshot_2015-10-22-15-07-42.png
Screenshot_2015-10-22-15-09-30.png
Screenshot_2015-10-22-15-09-54.png
Screenshot_2015-10-22-15-13-04.png
Screenshot_2015-10-22-15-10-54.png
Screenshot_2015-10-22-15-12-11.png
Screenshot_2015-10-22-15-12-34.png
Screenshot_2015-10-22-15-13-33.png

The Dashboard is consists of different widgets.To add widgets follow the steps below :

Click “Create” to enter the main Dashboard screen.

Next, press “+” again to get the “Widget Box”

Then drag 2 Graphs.

Click on the graphs,it will pop up a settings menu as shown above.

You have to change the name "Moisture",Select the Virtual Pin V1, then change the range from 0 -100.

Change the slider position for different graph patterns.Like Bar or Line.

You can change the colour also by clicking the circle icon on the right side of the Name.

Then add two Gauges, 1 Value Display and Twiter.

Follow the same procedure for setting.You can refer images shown above.

Programming :

Screenshot 2015-10-22 16.27.21.png
Screenshot_2015-10-22-14-57-08.png
Screenshot_2015-10-22-15-02-53.png

In the earlier steps you have tested all the sensors code.Now it is time to combined them together.

You can download the code from the link below.

Open the Arduino IDE and select the board name " Intel Edison" and PORT No.

Upload the code. Click the triangle icon at the top right corner on the Blynk App Now you should visualise the graphs and other parameters.

Updates on on WiFi Data Logging ( 27/10/2015 ) : Working of Blynk App tested for moisture and light sensor.I am working on Flow Sensor and Twiter .

So be in touch for updates.

Preparing Enclosure

IMG_20151022_130015.jpg
5628c89215be4d82df000195.jpeg
IMG_20151022_131820.jpg
5628c75367400cd2eb001712.jpeg
IMG_20151022_130925.jpg
IMG_20151022_131037.jpg
IMG_20151022_131231.jpg
IMG_20151022_131418.jpg
IMG_20151022_131710.jpg
IMG_20151029_121608.jpg
IMG_20151029_121909.jpg
IMG_20151022_132854.jpg
IMG_20151029_123048.jpg

To make the system compact and portable, I put all the parts inside a plastic enclosure.

First a place all the components and marked for making holes ( for pipe,Cable Tie to fix the pump and Wires)

Bind the pump by help of a cable tie.

Cut a small silicon tube and connect between pump discharge and flow sensor.

Insert a long silicon tube at the holes near to the Pump Suction.

Insert another silicon tube and connect it to the flow sensor.

Install the buck converter at the one side wall of the enclosure.You may apply glue or 3M pad just like me.

Apply hot glue at the base of flow sensor.

Place the Intel board with the prepared shield.I applied 3M mounting squares for sticking to the enclosure.

Finally connect all the sensors to the corresponding headers on the shield.

Final Testing

IMG_20151114_170214.jpg

Open the Blynk App and press the play button ( triangle shape icon ) to run the project.After waiting for few seconds the graphs and gauges should active.It indicates that your Intel Edison connected to the router.

Moisture Sensor test :

Took a dry soil pot and insert the moisture sensor.Then pour water gradually and observe the readings on your smartphone.It should be increased.

Light Sensor :

The light sensor can be checked by showing the light sensor towards the light and away from it.The changes should be reflected on your Smartphone graph and gauges.

DC Pump :

When the moisture level falls below 40% then pump will starts and green LED will ON.You can remove the probe from the wet soil to simulate the situation.

Flow Sensor :

The flow sensor code is working on Arduino but giving some error on Intel Edison.I am working on it.

Twiter twit :

Not tested yet.I will do it as soon as possible.Stay tuned for updates.

You can also see the demo Video

If you enjoyed this article, don’t forget to pass it along!
Follow me for more DIY projects and ideas. Thank you !!!