DIY Arduino consumption regulator build to use excess solar power for auxiliary 'summer' heating. The solar power data are retrieved over SunSpec Modbus TCP. IoT monitoring with Blynk and local Web server.
DIY Arduino consumption regulator build to use surplus solar power for auxiliary 'summer' heating. The solar power data are retrieved over SunSpec Modbus TCP. IoT monitoring with Blynk.
I have in the basement a small wellness room with a hot tub. The room has a floor heating and in the Winter there is pleasantly warm. But in Summer the floor was uncomfortable cold. After I bought a Fronius Symo Hybrid PV system in 2016, I discovered that I could use the surplus solar power in Summer to heat with a small 2kW electric heater the water of the floor heating of that room.
For the PWM regulation of "PWM to 'phase cutting' adapter box" I discovered Arduino. I am a professional software developer so the programming is the easy and fun part. And building the box was fun too. And it is still work in progress with improvements, additional functions and control. In Jun 2019 I replaced the PWM-to-phase-cutting module with Triac Dimmer module with the Triac directly controlled by the Arduino.
To regulate the water heater using surplus solar power Fronius has Ohmpilot, but it can't do the additional control which my regulator does, like commanding valves or turning off some other deferrable consumption.
I don't think someone could take this project and use it without changes, but the concept and many parts of the project can help to build a similar system. The source code is modular with multiple ino files. They are all like add-ons to the main Regulator.ino which handles only the core parts of the system. Most of the additional ino files can be simply removed, because they are special for my system or add only additional optional control and/or monitoring. I decided to go the multiple ino code separation way with almost no encapsulation of partial functionality. I could encapsulate functionality into classes with declarations in h files, but it would be only more work for me and harder to understand and reuse for a hobby coder.
Copy the folder Regulator
from this GitHub repository into your sketch folder of Arduino IDE and the TriacLib folder goes into your libraries folder.
these are available in the git history:
The data subfolder contains static web pages of the regulator. The static web pages use data in json format requested from the WebServer implemented in WebServer.ino.
With Uno WiFi I had the static pages served by the esp8266 WebServer of WiFi Link firmware in the esp8266 on-board of the Uno WiFi. I added them to the SPIFFS data
folder of WiFi Link firmware.
WebServer.ino can serve the pages from SD card or SPIFFS.
These static web pages can be started from a folder on a computer to show the data from Regulator. Only set the IP address of Arduino in script.js.
The complete project doesn't fit into the Uno flash memory. To run it, comment out less important functions in setup and loop and the builder leaves the code out.
2017/4 First board used in this project was Uno WiFi.
2018/5 Next board was Wemos D1 R2 esp8266.
2018/8 I wanted Ethernet and 32 bit MCU. I moved to Crowduino MO -SD with Ethernet Shield
2019/1 ENC28J60 Ethernet module
2019/5 secondary Fronius Smart Meter measures the heater for Fronius Solarweb
2019/6 I replaced the Kemo modules with the AC 'dimmer' module
2019/9 AVR ATmega1284p board and Ethernet Shield with W5500 (Seeed version with low profile RJ-45 connector)
2019/10 Grove Electricity Sensor CT replaced with ACS712 and Grove I2C ADC removed
2020/05 I bought Blynk points and updated the Blynk dashboard and I added charts
2020/10 I removed the temperature sensor which measured the main heating temperature for 'valves back' function. The temperature is now retrieved over network from the EMS-ESP Arduino, which adds IoT monitoring to my Buderus boiler.
2020/10 I removed code for esp8266 and nRF51 and code for power control over PWM with Kemo modules
2020/-- GitHub user stealth-ultd built his version of Regulator.
2021/02 I added extra relay for circ. pump to solve EMI from the pump motor at main relay switching
2021/03 ExtHeater.ino for more surplus consumption
2022/04 Removed separate circulation pump relay. It didn't solve EMI, which caused resets. 'Main' relay now controls only pump and valves so Triac module's ZC detector can detect zero crossing to time switching of the 'main' relay. The 2A Grove SSR module can now be the 'main' relay. EMI is solved.
2022/07 Networking with Grove UART WiFi (esp8266) on Serial with my WiFiEspAT library and ESP_ATMod sketch as firmware.
2022/08 Arduino Nano 33 IoT experiment.
2022/09 MKR Connector Carrier experiment with MKR1000 with WiFi101 library.
2023
I have no more surplus electricity because I can get back up to 2 MW of electricity fed to the network. They call it 'virtual battery'. It will likely cause downsizing of this project.
Blynk legacy ended so I migrate to Blynk IO, but because of the expected downsizing I stay limited to the Free Plan for now.
I removed ExtHeater.ino, BattSett.ino, SusCalib.ino, Balboa.ino