element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Robotics
  • Technologies
  • More
Robotics
Forum Automatic irrigation system using pic microcontroller
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Robotics to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 22 replies
  • Answers 15 answers
  • Subscribers 65 subscribers
  • Views 5417 views
  • Users 0 members are here
Related

Automatic irrigation system using pic microcontroller

akashm.m
akashm.m over 8 years ago

Any one pls tell me how to build a automatic irrigation system using pic microcontroller. & It's programming

  • Sign in to reply
  • Cancel

Top Replies

  • gadget.iom
    gadget.iom over 7 years ago in reply to jw0752 +9 suggested
    I totally agree with what jw0752 is saying here. The community is very supportive, and your experiences will help others far more than you might immediately think. Where other on-line communities might…
  • jw0752
    jw0752 over 7 years ago in reply to urkraft +7 suggested
    Hi Raymond, I have to disagree with you a little. Everyone who has ever made anything NEW has been through the same process as you have described. I respect you for your in process posting of your results…
  • mcb1
    mcb1 over 7 years ago in reply to urkraft +7 suggested
    Am quite sure that is the problem. Adding hysterisis to the relay will help stop it destroying itself. This is one of the biggest advantages of adding any form of controller BUT it can be achieved by capacitors…
Parents
  • urkraft
    0 urkraft over 7 years ago

    My latest attempt at a solution:

    I just wasted about 1 hour documenting my work in this blog when everything was suddenly lost, so i have no intention of wasting more time in this way. This is going to be a "quick and dirty" posting. If this attempt also fails then i will give up.

     

    Parts used:

    • 1 Adafruit Feather HUZZAH ESP8266
    • 1 5v 1A DC power supply w/micro usb contact for the HUZZAH
    • 1 12v 1A DC power supply (https://www.kjell.com/no/produkter/elektro-og-verktoy/stromforsyning/stromforsyning/ac-dc/fast-utgangsspenning/ac-dc-stromadapter-12-v-(dc)-12-w-p44382)
    • 1 power jack for the 12v power supply
    • 1 soil moisture sensor (https://www.kjell.com/no/produkter/elektro-og-verktoy/arduino/moduler/luxorparts-jordfuktmaler-p87941)
    • 1 22k ohm 1/8w resistor
    • 1 10k 1/8w resistor
    • 1 33 ohm 1/4w resistor
    • 2 1N4001 diodes
    • 1 Peristaltic Pump (https://www.kjell.com/no/produkter/elektro-og-verktoy/elektronikk/electromechanics/motorer/luxorparts-vaeskepumpe-peristaltisk-p90782)
    • 1 VR05R241A single pole DIL relay (https://www.kjell.com/no/produkter/elektro-og-verktoy/elektronikk/electromechanics/releer/1-polet-dil-rele-5-v-dc-0-5-a-30-v-p36110)
    • 1 Breadboard
    • Jumber wires
    • Water container w/water

     

    Schematic Drawing:

    image

    Solid State Relay Datasheet:

    image

    HUZZAH code:

    #include <ESP8266WiFi.h>

     

     

    const char* ssid     = "<your ssid here>";

    const char* password = "<your password here>";

     

     

    const int LED = 0;

    const int PUMP = 4;

    // Max value is approx. 825 - bone dry

    // Min value is approx. 406 - drowning in water

    const int THRESHOLD = 700;

    int moisture = 0;

    int tmp = 0;

     

     

    void setup() {

      // put your setup code here, to run once:

      Serial.begin(115200);

      delay(100);

     

     

      Serial.println();

      Serial.println();

      Serial.print("Connecting to ");

      Serial.println(ssid);

     

      WiFi.begin(ssid, password);

      // supstitute the ipaddresses below with your desired static ip, router ip, and dhcp ip

      WiFi.config(IPAddress(192, 168, 1, 50), IPAddress(192, 168, 1, 1), IPAddress(192, 168, 1, 1));

     

      while (WiFi.status() != WL_CONNECTED) {

        delay(500);

        Serial.print(".");

      }

     

     

      Serial.println("");

      Serial.println("WiFi connected");

      Serial.println("IP address: ");

      Serial.println(WiFi.localIP());

     

     

      Serial.println();

      Serial.println();

      Serial.println("Soil moisture sensor");

      pinMode(PUMP, OUTPUT);

      pinMode(LED, OUTPUT);

      digitalWrite(LED, HIGH);

      digitalWrite(PUMP, HIGH);

    }

     

     

    void loop() {

      // put your main code here, to run repeatedly:

      tmp = analogRead(A0);

      if (tmp != moisture) {

        moisture = tmp;

        Serial.print("moisture = ");

        Serial.println(moisture);

        if (analogRead(A0) > THRESHOLD) {

          digitalWrite(LED, LOW);

          digitalWrite(PUMP, LOW);

          Serial.println("Threshold reached - water the plant!");

        } else {

          digitalWrite(LED, HIGH);

          digitalWrite(PUMP, HIGH);

        }

      }

      delay(1000);

    }

     

    Comments:

    Everything appears to be stable with this solution so far. In the future i plan on implementing the following changes:

    - sensor to detect when the water supply is empty

    - send email when detected that water supply is empty, and do not attempt to pump water if the water supply is empty

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • urkraft
    0 urkraft over 7 years ago in reply to urkraft

    Forgot to mention a couple of other changes i plan to make to the code:

     

    - Introduce another (lower) threshold and use it for turning off the water pump

    - introduce a longer time delay (1 day) to wait before checking soil moisture immediately after turning off the pump.

     

    These changes will have to wait as i have other activities pending which require my immediate attention.

     

    -raymond

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • urkraft
    0 urkraft over 7 years ago in reply to urkraft

    Forgot to mention a couple of other changes i plan to make to the code:

     

    - Introduce another (lower) threshold and use it for turning off the water pump

    - introduce a longer time delay (1 day) to wait before checking soil moisture immediately after turning off the pump.

     

    These changes will have to wait as i have other activities pending which require my immediate attention.

     

    -raymond

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube