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
1 Meter of Pi
  • Challenges & Projects
  • Design Challenges
  • 1 Meter of Pi
  • More
  • Cancel
1 Meter of Pi
Blog The Space Salad System Blog 8 - Automation HAT Irrigation System
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rockcacti
  • Date Created: 5 Jan 2021 8:17 PM Date Created
  • Views 1035 views
  • Likes 4 likes
  • Comments 0 comments
  • 1 meter of pi
  • the space salad system
Related
Recommended

The Space Salad System Blog 8 - Automation HAT Irrigation System

rockcacti
rockcacti
5 Jan 2021

Previous Blog Posts

Blog 1 - Challenge Overview + Plant Growth Factors

Blog 2 - Plant Growth Chamber Design

Blog 3 - The Project Plan + Prototype Materials

Blog 4 - Automation Using The Challenger Kit

Blog 5 - Enclosure Prototype + Light/Air/Temperature

Blog 6 - Plant Pot System + Assembly

Blog 7 - Enviro HAT Data Collection and Plotting

 

Automation HAT Setup

 

The Automation HAT is an attachment that perfectly snaps onto the Pi pins. It is outfitted with inputs and outputs that allow automation.

 

Useful Links

  • Automation HAT Pimoroni product page
  • Automation HAT Pimoroni GitHub examples
  • Automation HAT Pimoroni getting started

 

Same as with the Enviro HAT, I power off the Pi before attaching the Automation HAT onto the Pi pins.

 

Starting from where I left off on SSH connection, I install the Automation Python library provided by Pimoroni. Following the instructions outlined by Pimoroni's Getting Started with Automation HAT blog, I type the following into the Windows Command Prompt:

 

curl https://get.pimoroni.com/automationhat | bash

 

I got a "cannot create directory" error, which means 'automationhat' folder was not created.

image

I tried using root permissions to circumvent the error. I wrote the following into the Windows Command Prompt to create the 'automationhat' folder and reinstalled the Automation Python library.

 

sudo mkdir /home/pi/Pimoroni/automationhat

 

I got the following message, but when I checked the folder, it was empty.

image

I decided it would be faster copying and pasting the relevant files manually,

image

Now I have verified that the Automation HAT is working.

 

image

 

Irrigation System

 

Capacitive Moisture Sensor

  • I chose a capacitive moisture sensor because it is more durable than a resistive moisture sensor.
  • Air and water have different dielectric constants. The capacitive sensor outputs a different voltage when surrounded by different dielectric constants and tells us whether the sensor is surrounded by water or air. The sensor is placed in the pot system reservoir. When the reservoir is full, the sensor is submerged in water. When the reservoir is depleted, the sensor is surrounded by air and the sensor will trigger a relay that keeps replenishing the reservoir until the sensor is once again submerged in water.

 

I purchased an Automatic Irrigation System Kit that will interface with the Automation HAT. In microgravity, it is important to contain water. The external reservoir should deflate as water is pumped out of it and into the pot system reservoirs. Blood bags would serve as great external reservoirs.

 

Here's a close-up of the capacitive sensor. As we can see, the edges are exposed. If water deteriorates the edges, the sensor will stop working.

 

image

 

So I seal off the edges using hot glue.

 

image

 

Assembly

  1. Connect the wires of the capacitive sensor to the Automation HAT
    • GND (sensor) to GND (hat)
    • VCC (sensor) to 3V3 (hat)
    • AOUT (sensor) to A1 (hat)
  2. Connect the Automation HAT relay to the water pump
    • Negative terminal (pump) to GND (hat)
    • 5V (hat) to NO (relay)
    • Positive terminal (pump) to COM (relay)
  3. Connect Automation HAT to Raspberry Pi and connect Pi to power source then establish SSH connection

 

The capacitive sensor provides analog input readings which can be displayed on the Automation HAT screen by running:

 

cd ~/automationhat/examples
python3 analog.py

 

We notice that when the capacitive sensor is in the water, it reads analog input 1.9V whereas out of the water it reads 2.6V.

 

Based on these values, we edit the analog.py file so that it turns on the relay when the sensor is not submerged in water (i.e. the plant pot reservoir is empty). I add the following code to the 'while True:' block of code:

 

if automationhat.analog[0].read() > 2.4:
     automationhat.relay.one.on()
else:
     automationhat.relay.one.off()

 

Now that all the code is written, let's do a demonstration!

 

Video Demo

 

The irrigation system is successful! For this demonstration, I used two glass cups instead of my plant pot system and my blood bag reservoir so that we can more easily visualize the flow of water.

 

(While running tests, my water pump was not turning on so I decided to troubleshoot. I first hooked up the water pump with some new batteries and found that it was working. So something must have been wrong with my wires. Lo and behold, I found a faulty jumper wire. After replacing it, the pump-relay combo worked!)

 

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

 

In the next blog, I'll integrate both the Enviro HAT and the Automation HAT with the Raspberry Pi so that I can use both at the same time! Until then, keep learning and have fun! Click the arrow to navigate to the next blog.

image

  • Sign in to reply
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