Water Pump Monitor with a PICAXE 08/M

This circuit is designed to stop a fresh water pump from running too long. When you live on the land, your water supply is stored in tanks and you tend to be more vigilant about water use. If, for example,
a pipe ruptures or a tap is left open, loss of pressure in the line will cause the pump to start. If the owner does not know this or is away, then the pump could empty a full tank within a short time.

The project was conceived when a water pipe burst while I was away for the weekend. Luckily, a neighbour noticed the water spout and shut the pump OFF. If the tank had emptied that would have been
bad enough but the cost of a burnt-out pump would have been much worse.

Another use is as a timer for watering the garden. Pick a time and turn ON the tap. This unit will shut OFF the pump and sound an alarm at the end of the selected time. Perhaps you have teenagers that like
to take long showers. Set the time to 10 minutes and watch them complain!

Five different times are available and these can be altered to suit your needs by editing the microcontroller program. To reset the pump after a time out, simply press the reset button for two seconds.


The circuit works by detecting the vibrations from the pump while it is running.

pump

When the pump starts, a timer is started and after the set time has elapsed the pump will be shut OFF and an alarm sounded.

If the pump you have is quite powerful, pressure in the line can build up high enough to stop the pump. If a tap is still open, the pump will start again when the pressure drops. The software takes all
this into consideration and is not fooled by the pump switching ON and OFF. The pump must be OFF for more than 20 seconds for the program to reset the timer and think that the tap has been closed.

A PICAXE-08M Microcontroller runs the whole show. It knows the pump is running because a piezo sensor is physically mounted on the pump. Motor vibrations excite the piezo sensor, generating a small
AC voltage across its terminals. This signal is amplified by op amp (IC2a), which is set for a gain of about 85. From here, the signal is rectified by a diode pump circuit and then compared with the voltage
on the wiper of  (VR1) by op amp (IC2b). When the voltage on pin 5 exceeds that of pin 6, the output of the op amp swings high, turning ON (Q3). This turns ON the LED and pulls pin 3 of the micro (IC1)
to a logic low level via D4.

Next, the micro reads the voltage on pin 6 as selected by (S1). As this pin is an ADC (analog-to-digital converter) input, the voltage read will vary according to the position of the switch.

The result is used by the program to select one of five times from a look-up table stored in memory.

The pump "run" timer now starts and if the signal on pin 3 remains low (pump ON) for longer than the selected time period, the micro drives pin 7 high to switch ON (Q2), sounding the alarm. More importantly,
it also drives pin 5 high, switching ON (Q1) and energising the relay, which in turn opens the normally-closed contacts to disconnect the pump motor.

To reset the pump, just press the reset button ( S2). The pump will now start again because there will be no pressure in the line. Once pressure has built up again the pump will stop, assuming you have turned
OFF the offending tap or fixed the fault with the lines.

The five selectable times are determined by the number stored in the "time" variable. Each unit equals one second. For example, to set a time of 30 minutes, the number 1800 would be used. As it stands, the
program has been set for 90, 45, 30, 20 and 15 minutes.

When mounting the piezo sensor, make sure that it is physically touching the pump. Most pumps have removable end plates. The disc can be inserted between the end plate and the pump body.

Any single-plate piezo transducer can be used for the job. Many piezo transducers come with a plastic surround. Remove the disc by prising it out of the surround before mounting. Oatley Electronics sells discs
that are ideal for this application.    Download the code here:  pump.bas

Copyright © 2008-2015  Ted J. Mieske
All Rights Reserved.