Go Down

Topic: Monitoring Input (Read 687 times) previous topic - next topic

Xenia2

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 :-)

CrossRoads

Why not just put a water level sensor in the reservoir so it will not pump when it is out of water?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Chagrin

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.

CrossRoads

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 ...
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Xenia2

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

mmcp42

note the time when you start the pump
loop until your input changes OR 20 seconds elapses
there are only 10 types of people
them that understands binary
and them that doesn't

wildbill

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.

Go Up