Tag Archives: relay driver

Pool Pump Controller – in Action!

Summer is finally here, and the hard work on the pool pump controller is starting to pay off. It looks like most of the bugs I ran into last year have been ironed out and it is working like a charm. Except when it doesn’t – but it quickly recovers.

In the video below, you can see the setup and a demonstration of its operation. Unfortunately, there is one more bug – when exiting high speed mode, the controller resets, but in 30 seconds it recovers and picks up where it left off. I think it is an EMP burst affecting the controller as it is in the same metal box as the relay.

A second gremlin sometimes affects the display on speed change, but the display refresh code eventually cleans that up.

For those needing a refresher, here is the initial writeup, and here is an update providing more info on the build, including code and schematic.



Pool Pump Controller – Update 2

Spring is here and the summer pool season opening is just a few weeks away. Over the past few weeks I have been working hard to make key improvements to the pool pump controller I mentioned here.  For the uninitiated, a few years ago I upgraded the motor on my pool pump from a 1.5HP single speed motor to a dual speed motor. The high speed setting is great for vacuuming the pool and performing the necessary maintenance tasks, but eats an incredible amount of power – 10A @ 230V. When maintenance tasks are complete, I can set the motor to low speed and keep circulating and filtering the water, but consume only a few amps. Perfect until the heater turns on. The water flow is too low at the low speed and the water starts to boil in a heater. No way I am going to blow up a $2000 heater. Last season I built the automatic controller, which set the pump speed according to the difference in water temperature as it enters and leaves the heater. For the most part it worked great, but it had a few faults:

  • Sometimes the controller would reset when the motor started at high speed, shutting everything down until the controller came back up.
  • If the controller did not reset, then the display would crash and show no data
  • The latest code revision was forgetting to read the thermometers

Updated Pool Controller BoardIn order to resolve the reset and display issues, I added a few large capacitors to the power bus, increasing the power source fluctuation tolerance. Now it should be able to survive a one second full power outage without reset. While I was adding capacitors, I also added a bridge rectifier to the board power input. The bridge protects the board from Mr. Fumblefingers accidentally applying reverse polarity to the board. It also would allow me to use an AC power source, if necessary. Links to the schematics are at the bottom of the post.

Continue reading

Dual Speed Swimming Pool Pump Controller

A couple of years ago, I installed a dual speed motor for the swimming pool pump. It works great and rather than burning 9 amps @ 220V to circulate the pool water, it can run half speed at 2 amps @ 220v. As you can imagine, this saves quite a bit of money and is also much quieter.

Unfortunately, there is a downside. If the pool heater starts heating the water when the pump is running at low speed, the water begins to boil in the heater – not good. The boiling sounds are quite loud, and when I hear them, I can run outside and flip the switch to run the pump at high speed. This is not ideal. I am not always at home or awake… sadly.

To solve the problem, I have been working on a motor control circuit, to measure the water temperature as it enters the pool heater, and as it leaves the pool heater. If the output temperature is 1C higher than the input temperature, the controller activates the high speed winding on the pump motor. When the temperature differential has dropped below 1c, the controller waits about 15 more minutes and then returns the pump speed to low speed (eco).

PoolControllerPrototypeThe controller has two switches, one to force the motor to run at high speed (when you need to clean the pool), and the other to put the system in maintenance mode (stop motor to clean filter, etc.), and a 2×20 LCD display to show the current status. The pic below is an early prototype without the display header.

The brains of the controller is an ATmega328 microcontroller with and Arduino bootloader. This monitors the waterproof temperature probes and switch settings. An MC14555 1of4 switch is used to activate the relays. 2013-05-11_22-51-15_464Theoretically this part is redundant, but since I trust programmers about as far as I can throw them, (I can’t throw myself very far either…) I added this switch to make sure that it is never possible to have both motor windings activated at the same time. The chip will only activate one output pin at a time.

Picture 11I had initially planned for the switching to be done by a pair of Solid State Relays. Benchtop testing successfully powered an incandescent bulb and aff. The testing was done using 110V (!). The controller was mounted in a spare outdoor electrical box left over from the hot tub I used to have. For power I dug out an old Nokia power supply and connected it to one side of the 220V motor circuit and ground(!).

