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 - Testing the Relay Interface
  • 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: 29 Apr 2019 3:10 AM Date Created
  • Views 2154 views
  • Likes 15 likes
  • Comments 8 comments
  • sprinklers
  • gui
  • iot devices
  • iotcloudch
  • tkinter
  • rpiexpert
  • touch interface
  • project14
Related
Recommended

Irrigation Sprinkler Control - Testing the Relay Interface

ralphjy
ralphjy
29 Apr 2019

I've been distracted and just realized that the deadline for the IoT: In the Cloud project is fast approaching.

 

Time to get back to work to connect and test the relay module.

 

Here are pictures of the RPi 3B and 5 inch touchscreen display mounted in the enclosure.  The relay module is not mounted yet.  And I still need to drill out the wiring access at the bottom of the enclosure.

image

image

 

Here is the front bezel mounted on the display.  I have added a surface mount pin header on the back of the display PCB to break out the GPIO pins that I need for the relay control (the display passes through the first 26 GPIO pins - including the ones used for the display)

image

 

Here is the RPi on a baseplate that I 3D printed to mount in the enclosure.  Next to the RPi is a proto breakout board that I wired to interface the 6 pin cable to the relay controller.  I decided to use a breakout board since it will allow me to easily add an RTC module later.  The breakout board plugs onto the surface mount header on the back of the display.

image

 

I was having some problems with the touch screen so I enlarged all of the controls to make them easier to operate.  I should have used a capacitive touch screen but I couldn't find one that would fit in the enclosure that I selected.

 

Here is the new layout.

image

 

Here is a short video showing the relay module being controlled using the tkinter GUI interface.  I am operating the interface via VNC.  Apologies for the lack of clarity.  I need to improve my video setup.

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

 

I discovered that there is an anomoly with the operation of the tkinter button interface.  For the "Run once" mode, I wanted the radiobutton to turn green while the sprinklers were running and turn back to white when they were finished and also turn the Zone labels green to show which zone was running.  Unfortunately, it appears that button attributes like color do not change until AFTER the button command (callback) function has completed.  I am controlling the relays in the command function so the button colors won't change until after all the sprinklers have run.  I haven't found a way to work around that yet.

 

My next steps are to implement the cloud communication via MQTT to the Cayenne Dashboard.  That way I can monitor and control the interface from a browser or mobile app.

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 6 years ago +2
    Hi Ralph, Looks like you are doing a really nice job. There are always things that don't do what you want. Even if you can't get exactly what you envisioned there will be a workaround that will get you…
  • jpnbino
    jpnbino over 6 years ago +2
    For this application it´s fine to use resistive touch and large buttons ( I´d prefer larger ones). Also it´s cheap and good for functional test. My next steps are to implement the cloud communication via…
  • ralphjy
    ralphjy over 6 years ago in reply to ntewinkel +2
    Hi Nico, I have been concerned about the temperature in the enclosure because I did not add any ventilation (I only have the cable access hole on the bottom). I have the enclosure in my garage (that's…
  • ntewinkel
    ntewinkel over 6 years ago in reply to ralphjy

    Hi Ralph,

     

    Thanks for the update, that's good to know, and I almost wonder: with the garage getting so warm maybe having it enclosed might actually keep it cooler overall image

     

    You're right about the duty cycle - it barely does any work and I guess that's why it doesn't need to shed much heat.

    My dashboard (on OpenSprinkler) reads 33C right now, so our temperatures are similar, and mine is in a cool basement/crawlspace with ventilation holes (it does have a front cover).

     

    Cheers,

    -Nico

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

    Hi Nico,

     

    I have been concerned about the temperature in the enclosure because I did not add any ventilation (I only have the cable access hole on the bottom).  I have the enclosure in my garage (that's where the old controller was so it was convenient to reuse the wiring).  So, it's a relatively benign environment.  Probably why I haven't had any issues.  Summer is here however and we do get some days approaching 40C.  Right now the unit draws about 590mA @ 5V for the RPi and display.  The relays don't add much because I run them sequentially and they only draw 15-20mA each and the duty cycle is really low.  I have a fair amount of volume and surface area albeit plastic.  The onboard sensor on the RPi reads about 30-35C above ambient at equilibrium with the enclosure shut.  I have considered shutting off the backlight on the display when not in use as it adds about 130mA.  I may also add some vents as I don't need the enclosure to be waterproof.  For this summer I may just leave the enclosure door open as the garage temp can get over 30C.  Probably not really an issue since the RPi is basically idling, but no need to stress it.

     

    Ralph

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 6 years ago

    Hi Ralph,

     

    I'm using an older RPi 1B to run my sprinkler system with OpenSprinkler and my home-built control board to switch the zones, but the "enclosure" I have is just a little plastic ziplock-type container image

    I like the look of the enclosure you have, but am curious how this is working out for you (I'm hoping you've been using it for a month now?) - did you need to add any ventilation to the box? or do you just leave the front open or the lid off?

     

    Thanks,

    -Nico

     

    edit: here's what mine looks like... needs work image

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago

    Hi Ralph,

     

    This looks like an amazing project! Very comprehensive.

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

    Nice post.

     

    It is always useful to verify that your components work with testing before you hook up anything valuable to the outputs.

     

    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