How long has a pump been running for?


hschir

Recommended Posts

I want to be able to determine how many seconds a pump has been running for in order to determine how much water it has delivered to a vessel, given that it delivers at a rate of 1 Litre per second?

Any ideas?

Link to comment
Share on other sites

Thanks,

I want to turn the pump on based on an alarm from a Davis Vantage Pro 2 weather station for daily sunrise time and then turn off based on an alarm from a water level sensor.

I guess then that the script should read (something like) ;

global pumpStartTime = sunriseAlarm

What else do you suppose I need to do?

I suppose also that I need to know the best way for the pump channel to respond to the sequence. Any suggestions about this would save me tearing my hair out more than necessary.

I have done C programming in past (about 20 years ago) so I'm a bit slow of the mark at this stage - I apologise for that - but any assistance is greatly appreciated -:)

Link to comment
Share on other sites

No, you are going down the wrong path. pumpStartTime should always be set to systime(), as it is simply a recording of the time when the pump is turned on. I'm assuming sunriseAlarm is a channel from the Davis unit that goes to 1 when its sunrise. If so, go to the event of sunriseAlarm and put something like:

if (sunriseAlarm[0] && !sunriseAlarm[1])
   pump = 1
   global pumpStartTime = systime()
endif

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.