I live full time on a caravan and want to automate our water pump and tanks so they fill during catching of rain water and also to switch from one tank to other.
Hey @Brian225828 - welcome to the forums.
Sounds like a worthy project! Can you be more specific? Diagrams can reveal a lot, and a more detailed description of the desired behaviour will help.
I don’t have a diagram as of yet but will try and explain the best i can as to what i would like to do. On our van we have 2 x 95 litre water tanks. As we spend most of our time of grid water is a premium. I have set up a way to capture rain water from our awning into water containers but i then have to handle the containers around to the other side of the van to fill the tanks.
My thoughts are to have a designated 50 litre tank mounted under the van that i can connect the rain water hose to. On this tank i would need a level sensors fitted to monitor the level. Once the level of this tank reached a desired level it would send a code to the Raspberry pi to check the main water tanks of their level and if they were under a designated level the Raspberry pi would send a message to turn on a pump, connected to the 50 litre tank, and start transferring water to the designated tank sensored above. All 3 tanks would need to have accurate water level sensors on them to read tank levels to enable the Raspberry pi to determine the output.
There is a bit more to this but i think it will give you a basic understanding of what I’m trying to accomplish.
Are the two 95L tanks on the same level. If not you could direct the over flow from the higher tank into the lower one then you would only have to pump water into the higher tank to fill both. Might make life a bit simpler.
That description helps a lot @Brian225828
Forgive me if it seems presumptuous but using a Raspberry Pi might overcomplicate things in the following ways:
- Power draw. the RPi will draw 2.5-5W continuously. Not a big deal compared to other motorhome power sinks, but still something to consider
- System complexity. This pretty important system will rely upon a RPi that has to keep working reliably and continuously.
Perhaps a lower-power solution like a Raspberry Pi Pico or ESP32 will be simpler overall and more sustainable?
Bonus - no microcontroller required
Something that comes to mind is a
water_available switch that detects if water is present in the bottom tank. A
demand switch detects if the top tanks are below a certain threshold. These switches could be wired in series to trigger the pump.
This could be done completely without code, but a code representation of the functionality might read like this:
if demand and water_available: run_pump()
float switches can be configured to close when the level is either above or below the switch.
- the tanks are assumed to be balanced
- the circuit prescribes the behaviour, and adding hysteresis increases wiring complexity.
The float switches configured like this would be OK and would work without a micro.
2 things come to mind.
- I would not pass the pump motor current through the float switches as they might be a bit light, I would use them to switch another heavier contractor or relay.
- To prevent “hunting” a second float should be in the rain water tank and all to be configured as follows:
a) Rainwater enters tank and level rises.
b) Bottom switch makes thus enabling system.
c) Water rises to level of upper float switch. Switch latches probably by using an external relay (to switch pump on ??) which remains latched and pump on until one of 2 things happens. 1) The water level in the rainwater tank falls to release the lower switch and unlatch the relay or 2) The main tank fills and the float switch opens and releases the relay.
This is dependant on the two 95L tank being connected and fill together or one tank is lower and being filled via the upper tank overflow, in this case the float switch should be in the lower tank.
If the tanks are plastic or some non metallic material I believe there are other sensors around which are non invasive for detecting water level.
This all could be done with some proper switch and relay wiring without electronic micros like Arduino or RPi etc. Don’t even need a dedicated latching relay. Just a DPDT type capable of handling the pump motor current.
The tanks are plastic and all 3 would be in a relatively flat plane under the caravan floor. Each of the 95 litre tanks would need to be monitored and filled as per the water levels set and as required as i don’t think i would be able to cross feed from one tank to the othet. The pump being used is 12v, 3 lpm and draws, i think, about 2 amps. As the tanks are standard ported for breather, fill, outlet and drain putting floats may not be the answer as these would need to be fitted prior to the tanks being installed under the van and as the side and end vfc walls are not always flat may cause other issues. Any non contack levels, with a degree of accuracy, i think, would be a better option as they can be retrofitted after the tanks are fitted. I have seen a setup where they had 4, i think from memory, non contact level sensors and had this controlled through a Rpi.
Not too concerned about power draw as the power system we are putting in the van will handle this with no issues. I think float switches would not be feasible to use as it is not easy to retrofit in the tanks under the van. Do you have a good quality water dust resistant non-contact switch that could be mounted on the tanks? Have seen this on a van already with an automated system but don’t have any details as to what was used except a Raspberry pi as the control system coded to detect as discribed.
If you are drawing water from both tanks at once they must be connected somehow so filling one would be filling both.
If however you are manually switching when one runs out or low that is another ball game. That means you would have to monitor individually and have the filling system switch over also. Getting complicated. One fill for both tanks would be easier but that would mean drawing water from both tanks at once also.
If your 95L tanks are both separated you could run the rainwater fill feed and split this at the tanks, one feed to each tank via solenoid controlled valves operated by the level switches. Whichever tank requires water will open its valve. If both tanks require water both tanks will get some as both valves will be open. No matter, all you will be doing is fill both tanks at once. When one is full that valve will close and when both filled the other valve closes and pump shuts down. Simplest way I can think of.
Both tanks are seperated and can be individually drawn or both at the same time. There are manual valves inline to enable this. I normally only draw ftom one tank at a time to ensure we don’t run out of water unexpectedly and to safe gard if something should happen, e.g. pipe bursts, so i don’t drain both tanks. What you have suggest is what i am looking for, to be able to fill each tank as needed based on water levels. Could this be achieved by using level sensors instead of float valves, as fitting the valves may not be as easy as it sounds and non contact level sensors would be?
Give me a day or so and I will come up with a base circuit that does not need a Microcontroller.
Thanks, that sounds greate waot for your reply.
As promised here is a circuit for your pump automation without a Micro.
Circuit. This is a base circuit demonstrating the method involved. The detail re sensors will have to be integrated
How it works
Firstly the relay must be able to carry the pump current as a minimum and be a DPDT type. OMRON L2Y or similar will do.I have not checked what Core have available. DO NOT consider solid state as they are mostly for AC loads and for this application we must have mechanical contacts or it gets messy.
The 4 switches shown can be the sensor switches or small relays driven by the sensors. I think there is some opto coupled quad relay driver boards around but that is somewhat dependant on the sensors chosen.
Sensors. I had a quick look and Core have a couple of non invasive devices. One in particular operates from 5V to 12V which would be convenient but as is normal these days with a quick look at product Wiki etc I found nine tenths of stuff all useful information about the actual sensor. Apparently if you connect it to another thing you get a high or low with presence or not of water. Really need to know the sink and source capabilities of the sensor itself and the thing it plugs into.
I advise 2 sensors in the rain water tank to provide plenty of hyateresis and prevent the pump rapidly turning on and off.
The whole set up is arranged so that nothing can happen if (a) there is no water in the rain tank and (b) both 95L tanks are full.
All switches are shown in the non active state
All switches activate in the presence of water.
Assuming one or both tanks require a top up one or both tank switches will be closed providing a path to ground for the other 2 switches.
Nothing can happen until the rain tank gets enough water to activate S1. When the rain tank gets enough water in it to be worth pumping S2 will activate. The circuit is complete to ground and the main supply relay activates, switching on the pump.
A set of contacts in the supply relay is connected across S2 and effectively “latches” this relay until the rain tank empties or both 95L tanks fill. It will then release and if the 95L tanks have not been filled will wait until the rain tank once again has sufficient water then the whole process repeats.
Pretty simple and not a micro in sight to fail at the least opportune moment.
The motor can be wired as shown with “low side” switching or one side grounded and the contacts used to supply power, “high side” switching. Does not make any difference so whichever is convenient.
Let me know what you think. I think the next step is the sensors and what is actually used for S1, 2, 3, 4.
This looks simple and effective. I like the fact there is no micro to use or fail.
Appreciate you time and efforts and how quick you have come up with a solution.
As you mentioned the next step would be to work out what sensors and what to use for S1, 2, 3 and 4.
Just something else i tought of is if all 3 tanks are full i need to be able to divert the rain water from continuing to flow onto the rain tank and dump. I was thinking of a 3 way valve that is in the open position during filling and whenall 3 tanks are full it opens and dumps to the ground. Not sure if this would work but just something i need to consider.
Fairly easy. You have already said the tanks overflow to the ground.
Draw a couple of extra wires on that circuit.
Connect NO of S3 to NC of S4 and NO of S4 to NC of S3.
Scenario, Both tanks are filling. Tank 2 fills first, S4 operates and inlet valve closes. Connection made between S4 No and C providing another ground keeping tank 1 inlet open. As the pump relay is latched the pump will continue until the rain tank empties then the whole thing will stop. Tank 1 overflows to the ground. If tank 1 fills first just reverse this description.
If water is removed from tank 2 while all this is happening tank 2 inlet will open again and filling will continue until the rain tank empties or one of the 95L tanks fills again.
I have been looking at sensor SEN0368 and by searching on the numbers printed on this product I think I have discovered a data sheet on the actual sensor. Will let you know. This is the 5 - 12V one but it may be safer and easier in the long run to operate this part on 5V as I think the Quad relay boards have 5V relays fitted. Just a pity this info is not easier to find. If Core have published the wrong picture I think I will give up.
Thanks and sounds great. I will look at the wiring you have sent and reconfigure to suit what you suggest. Hopefully the sensors will be the right ones to use.
Again, thanks for your time and effort on this forme it is really appreciated.
Found a lot more info. The sensor above will source / sink 100mA so plenty of headroom to drive opto coupled relays. Will look into that.
I have had a look at what Core has available in the way of relays and I would use a couple of Pololu dual relay boards. They have a quad board which is opto coupled but I think in your case the Pololu unit would be simpler. The Poll units also use Omron relays which to me are a tried and proven product which I have used for many years.
Wire everything up as per the circuit using the caravan 12V but I have indicated 5V in the attached circuit showing sensor and relay board connections as the quality and actual voltage in the van are unknown I am suggesting a step down converter to 5V to try and make sure of the quality of this supply. The components in the main circuit (relay, solenoids etc) are robust enough to withstand a bit of over voltage should this occur as with a freshly charged battery. Also I could not find a figure for the maximum allowable voltage for the sensor.
The suggested connection circuit for sensor and relay board. One relay shown, there are 2 on each board.
The sensor is SEN0368, 4 required and the relay boards POLOLU-2485, 2 required.
The 1k resistor I feel is an omission on this board and IS required. The Mosfet gate is a short to ground for a very short time at switch on and this resistor limits the current from the sensor to a safe 5mA
The switches shown in the main circuit now become the NC, Com, NO relay contacts which should be pretty obvious.
The pic at the top is a view of the relay board without relays and connections marked. The connections seem to be marked on the PCB anyway.
About all you can do from here is get a sensor and relay board and try it . I think all should work. About all I can think of without using some sort of Micro which for your application I would avoid.
Let us know of your progress.
IMPORTANT CORRECTION:::: The sensor is SEN0368