In this project, we'll walk through how to connect a solar water heating system to a MiniPLC, using two pumps, multiple temperature sensors (RTD and 1-Wire), and relay control. This setup is ideal for automating and optimizing solar thermal energy utilization in home heating systems.
System BackgroundThe solar water heating system was installed some time ago and originally included the following components:
- A solar collector
- An indirect heater reservoir
- A circulation pump
- A controller
- One NTC temperature sensor for the reservoir
- One PT1000 sensor for the solar collector
The system has since been upgraded:
- The old controller was replaced with a MiniPLC
- The existing PT1000 sensor for the collector was connected to the new PLC
- The circulation pump was connected to the PLC relay outputs
- A mixing pump was added and connected to another PLC relay
- The reservoir’s NTC sensor was replaced with a PT100 sensor and connected to the PLC
Four 1-Wire temperature sensors were added:
- Two for the feed and return lines of the solar collector
- Two for the high and low levels of the indirect heating boiler
Firmware and automation logic were developed using **ESPHome**
The MiniPLC was integrated with Home Assistant, enabling real-time monitoring, automation, and control from a centralized dashboard.
Sensor Placement NotesAccurate temperature measurement is critical for efficient and safe solar water heating system operation. Here's how the sensors are placed and their roles:
PT1000 and PT100 Sensors:
Installed in the factory-designated sensor ports of the solar collector and the reservoir, these sensors ensure reliable and direct temperature measurements. Chosen for their stability and robustness, they are used to control the circulation pump, which is essential to prevent overheating of the solar collector.
1-Wire Sensors (DS18B20):
These sensors are placed under the insulation on the feed and return water pipes, and at the high and low levels of the reservoir. Due to indirect contact with the water, their readings may slightly deviate from actual water temperatures. While not as stable as RTDs, these sensors are suitable for non-critical functions such as monitoring and mixing pump control.
Wiring the Sensors to MiniPLCFollow the RTD wiring guidelines in the [MiniPLC user manual]. Use analog input terminals for RTD sensors.
PT1000 (2-wire connectiong):
- Connect one lead to the RTD/2 terminal 2
- Connect the other lead to the RTD/2 terminal 3
PT100 (2-wire):
Similar wiring as PT1000
- Connect one lead to the RTD/1 terminal 2
- Connect the other lead to the RTD/1 terminal 3
The MiniPLC factory jumper settings are configured for 2-wire RTD connections: RTD/1 terminals are set for PT100, and RTD/2 terminals for PT1000.
Connecting 1-Wire Temperature Sensors (DS18B20):
These sensors require:
- 3 connections: GND, VCC (3.3V or 5V), and Data. In our case, we use 5V, Data, and GND.
- Normally, a 4.7k ohm pull-up resistor between VCC and Data is required, but in this case, it is not needed because the MiniPLC includes a built-in 10k ohm pull-up resistor between VCC and Data is required.
Two sensors were connected to the 1-WIRE/1 bus, and the other two sensors were connected to the 1-WIRE/2 bus on the MiniPLC. Assign unique ROM codes to identify each sensor.
Use relay outputs of the MiniPLC to control the two pumps:
Mixing Pump Relay Output
- The neutral wire goes directly to the pump.
- The phase (live) wire from the common circuit breaker connects to the COM terminal of the relay.
- The NC (normally closed) contact of the relay connects to the pump's live input.
Circulation Pump Relay Output
Wired the same way as the mixing pump.
The use of the NC (normally closed) contacts ensures that if the PLC fails or loses power, the pumps will automatically start, providing a fail-safe mechanism for continuous operation.
Since the MiniPLC is powered from 230V AC, a single common circuit breaker is used both for powering the PLC and supplying the pumps. This ensures centralized protection and simplifies the installation.
Ensure proper AC isolation and safety procedures when wiring high voltage devices.
Program the MiniPLC using a YAML configuration file in ESPHome:
Circulation Pump Logic:
- Monitor the PT1000 sensor (solar collector) and compare it with the PT100 sensor (reservoir).
- If the temperature difference (delta) is greater than 10°C, start the circulation pump.
- If the delta drops below 3°C, stop the circulation pump.
Mixing Pump Logic:
- Use the two 1-Wire sensors for the high and low levels in the reservoir.
- If the temperature difference between these sensors exceeds 5°C, start the mixing pump.
- If the delta drops below 3°C, stop the mixing pump.
All logic and automation were implemented in ESPHome using YAML, allowing for easy updates and integration. This configuration is then exposed and controlled through Home Assistant for seamless monitoring and control.
The full ESPHome YAML configuration used in this project is attached below to help you replicate or adapt the control logic for your own setup
ConclusionWith this configuration, your MiniPLC-based solar water heating system can smartly control pump operations, monitor system temperatures, and maintain efficient heat transfer. This setup reduces energy costs and ensures maximum use of solar energy. Integration with ESPHome and Home Assistant provides a robust platform for intelligent automation and user-friendly control.
Comments