The filtration pump of a swimming pool does not support running on empty (that is to say without water). It's the same for a water pump. To solve this problem several solutions exist:

• An automatic water level device of the pool is responsible for ensuring that the level of water in the pool is always sufficient.

• A device monitors the level of water in the pool and prohibits the use of the pump when this level is insufficient and the pump may run empty

• A device monitors the phase shift (see fig 1,2 & 3) between the current and the voltage supplying the pump. When this phase shift is too large, it means that the pump is running empty. It must then be powered off.

The third solution can only work with asynchronous motor pumps (most pool pumps and pumping) and it is this solution that I use in this project. It is more reliable to monitor the phase shift rather than the current value. This solution has the following advantages:

• No water level sensor

• The phase shift threshold corresponding to a no-load operation is relatively independent of the pump used. This is not the case of the current.

• The pool is only filled when it is deemed useful. If thunderstorms are expected in the 24H it is often useless to waste water ...

• It is easy to associate a programmer with times and filtering periods since the device plans to use a relay to control the pump.

My project is therefore the following (fig 5 & 6) :

Pilot a relay to turn a pump on and off. Use an ACS712 current sensor to detect the current i over the duration of a network period (20ms in France since the network at 50Hz). The sampling frequency of an Arduino Nano (5V 16Mhz) is perfectly suited to this project. So to raise the network voltage u it seemed logical to use the secondary of a transformer that will take care of the power of the Arduino. I use a recovery transformer with output at mid point: 230V / 50Hz 2x8V 3VA.

In order to manage the useful periods of filtering it seemed useful to me to associate with the Arduino a RTC DS1307 and a temperature sensor DS18B20. Indeed, the daily filtering periods required depend closely on the water temperature.

Simply put, the temperature sensor will be mounted with conductive thermal paste on the outside of a pipe, making sure to thermally insulate everything from the ambient air.

To visualize the information raised by the Arduino, I could use a small graphic display type OLED I2C SSD1306. I validated the project with a display of this type. But it seemed more judicious to use a Bluetooth module HC-05 thereafter. So I developed an Android application (with App Inventor) that allows me via the HC-05 module connected to the Arduino to drive my pump and receive the information that interests me such as the water temperature, the current in the pump and of course the phase shift. The use of the Android application is optional. See figs 7 to 11.

Finally, a simple push button and two LEDs on the case of the device allow me to turn on and off the Bluetooth module and control the pump in manual mode. After 10 minutes of inactivity the Arduino turns off the Bluetooth module. After one hour in manual operation, the Arduino returns to automatic mode.

To measure the phase shift, I proceed as follows: from 128 acquisitions of u and i (via A1 and A0) (in synchronism) over 40ms (2 network periods). Then I look in the series of u for the moment when u goes from a negative value to a positive value. From this moment I look for the first passage of i from a negative value to a positive value. The two moments I just described are separated from X acquisitions. As two successive acquisitions are separated by 20/64 = 0.322ms, the phase shift will be F = X * 0.322 * 360 / 20. Let F = 5.63 * X

Each series of acquisitions begins when u goes from a negative value to a positive value.

In the past, I had some problems with relays that were aging badly. Indeed, a relay that closes...

Read more »