Water Heater control

(Murray Risdon) #1

I would like to control my water heater element with a power controller. The controller requires 0-5V DC to control the element output.
At present I use Node Red to control two relay units to provide 500W to 1500W when there is enough solar.
I was hoping to use a Click analog output module (ADAC Click) atop my raspberry Pi but am struggling to work out how to control the output module.
Should I use I2c or GPIO?
Information provided is here:

(Dave) #2

Out of curiosity what is the controller you are using ? . Looking at the data sheet for the AD5593R the chip used in the ADAC, I2c would be your best bet as the chip looks like a straight forward DAC/ADC - I’m not a expert on the PI and I2c.


(Robert Wall) #3

You could also look at the energy diverter by Robin (@calypso_rae) documented in ‘Learn’. The basic logic would require very little change to output a 0 - 5 V signal (using a 5 V Arduino of course, not a Pi), which would feed your power controller directly.

(dBC) #4

You’d still need a DAC though, right?

(Robert Wall) #5

Not if the PWM output is used, but a rudimentary low pass filter will probably be necessary.

(Murray Risdon) #6

Hi Dave,
When I get home I will reply about the Power controller. Where would I look for good I2c documentation?

(Robin Emley) #7

Hi Robert,

Thanks for this heads up. My Mk1 approach had the Arduino generating a DC control signal which (via a voltage doubler ) went to a proprietary controller. The main improvements for the Mk2 are its ability to use an inexpensive output stage and its rapid response time.

(Dave) #8

Sorry I haven’t checked this thread in a while, a link for the AD5593R can be found here

For I2C in general the Node-Red group is very good!forum/node-red scrub that it’s moved to


(Murray Risdon) #9

I have a 16A Eurotherm Efit controller to control the energy consumed by the Hot Water Element. Slowly getting my head around the AD5593R and communicating using Node-Red. Thank you for your help.

(Murray Risdon) #10

Updating this project
I have put the ADAC Click board in the drawer and purchased a DAQC plate from Pi Plates.
Using node-red-contrib-pi-plates I now control the Efit controller using node-red-node-pidcontrol .
This allows me to use the available solar energy on heating my hot water cylinder.
I have an issue in that the PID control still operates when I send no signal to it. This causes the output of the PID control to lower during the night time period as it attempts to correct the error. When the solar arrives the PID output must increase to start to operate the controller again. Have not had much luck with any of the PID controllers on Node-Red. Can someone help?

(Robert Wall) #11

That’s what you had, now you have a PID controller. It sounds to me as if you have the PID set up wrongly - presumably the output is the proportional input to the power controller, it should have two inputs, a setpoint and a measured value. Where are those inputs derived from?

(Murray Risdon) #12

Hi Robert,
I monitor the consumption by the home via mqtt and the emonpi. When the consumption is negative I am exporting the power back into the grid. I invert this value so to provide a positive input into the PID Node. E.G 0-2500 Watts of generation. Lets call this “spare capacity”.
The setpoint (200) is set in the PID node.
This provides a buffer between the solar generated and the consumption (200 watts).
When the solar lowers the PID lowers the energy supplied to the water heater to keep to the setpoint of 200W.
This works until the spare capacity input goes negative (Actual consumption positive)
At this point the PID tries to provide a negative value to lift the actual to the setpoint. As time goes by the output grows.
This causes a delay relative to the output growth before the PID output starts to turn on the Power controller. This could be 2 hours after an evening of darkness.
To correct the issue I just need to restart Node-Red by a redeploy.

How do I make contact with the creator of the PID Node so I can ask for assistance?
Or maybe I have the control system set up incorrectly. Whenever I try to use another PID node I struggle to get control.
I have a screen capture of the flow. How do I attach it?

(Robert Wall) #13

You attach by dragging and dropping, or click the “up arrow” icon above the box you’re typing in, and find the file. But while I know about real PID in the real world, I know nothing of Nodered, so there’s no point.:frowning_face:

I can’t quite see why you actually need the I & D terms. The I term will be the one causing the trouble - it’s there to provide long-term stability of the measured value, but I can’t see the value of that - once the energy has gone through your meter, it’s gone. And the D term is there to give it a kick in the right direction when there’s a step change. But likewise, I can’t see the usefulness of that. So can you set the coefficients for those down to zero?

Or do you throw away the PID controller, and do straight proportional control? (Which should be the same as setting the D & I components to zero anyway.)

Or can you clamp both the setpoint and the spare capacity input to zero (or 200) when you are not generating? If the maths in the PID controller is correct, that should freeze the output - but if it happens to be non-zero when the inputs are clamped, you’ll need to clamp that to zero too in order to turn the heater off.