Pages: [1]   Go Down
Author Topic: Monitoring Input  (Read 611 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I am trying to build a water top off system for my fish tank (i.e when water low activate the pump). So I got a simple "if" "else" statements to turn on the pump when water is low. I got the a digital input to monitor the water.

Lets say I run out the water inside the reservoir, I wouldn't want the pump to turn on for a long period of time. Is there a way I can monitor the Input state, say if input "HIGH" for 20 seconds, shut off the pump?

Any feedbacks would be appreciated :-)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not just put a water level sensor in the reservoir so it will not pump when it is out of water?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 48
Posts: 2542
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A temperature sensor on the pump might be easier than a water level sensor. Most pumps are cooled by the water they're pumping so an empty reservoir would mean that your pump would get hotter.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Water level sensor could be a simple float that trips a simple switch tied to an input, temperature independent. As it drops, pulls a slip of paper with it to uncover and optoisolator, LDR, phototransistor, etc. Or a mechanical low force switch.  Or ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I don't want to add another sensor, hope there is a way I can do with coding...it's possible?
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

note the time when you start the pump
loop until your input changes OR 20 seconds elapses
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

New Jersey
Offline Offline
Faraday Member
**
Karma: 70
Posts: 3726
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, make sure you have a substantial time elapsed (an hour?) between checking the level, otherwise, when you're out of water in the reservoir and the tank needs water, the pump will repeatedly be turned on for 20 second stints. This will also limit the flooding you'll get if your tank level sensor malfunctions.
Logged

Pages: [1]   Go Up
Jump to: