Tankless Water Heater temperature limiter

Control to limit the temperature of a tankless WH to prevent triggering the limit switch

Sep 23, 2020

3403 views

0 respects

Components and supplies

1

Arduino Leonardo

1

Wire, Hook Up

Apps and platforms

1

Arduino IDE

Project description

Code

Temperature limiter

c_cpp

It has the code for a lcd shield, you can remove that if you don’t use it. VtoC converts the voltage from the ADC to a temperature reading. I used the lcd on the Arduino to display the voltage and filmed the values with the temperature displayed by the heater. This is for T2, the output thermistor. Then I curve fitted the data into the function you see here. A fourth degree polynomial was enough for the temperature range I needed. The units should matter and you can use Rankine, Kelvin or Fahrenheit as yours, just adjust the constants throughout the program. You probably want to insure that the temperature is more accurate around the range it activates (max_temp to about max_temp -15°C Since the heater is supplied by solar panels, the input temperature ranged from cold to about 60°C. You can try to adjust the temperature of T1 (first few lines of the loop function) to match T1 better. However, if you can’t (because it doesn’t change much), you can remove T1 from the program. It basically is a feature for efficiency and safety. It prevents the heater from turning on when the input temperature is high. To improve measurements and reduce reading artifacts, the code averages the last half second voltages using a stack (the PushPop class template). Allows to only have the data from the last window long number of points (you can change the size using the window constant) The heater control is done by sending a pulse to the flow sensor input. The Arduino configures a PWM oscillator to send a signal. The pwm… functions set this up. A frequency of 22 Hz was chosen to insure the heater wouldn’t shut-off thinking there wasn’t enough flow. The Arduino starts or stops the signal to control the heater. There is a delay of 5s to give the time for the water from solar panels time to reach the water heater. If you don’t like this, you can remove it. It also gives time to check that the flow sensor didn’t glitch and send a spurious pulse. The Arduino won’t wake up if it doesn’t detect a flow of water. Either mine is defective or the water pipe caused it to pulse. The program tries to predict the trend of the temperature doing a curve fit on the data from the stack. It does this trying to get ahead of the heater’s time constant to prevent it from either overheating or get ahead of the time it takes to turn on. Not perfect, and you can still feel the heater turning on and off by the range of temperature in the water. You might want to adjust the heater’s temperature control to be good enough for most cases (mine is at 51°C) at full flow. With low flow the temperature can reach 60–70°C (depending on how fast the temperature changes, or how restricted is the flow). So don’t try to set the temperature on the heater too high, or it will be turning on and off too often. The sleepy code puts the Arduino into sleep mode, to save energy

Downloadable files

screen_shot_2020-09-22_at_19_57_28_6RQEY5fJHH.png

The output (led) should be pin 13 (not 3). Also you don't need the resistors, since the heater already has those in it's controller

screen_shot_2020-09-22_at_19_57_28_6RQEY5fJHH.png

screen_shot_2020-09-22_at_19_57_28_6RQEY5fJHH.png

The output (led) should be pin 13 (not 3). Also you don't need the resistors, since the heater already has those in it's controller

screen_shot_2020-09-22_at_19_57_28_6RQEY5fJHH.png

Comments

Only logged in users can leave comments

ugokanain

0 Followers

0 Projects

Table of contents

Intro

0

0