element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
IoT: In the Cloud
  • Challenges & Projects
  • Project14
  • IoT: In the Cloud
  • More
  • Cancel
IoT: In the Cloud
Blog Irrigation Sprinkler Control - Finishing Up
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join IoT: In the Cloud to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 12 May 2019 1:36 AM Date Created
  • Views 863 views
  • Likes 6 likes
  • Comments 2 comments
  • touch
  • sprinklers
  • gui
  • iot devices
  • iotcloudch
  • tkinter
  • rpiexpert
  • project14
Related
Recommended

Irrigation Sprinkler Control - Finishing Up

ralphjy
ralphjy
12 May 2019

This will be my final blog in the IoT: In the Cloud project.  I have finished programming the controller logic and have modified the enclosure to mount the relay module and drilled out the wiring access hole.

 

Controller Logic

For this first pass I basically replicated the control logic of the mechanical timer that I am replacing and with the Cayenne dashboard I can update it remotely.  The sprinkler schedule can be set for a two week period.  The day buttons are selected for each day that the sprinklers should run.  The current day indicator shows which day is active.  The start time indicates when the sprinklers should start and each zone has an independent duration setting.

 

When the current day is a day with the day button set, the sprinklers will start when the current time matches the scheduled time.  The zones run in sequence starting with zone 1.

image

 

Here is a short video showing the operation.  I started the video about 15 seconds before the scheduled time.  The durations in the video are programmed in seconds rather than minutes just for the demo.  Inset on the lower right of the GUI is the relay module so you can see the relays operating.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image
.

 

A couple of things to note in the video:

  1. The current time freezes when the zone sequence starts and only continues when all zones have finished
  2. There is no indication of which zone is active (other than the LEDs on the relay module)

 

Both of these shortcomings are caused by not using independent threads for the time and run functions.  The tkinter GUI is somewhat tricky to implement with threads and I haven't quite figured that out yet.  Since the sprinkler operation works fine, I'm going to start with what I have .  Fixing the status indicators will have to wait until later this summer.

 

Enclosure modification

It turns out that I had some bad luck and wasn't quite able to finish.  I've been having some issues on and off with the hotend on my 3D printer and as Murphy would have it, the unit wasn't functioning when I tried to print the base for my relay module.  After a couple hours of troubleshooting I figured out that my nozzle is blocked.  I don't think there is an easy fix other than getting another nozzle.  So, I had to resort to a mock up using foam core board.

 

Here is a picture of the assembled enclosure:

image

 

I am not going to mount the enclosure until I fix my printer and print the relay baseplate.

 

Summary

I finished most of what I had planned for the initial phase of this project although I'm not really happy with the appearance of the Cayenne dashboard and I did not have time to figure out why the mobile app didn't work (I've used it before with The Raspberry Pi agent, so it must be a problem with the MQTT implementation).

 

Since I can't finish until I fix my printer, I may take the opportunity to add an RTC.  And try to fix the issue with the mobile app.  Maybe I'll look at some other cloud dashboards to see if I can get a better fit to my GUI.

 

Software enhancements that are planned:

  1. Implement threading in the tkinter GUI to prevent delays in updating GUI elements when the sprinklers are running
  2. Unique zone durations per day - currently durations are the same for every day

 

Software features that I would like to add:

  1. Calendar based scheduling - to allow for vacations, etc
  2. Weather aware operation - e.g. don't run if it's raining

 

The good news is that I can do the program development and updates remotely using SSH and VNC.

  • Sign in to reply
  • three-phase
    three-phase over 6 years ago

    Your panel has a real professional look to it and the project is coming along nicely.

     

    Kind regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 6 years ago

    You are making good progress.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
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