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
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino Automated Watering
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 390 subscribers
  • Views 385 views
  • Users 0 members are here
  • process duration timer
Related

Arduino Automated Watering

pjacobsen
pjacobsen over 7 years ago

Hey guys hoping for some simple answers before diving into this project.

The basic idea is an arduino is hooked up to 2 motors that will fill and drain a reservoir on specific internals.

What is the best way to use timers in this application? The intervals may be long (12hrs)

Would delay() calls be clunky? Would i2c Real time clocks be overkill?

I will have the program displaying data (and eventually a menu) over LCD, I need a timer function that will still read button presses.

Thanks in advanced for any insight. I'm slowly catching on to best practices.


  • Sign in to reply
  • Cancel

Top Replies

  • fmilburn
    fmilburn over 7 years ago +5
    Hi Parker, Don’t use delay. Set up a check in your loop for the elapsed time and properly manage overflow. If you google “arduino millis() overflow” you will find a discussion of this. You have not provided…
  • fmilburn
    fmilburn over 7 years ago +3
    I don't know your background but here is some additional free advice . Define the problem as best you can and then break both hardware and firmware into manageable pieces. You can see my approach starting…
  • gadget.iom
    gadget.iom over 7 years ago +3
    Hi pjacobsen fmilburn is right. Millis() is probably the best way to go. Delay() function is a locking function so your program will be unresponsive until the time has elapsed. If you are checking for…
Parents
  • fmilburn
    fmilburn over 7 years ago

    Hi Parker,

     

    Don’t use delay.  Set up a check in your loop for the elapsed time and properly manage overflow.  If you google “arduino millis() overflow” you will find a discussion of this.

     

    You have not provided enough information to determine if a RTC is needed but probably not.    You can get started without it.

     

    Pick a LCD that already has an Arduino library.  Buttons are easy to add in your loop or use an interrupt.

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • fmilburn
    fmilburn over 7 years ago

    Hi Parker,

     

    Don’t use delay.  Set up a check in your loop for the elapsed time and properly manage overflow.  If you google “arduino millis() overflow” you will find a discussion of this.

     

    You have not provided enough information to determine if a RTC is needed but probably not.    You can get started without it.

     

    Pick a LCD that already has an Arduino library.  Buttons are easy to add in your loop or use an interrupt.

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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