Continuing the discussion from Subtitute for function pulseIn:
My name is Luc, I’m a total novice in software, but finally starting to test and try some little projects I had in mind for a long time. One of them is control of a feed-pump for a water-tank.
The Tank is filled with a solar-driven 12v pump, and I want to have it run as little as possible and obviously only during daytime hours to save the battery.
I thought best to use the HC-SR04, and found Timb’s sample with the digole display:
- I wanted to use the code to control the level of water, say pump on when reaching a certain level and pump off when reaching ‘full’ level (this will also help me avoid too much cycling of the pump and if I’d leave it always on with a pressure switch, it would waste a large amount of energy when it’s almost full ). I don’t have a display available I simply want to measure the water level and be able to use those values to start and stop the pump.
Then there’s a later add-on, being:
The shower upstairs is fed by another 12v Pump. running off the same battery and panel. Thing is that I don’t want the feed-pump to run when the shower pump is on, as it would be too much a drain on the battery.
So that would mean 2 relays that I hook up, where relay One is normally open (feed-pump not getting 12v) and relay Two (the shower-pump) is normally closed and getting coninuous supply of 12v for on-demand water supply.
So what I see from the code of Timb, I guess I’d take out the Digole display code and then add rules to switch on / off the two relays.
Hope someone can help me with this.
Thanks and regards,