Picture 10 I wired up the controller and the motor, installed the temperature probes for the heater, double checked all my wiring and when satisfied, flipped the master switch. A short blink on the LCD display and then it went dark. After considerable effort rechecking the connections, I went to the basement to check the circuit breaker for the pool. The breaker is a Ground Fault Interrupt (GFI) breaker. If it senses power leaking into ground, it trips. Oops. The power supply is connected to ground, not neutral.

Having resolved the GFI issue, I powered up the system once again. LCD lights up, displays the startup diagnostics, seems happy and reports the motor is now running in eco mode. Exactly as planned… except the motor is quiet! Flip the switch to go to high speed, the display updates correctly, but the motor is quiet. WTF?

I think I spent over a week researching this one online and even resorting to discussing the issue with the guys in a local electrical supply. By all indications everything should work. I ended up bringing a 220V circuit into my lab and started testing. It took a few days of testing and a few blown light bulbs before I found the answer. Unlike European 220V, which is on a single wire, North American 220V requires two live 110V wires and the load is connected between them. Nearly all Solid State Relays (SSR) use a zero crossing circuit to detect when the phase crosses zero and initiates the open or close action when the phase crosses zero and transfer voltages are at their minimum. On a North American 220V circuit, this does not work. The zero crossing detector cannot find the crossing point and never activates the relay. Back to the drawing board.

If SSR is out of the question, then relays are the way to go. I have a 1 horsepower electrical motor, so went online and found a good deal on a bunch of 2HP 250V relays. Perfect.Photo on 1-22-14 at 10.47 PM

Once the relays arrived, I installed everything on a piece of stripboard. Since the outputs from the mc14555 are not powerful enough to drive the relays, I populated the board with two basic 2n2222 based relay drivers and a header for power and inputs for the low and high relays. I replaced the SSR relays with this board and amazingly, everything worked as planned. YAY!

After a few weeks of operation, I started to notice the pump motor making odd sounds. Switching from low speed to high was not smooth, the motor would stutter and sometimes not engage. Other times the motor would start to stutter when it has been running at high speed for a while. More research. Seems these relays are technically rated for 2hp motors, but are not intended for extended duration workload. Photo on 1-23-14 at 10.37 AMA bit of searching in eBay got me a few of the monstrous relays to the right. Two inches per side, but this one will probably keep running long after the pool has been filled in!

For the high speed windings, the I installed the new relay, and kept the smaller relay for the low speed winding. The new relay needed a new relay control circuit. During testing, I noticed an odd side effect. When applying power to the control board, it would momentarily trigger the relays, activating both and sending a momentary surge to both the low speed and high speed windings. Not good. I am using 2n2222 NPN transistors to switch the relays, with the relays being between VCC and the transistor. relaydriverIf I placed the relay between the transistor and ground, it would avoid the surge, but the relay coils would not always trigger, or trigger slowly, causing extended arcing (sparks). Picture 34Eventually, I found the simplest solution is to make a resistor/capacitor based delay circuit. When power is applied, a resistor slowly charges a capacitor and when the voltage exceeds the base threshold, the transistor opens the flow of electrons to the rest of the circuit. Simple, cheap and it gives me a nice 10s delay on power-on. The end result can be seen on the right, built on a small Radio Shack prototyping board.

With the relays now working properly, I ran into another problem. When the high speed winding is activated, the board would occasionally reset. Initially I thought this might be related to the small 500mA power supply I was using, as the current draw when activating the new relay is quite significant. I replaced it with a larger 1A power supply and the reset problems went away – sort of. The LCD display controller still tends to lose its mind when the high speed winding is started. After a few months of pondering, I have come to the conclusion that the problem may be a drop in source voltage on the 220V side when the motor starts. Adding a large 2000 mfd capacitor to the DC power bus will probably solve the problem.

It is winter and -10C (14F) outside today. Still a few months to go until the weather is warm enough to re-open the pool. There are still quite a few things to do with the controller. Aside from the power issue which still needs to be resolved, there are quite a few bugs in the code. In the latest iteration of the code, for some reason it is forgetting to read the thermometers… I would also like to upgrade the board from its protoboard build to a custom designed board. All of the relay changes have also made a mess of the power cable routings in the box. The ribbon cable to the display has failed a couple of times, so that needs to be improved. There is also a problem with the serial interface. I have about a 30% success rate when attempting to reprogram the board with my FTDI adapter.