Heating a small pool under Arduino control

IWe have what the locals around here call a ‘bassin’ (pronounced baa-san) which dates from the construction of the house in the 1920s. Originally used to collect rainwater in this dry climate and to then provide a source of irrigation to the garden during dry periods. It is about 3m x 4m in a squashed octagonal shape and about 70cm deep. There is a lump in the middle that gets in the way of everything but contains the feedpipe. The 3D sketch gives a better idea of its shape. Pool The pool contains around 8000 litres of water (roughly 1800 Gallons or 2000 US Gallons) and, as befits an irrigation tank, sits in the shade at the side of the house. Fastforward to a couple of years ago and we need some method of keeping cool – but not too cool! The benefit of a shady spot for the tank are slightly lost on us…

I purchased an above ground filter and this was installed below the waterline and does a good job of removing the junk from the pool. In our first year, I rigged up a spare pump and as much spare hosepipe as I could find and ran it around the patio. This proved surprisingly successful so on the basis that ‘some is good, more must be better’, I added more hosepipe…and more…..and then my wife started to think that the eyesore of hosepipe was starting to outweigh the temperature gained in the pool. So at the end of that season, the pipework was dismantled and returned to normal use. However it did prove capable of adding 1-2°C to the water pumped at a steady 3000 litres per hour – so in general terms, at the middle of the day when the hosepipe was fully exposed, it increased the pool by about 1°C per hour. Not bad…

The following year I investigated the options more fully and purchased a professional heat mat, 0,7M x 6,5m which was draped over the kitchen roof and offered a much longer heating period. However I also had to address the other problem which was that the mat was as capable of dropping the temperature as effectively as increasing it given different weather conditions. A simple timer sufficed to prevent the cooling effect during the evening through to the following morning, however it still meant that I had to manually operate it if the weather was cloudy (yes, we even get clouds in the South of France!). The same pump was used but to get to the 5m or so roof height, I pressed plastic waste pipe and fittings into service. These seem to be happy enough with the pressures that they are presumably not designed for…however it is necessary to take some care when gluing the pipe and connectors together – I use coarse sandpaper to thoroughly clean the plastic of any release agent or surface before adding the glue and swiftly twisting the pipe and connector together. Earlier attempts without this step left weeps, dribbles or just plain leaks.

This lead to a small piece of process control managed by an Arduino – although I am an electronics engineer by profession, I left this area a long time ago and haven’t really kept pace with the changes in technology. One of the magazines I subscribe to (Digital Machinist) for my interest in CNC machinery ran an article where the author described the uses of Arduinos, their ease of use and offered a practical example as well. This took me back to my college days and briefly writing assembler for 6809 and 8080 but apparently the Arduino comes with everything built onto the device pcb.

So I dived in, bought an Arduino and some shields for simplifying the interconnections, downloaded the environment and played with what turned out to be a very easy to use solution.

At this point I started to sketch out what I wanted from a pool controller:

  • measure the temperature in the in and out legs of the heater mat
  • if the temperature delta drops below a threshold, turn the pump off for a set period
  • display what is happening for current and peak temperatures

The code that can be accessed here does that but in detail:

  • power on the pump and wait 90 seconds for the temperature to settle
  • read the temperature sensors a number of times to average the readings
  • note this average over a period of 2 minutes
  • if the average is less than 0.4°C then switch off for 15 mins
  • display the input and output averaged temperatures as well as the current 2 minute average
  • display the daily peak
  • display the time until a restart if it is in the 15 minute off period

The temperature sensors are constructed from a Dallas 18B20 sensor epoxied into a brass tube that was itself epoxied into an inspection cap in the piping. This is connected back to the Arduino with screened twin core where the screen is used as the earth, power on one wire and the signal on the other. The result is fed into the analogue inputs on the Arduino since it has a simple °C/V relationship.

The Arduino drives the pump via a transistor and 5V coil relay which switches both legs of the 220V mains. This also supplies power via a butchered ‘wall-wart’ plug in 5V power supply.

Everything was inserted into a clear plastic food box bought for the purpose with a sealed lid arrangement. The clear lid means that the display can be read without opening anything and the 2 mains leads become the only external connections. One goes to the pump plug (so female/socket) and the other goes to the house mains via a circuit breaker since we are outside and working with a mix of electricity and water! I fed it via a timer switch as well so that the pump didn’t keep cycling throughout the night – with my current knowledge I could have added a Real-Time Clock (RTC) shield and worked using that – but a simple time switch sufficed.


In a word, ‘GOOD’….

I eventually ended up with 2 of the heat mats totalling roughly 9 m2 which was able to increase the pool temperature by around 3°C during the day. Reading around, 1kW per square metre is the maximum realistically possible and some reverse calculations suggest that I was managing around 850-900W/sq metre in the midday sun.

Biggest disadvantage was that the pitched roof meant that the middle of the day was the only period when the entire mat was heated – in the morning only one half saw the sun and the afternoon exposed only the other half – flat surfaces are really a requirement for maximum heat.


We moved house at the end of last year and now own a proper, much larger pool at around 80,000 litres, roughly 10 times the bassin – next task is to work on an efficient method for this one – the existing solution will not add more than about 0.2-0.3°C during the day, hardly worth the effort.

Hope this write-up will help others anyway.