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
Vertical Farming
  • Challenges & Projects
  • Design Challenges
  • Vertical Farming
  • More
  • Cancel
Vertical Farming
Blog Vertical Hydroponics - Blog 11: Testing Arduino Automation
  • 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: jamesod
  • Date Created: 26 Oct 2015 2:52 AM Date Created
  • Views 690 views
  • Likes 5 likes
  • Comments 2 comments
  • design_challenge
  • vertical_hydroponics
  • vertical_farming
  • arduino
  • automation
Related
Recommended

Vertical Hydroponics - Blog 11: Testing Arduino Automation

jamesod
jamesod
26 Oct 2015

Tonight I wired in the Arduino to the control panel and I'm happy to say that most of it worked right away. I had miswired the HC-SR04 ultrasonic sensor, but once I finished that, I started to calibrate the system. I started with calibrating the HC-SR04 as a water level sensor. I have it mounted above my reservoir and it read exactly 40cm with no water in it. I began the painstaking task of filling it 2 liters at a time and recording the distance reading I got. Then at 20L I switched to 5L at a time, and finally at 40L I went 10L at a time to speed things up. It still took forever. I ended up with the table below.

 

040
139.97
239.4
438.54
638.1
837.8
1037.35
1236.9
1436.5
1636.2
1835.75
2035.5
2534.47
3033.48
3532.5
4031.6
5030.03
6028.3
7026.5
8024.2
9022.4


From two linear trendlines of the data in this table I created two linear equations to calculate the volume of water from the distance. The code below calculates the volume.


if(distance > 35){

  volume = (distance - 39.75) / (-.2311);

  }else{

  volume = (distance - 39.087) / (-.18378);

  }


Next I calibrated the light sensors. I found that all of the sensors would read an analog value of less than 100 if they were on and over 100 if they were off. I set the value of LightOnThresh to 100, so now I get a 1 if the light on each level is on and a 0 if it is off.


After this I tested the pump on level 2. I do not have a pump set up for the first level yet, but when I do it will be run with identical code. Here I ran into a rather dumb mistake. I had declared my pump on and pump off times as integers and used 200000 as my pump off time in milliseconds. This of course is too big for an 8 digit integer and the end result was my pump would turn on and run correctly, but would turn off for only a few seconds when it should have been off for 200 seconds. Changing these to unsigned longs solved this problem.

 

Now that I have the automation working I will work on the UART interface between the EZR32WG and the Arduino so I can use the wireless development kits as my link to the webserver that will ultimately be used for a user interface.

 

I have made a video of what I have working so far. Let me know what you guys think!

:

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


  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 10 years ago +1
    Awesome man, I'm also looking to incorporate a raspberry pi into my aquaponics systems!
  • Former Member
    Former Member over 10 years ago

    Awesome man, I'm also looking to incorporate a raspberry pi into my aquaponics systems!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 10 years ago

    Nice progress.

     

    Looks like you are about ready to germinate some seeds.

     

    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