How to Install a DS18B20 Temperature Sensor in a Solar Water Heater
This article explains how the DS18B20 temperature sensor was installed in a solar water heater. More or less, this description presents a method that—with some variations depending on the solar water heater model—can be applied generally.
Where is the sensor installed?
The temperature sensor was placed in the position of the thermostat for the electric resistance of the solar water heater. Of course, someone might argue that they need the thermostat and the heating element to use in case the solar heater has no available hot water. That’s correct, but in my case, I have other options for hot water—first, a wood-fired water heater that provides plenty of hot water when needed, and second, an electric boiler inside my home—so the resistance in the solar heater was entirely unnecessary. Thus, I removed the thermostat and don’t even have electric power connected to the solar heater. The hole left behind is the perfect spot for the temperature sensor because it reaches the center of the tank and not somewhere external.
Which sensor is suitable?
Many temperature sensors are available for hobby use in projects with microcontrollers like the Solar LIVE. However, only one is truly suitable for installation in a water heater—whether solar or electric. The same applies to a wood-fired heater. The thermostat position leaves a gap into which the DS18B20 temperature sensor fits perfectly. Additionally, this sensor has the right characteristics, being capable of measuring up to 120°C with good accuracy. Although not required in this case, it’s worth noting that this sensor can also measure liquids directly.
Can it damage the solar heater?
99% of the time, no, because the sensor can pass through the hole originally intended for the electric cable. In any case, anyone planning to measure the solar heater temperature should know that the resistance cannot function simultaneously, as the thermostat has been removed. If the solar heater does not have such a hole, drilling a 6mm hole in the right spot will not harm the system at all.
Can the sensor be placed elsewhere?
Yes, but not with the same measurement accuracy. I’ve measured the wood-fired heater and electric boiler by wedging the sensor externally against the tank through the thermometer hole. You can still gather very useful data, but they are affected by environmental conditions and may fluctuate significantly.
All water heaters have an external thermometer that works by contact. If we remove this thermometer, we gain access to the tank of the water heater—whatever type it is—except for solar heaters, which were discussed above.

We can wedge the sensor between the tank and the insulation of the heater to take measurements—often very good ones. The issue lies in fluctuation and environmental effects. You can see that the insulation on a wood-fired heater like this one is minimal compared to that of a solar heater. Below is a visual representation of the fluctuation.
A wood-fired water heater can reach higher temperatures than any other heating method—unless the thermostat in an electric heater is malfunctioning. As shown in the graph, with just a few logs, it reached 110 degrees Celsius. This is a dangerous temperature—not for the water heater itself, but for the plumbing.
Water at such high temperatures should never enter your internal piping system, let alone reach this level. That’s why you must install a thermostatic mixing valve at the hot water outlet, before it enters the building. This applies to solar water heaters too, as they can also raise the temperature to dangerous levels.
At the start of the graph, you can see temperature fluctuations caused by the ambient air temperature, as the DS18B20 sensor was initially installed externally. This causes a jagged appearance due to lack of insulation. Since 06/12/2024, the sensor has been placed inside the boiler, just like in the solar heater, so a more stable temperature pattern is expected from now on.
- Improvements in the Placement of the Data Logger - 29 January 2025
- Solar Water Heater Statistics – December 2024 - 10 January 2025
- Washing machines with dual water supply - 24 December 2024