How to build an easy automatic watering system for seedlings using a Raspberry pi

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 เม.ย. 2017
  • How to set up a simple automatic watering system for seedlings using a raspberry pi, a solenoid, a relay, and a bucket. No pump required. This setup does assume standard Earth gravity. (9.8m/s^2)
    The script is below. I wish I could take credit for it, but I used some sample code. It was last year and I cannot remember where I got it. I would be happy to credit the author. There are a million tutorials on how to use the GPIO of the raspberry pi.
    I execute the script with a cronjob.
    Parts (prices appear to have gone up from what I paid):
    1 Raspberry Pi or Arduino or similar device amzn.to/2WPai7P
    1 four channel relay from Amazon. amzn.to/2LnOKLm
    1 1/2" Hose Barb Gravity Feed Electric Solenoid Valve: ebay.to/2WNH9dm
    1 five gallon bucket (Home Depot homedepot.sjv.io/ejKGz)
    1 1/2" barb connector with a male thread: (Home Depot homedepot.sjv.io/PnyZQ)
    1 piece of female thread PVC compatible with your barb connector
    1 rubber washer
    Some 1/2" ID hose
    clear: amzn.to/2LekvWY
    black: amzn.to/2ElBKnF
    1 hose clamp that will fit around your hose
    Here is the script:
    #!/usr/bin/python
    import RPi.GPIO as GPIO
    import time
    GPIO.setmode(GPIO.BCM)
    init list with pin numbers
    pinList = [2, 3, 4, 17]
    for i in pinList:
    GPIO.setup(i, GPIO.OUT)
    GPIO.output(i, GPIO.HIGH)
    time to sleep = how long the solenoid is open
    SleepTimeL = 4
    main loop
    try:
    #set this to the pin where your solenoid is connected
    GPIO.output(17, GPIO.LOW)
    time.sleep(SleepTimeL);
    GPIO.cleanup()
    print "Good bye!"
    End program cleanly with keyboard
    except KeyboardInterrupt:
    print " Quit"
    Reset GPIO settings
    GPIO.cleanup()
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 44

  • @dudefixesstuff2153
    @dudefixesstuff2153 7 ปีที่แล้ว +4

    I like this alot! A few ways to get there if you have to order the electronics anyways without the PI. I sure learned that organic. fertilizer lesson the hard way as well!

  • @BenjaminEagan
    @BenjaminEagan 6 ปีที่แล้ว +4

    Looks like a great setup, thanks for sharing. I like the solenoid + gravity replacement for a pump.

    • @OldPlanty
      @OldPlanty  6 ปีที่แล้ว +1

      +Ben Eagan thanks man. The bucket is also a limiting factor. Worst case scenario, I end up with 5 gallons of water in the basement.

    • @BenjaminEagan
      @BenjaminEagan 6 ปีที่แล้ว

      That is much better than a surprise pool in your basement.

  • @pepperdactyl
    @pepperdactyl 7 ปีที่แล้ว +5

    That was really cool. Thanks for sharing!

  • @indogoUI
    @indogoUI 6 ปีที่แล้ว +2

    Thanks , interesting project

  • @ayiemeyzingengineer4376
    @ayiemeyzingengineer4376 6 ปีที่แล้ว +2

    thanks for sharing :)

  • @jamesosullivan7253
    @jamesosullivan7253 3 ปีที่แล้ว

    Envisioned almost the exact same setup myself and then saw this... I think I bought an identical solenoid valve - am about to put it together but glad to see it's already a proven design! One thing you might want to think about is sticking a ~1kohm resistor or a diode across the solenoid to prevent a large flyback voltage spike. Without one, arcing may reduce the relay lifetime (and I have had serial communications problems on other setups due to the noise generated by the flyback voltage)

    • @OldPlanty
      @OldPlanty  3 ปีที่แล้ว

      thanks! good luck

  • @celestem6453
    @celestem6453 3 ปีที่แล้ว

    That’s so cool! I want to do the exact same!

  • @marcel6718
    @marcel6718 4 ปีที่แล้ว

    Awesome!

  • @MohamedSalah-qk8bq
    @MohamedSalah-qk8bq 5 ปีที่แล้ว

    That's cool. What is the voltage rating of your water pump, and did you power that using an external PSU?

  • @ABC-rh7zc
    @ABC-rh7zc 4 ปีที่แล้ว

    Nice, though the distribution of water in that particular tray doesn't look very good. I might build one.

  • @myanpatel9379
    @myanpatel9379 4 ปีที่แล้ว

    Hi, Really love this video but What types of wires did you use to connect the relay to the solenoid?

    • @OldPlanty
      @OldPlanty  4 ปีที่แล้ว

      I used low voltage wiring like the kind you would use for a doorbell or something.

  • @kaylaf9890
    @kaylaf9890 7 ปีที่แล้ว

    Awesome! Does the water ever drain?

    • @OldPlanty
      @OldPlanty  7 ปีที่แล้ว

      +Kayla F out of the pan? No. The plants suck it up. I have it timed just right. Little trial and error..

  • @pandasan7982
    @pandasan7982 5 ปีที่แล้ว

    why do u need to set 4 pin that is in pin list to high?

  • @stefanschins7339
    @stefanschins7339 4 ปีที่แล้ว

    Can someone please explain the pins that are connected from the pi to the relay?

  • @aysenuryelek9745
    @aysenuryelek9745 2 ปีที่แล้ว

    Hello, this is my school project. I want to add an automatic control system from the server as soil moisture. Are there any code for this goal?

  • @GabrielFernandes-bc7se
    @GabrielFernandes-bc7se 5 ปีที่แล้ว

    Hello, what if I wanted multiple solenoids? Could I just plug it in the other 3 available slots in the relay?

    • @OldPlanty
      @OldPlanty  5 ปีที่แล้ว

      yes. You can control whatever you like on each relay spot. There are also relays with more positions. 8, or whatever you need.

  • @geekgirl55
    @geekgirl55 5 ปีที่แล้ว

    Could you please show where the cables go . I don't know what ribbble cable goes also the black cables on the solenoid. How does it receive power.

    • @OldPlanty
      @OldPlanty  5 ปีที่แล้ว

      I have a 12V transformer that I just connected some bare wires to and wrapped with electrical tape. As for the wires, it depends on your pi. But you can look up the wires for the GPIO pins to see which one is which. The relay needs power, and ground, and the GPIO pins. There should be indicators on the relay as to what wire goes to what pin. Hit me up on instagram and I can DM you some pix. @oldplanty

  • @miguelsalamera9386
    @miguelsalamera9386 5 ปีที่แล้ว

    Hello. I like this project alot! But is there a clearer tutorial on how to do this project??

    • @OldPlanty
      @OldPlanty  5 ปีที่แล้ว

      I dont have anything written up. I would be happy to answer any questions you have though.

    • @XiJinping14
      @XiJinping14 3 ปีที่แล้ว

      Old Planty I have a question/problem: My raspberry pi is fine and so is the script, it is meant to open the relay to open the solenoid but for some reason the relay doesn’t open. Help?

  • @navneetksingh9138
    @navneetksingh9138 5 ปีที่แล้ว

    sir why we use the smart dripping system and any future use of it.where this is used

    • @OldPlanty
      @OldPlanty  5 ปีที่แล้ว

      not sure I understand the question...

  • @XiJinping14
    @XiJinping14 3 ปีที่แล้ว

    Hey I almost did this but there is something wrong with the relay module

    • @OldPlanty
      @OldPlanty  3 ปีที่แล้ว

      Like, the relay is broken?

    • @XiJinping14
      @XiJinping14 3 ปีที่แล้ว

      Old Planty the code is working but the wires coming from the power adapter to the relay module and solenoid are heating up very fast and also the solenoid doesn’t open when the code is activated according to the timer installed in the code

    • @XiJinping14
      @XiJinping14 3 ปีที่แล้ว

      Old Planty the relay module also makes a click noise

    • @simonduffy99
      @simonduffy99 3 ปีที่แล้ว

      @@XiJinping14 1) If your cables are getting hot, that suggests they are too thin.
      2) Relays like these are supposed to click.

    • @XiJinping14
      @XiJinping14 3 ปีที่แล้ว

      Simon Duffy when it clicks, nothing happens