Relay chatter

I feel I should know the answer to this, but I keep going around and around in my head. I have a pump system in my solar greenhouse, controlled by a commercial differential thermostat with sensors in the water storage and air. The system is powered by a 12-V power supply, connected to the mains. (I don't know how smooth the DC output is...). The pumps and fans are powered through a relay, driven by the differential thermostat. My problem is that, at the cross-over temperature, (when the air has cooled to match the water temperature), the relay chatters, sending pulses of current to my brushless pump motors, which seems to cause the motors to get hopelessly confused and burn out prematurely. I figured I could resolve this issue by moving to an Arduino to control the relay, and building in some sort of smoothing or delay to ensure a definitive binary ON-OFF. But here is where I am blocking. It was suggested that I needed to build in a differential between on and off temps. But if the issue is over-sensitivity, ( flipping on and off with very minimal differences between the two sensors), adding a differential will not make any difference, it seems to me. It was suggested to add a condensor across the output to smooth it. I did this, and it made no difference.

This has to be an extremely common problem - things like solar hot water systems are generally controlled by similar differential thermostats. And even single thermostatic controllers have to be protected from reacting to rapid minor changes at the point of transition. How does one do this? Average temperature readings over a short time, before comparing to the set point? Sample at longer intervals, such that temps will have drifted clearly apart, (so sample at a given moment in time, followed by a 5 minute delay before sampling again)?

It was suggested that I needed to build in a differential between on and off temps.

That is called hysteresis. It is a very common method to avoid the problem that you are having (chatter about the turn on-off point). For example, on temperature rise turn the heater off at 100° then as the temperature falls turn on at 95°.

Does the Thermostat not have a "deadband" adjustment? Can you post a link to the thermostat datasheet and/or web page?

Yes, it is called hysteresis, but I am not sure how it will help my problem. Let's say my system is set to turn off at 15 degrees, and it does so with a chatter as the temp reading fluctuates just above and below 15 degrees. If I introduce 1 degree of hysteresis, so that it now doesn't turn off until the temp falls to 14 degrees, but still has the stutter when it reaches 14 degrees, I am confused. (Although you have prompted me to think this through alternatively. Tell me whether I have got it: The system senses that the temp has fallen to 14 degrees, turns off the current to the relay, and when, a fraction of a second later the system decides that the true temp is 14.1 degrees, and tries to turn the power back on, the program responds, "Ugh,ugh; I won't turn back on until the temp has risen to 16 degrees, (set point 15 +/- 1 degree).

Perhaps I need to track down more clearly just where the chatter is coming from: fluctuation of reading just above and below set point; ripple in my DC current from power supply; flakey relay; something entirely else....

Thank you so much for your patience with an old fuddy-duddy.

Hysteresis is always a good thing in applications like this.

You can ‘also’ add a time delay to the control loop.

You may also be having problems with inductive noise being picked up on the input.

Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components.
Posting images:

Use CTRL T to format your code.
Attach your sketch between code tags
[code]Paste your sketch here[/code]

JCA79B:
Does the Thermostat not have a "deadband" adjustment? Can you post a link to the thermostat datasheet and/or web page?

Interestingly the existing unit, which was made by a company in Britain called ReUK, has no hysteresis, (which I infer is what you mean by "deadband"). Nor do they publish their circuit diagram. Nor were they willing to offer me advice on how to fix it, (other than suggesting I purchase their latest, "much improved" model.) This is what lead me to building my own replacement unit, using an Arduino. That way I would have control over aspects like this myself. But then I lost confidence in my own analysis of why I was getting the chatter, and dissolved into a heap of insecurity and over-thinking.