Over-production water heating for PV users under new billing rules.
I would like to present a low-cost project that can be done by anyone who likes electronics and happens to hold a soldering iron in their hand.
The project is designed to switch on the heater when our photovoltaic installation generates a certain power. A control problem often encountered by users of photovoltaic installations - i.e. how to heat water when it is lit.
The system I have presented is very simple to build and cheap, it does not have advanced functions like the systems you can buy for over a thousand zlotys, but I think it will certainly help.
Everything is based on a circuit:
1. ESP8266
PZEM 004-t module, which sees the flow of power with current regardless of the direction, so the final assembly is important to be on a direct wire from the inverter.
3. Free software TASMOTA which we win to the ESP8266 using e.g. NodeMCU Flasher .
The elements I used in the project are:
1. PZEM 004-t measuring module
2. ESP 8266 + board with 5V stabilizer because I just had it, but we can use wemos D1 mini or NodeMCU then we won't need USB TTL programmer but just USB cable from phone to program wemos. For those new to the subject, I would recommend buying a Wems D1 mini, it has everything you need on board for programming and operation once the tasmot is loaded.
3. a button - which will be used to put the ESP into a configuration state.
4. wires to connect the ESP8226 to the input of the PZEM 004-t Module, you can also buy the original cable with plug that fits the PZEM 004-t.
5. the female-to-female wires will also be useful if you purchase the Wemos D1mini.
6. 5V relay module
7. 5V power supply - a phone charger can be used.
8. Tasmota software and NodeMCU Flasher links above.
.
How to connect the module
PZEM to ESP there is a lot of this on the internet, as well as how to upload the Tasmota and its first start-up. I do not want to duplicate these instructions here, they can be found on google.
Borrowed diagram from google:
.
We connect the PZEM module to GPIO 4 and GPIO 5 GPIO 4 TX PZEM to GPIO 5 RX PZEM.
We connect the relay module to the free GPIO.
To GPIO 0 and to GND we connect the button giving GND to GPIO0 6 times puts the module into hot-spot mode while giving GND to GPIO while turning on ESP puts it into flash mode.
After loading the tasmota and the first start-up, having the ESP with the tasmota already in our local network, we move on to the module settings:
.
Such settings we save the module restarts and we have the screen:
.
We can check if our relay is working and if we have voltage on the PZEM
Of course we connect 230V to the PEM according to the diagram above.
I for testing did it like this:
.
The picture shows a 4 channel relay module connected under two GPIOs because I was testing two rules which are designed to switch on individual relays at different powers. That is, for example, the power going through the PZEM, e.g. above 2000W turns on relay 1, the power going above 3000W turns on relay 2.
How much power we set is an individual matter.
Another key setting is the rule by which the whole system works. A rule borrowed from another forum from my colleague isom to whom I thank for his kindness.
Go to the console tab:
We specify the key rule to run.
.
And enabling the rule to make it work:
.
In the first part of the rule:
Energy#Power> 2000 - we specify from above what power the relay should turn on.
In the second part of the rule:
Energy#Power< 2000 - we specify from below what power the transmitter should switch off.
Now checking that everything is working is enough to mount it in the switchgear.
We mount the measuring clamp on the phase conductor going directly from the inverter and take 230V from the same phase to the PZEM.
The PZEM module sees the power and current flow no matter which way it flows, so we have to mount it directly on the wire from the inverter.
The cost of the whole project should not exceed 100zł even if you buy the components on allegro.
I encourage colleagues to discuss and comment on my idea, maybe thanks to colleagues from Smart Home IoT the project will get more functions and will be extended.
I have also made a project on 3 PZEM modules which monitors the energy consumption for the house was mounted directly on the power supply of the distribution blocks for the protection on the house. The inverter has been plugged in front of the blocks that supply the house thanks to this in tasmotoa I can see the energy consumption of the house and the current power flowing from the inverter.
.
The above project has not yet gained a casing is currently a prototype but I think that the casing and implementation will already be an individual matter of each, I wanted to throw in a general idea of making such a control for water heating counting on the ideas of other more experienced users in the software Tasmota and ESP8266.
I would like to present a low-cost project that can be done by anyone who likes electronics and happens to hold a soldering iron in their hand.
The project is designed to switch on the heater when our photovoltaic installation generates a certain power. A control problem often encountered by users of photovoltaic installations - i.e. how to heat water when it is lit.
The system I have presented is very simple to build and cheap, it does not have advanced functions like the systems you can buy for over a thousand zlotys, but I think it will certainly help.
Everything is based on a circuit:
1. ESP8266
PZEM 004-t module, which sees the flow of power with current regardless of the direction, so the final assembly is important to be on a direct wire from the inverter.
3. Free software TASMOTA which we win to the ESP8266 using e.g. NodeMCU Flasher .
The elements I used in the project are:
1. PZEM 004-t measuring module
2. ESP 8266 + board with 5V stabilizer because I just had it, but we can use wemos D1 mini or NodeMCU then we won't need USB TTL programmer but just USB cable from phone to program wemos. For those new to the subject, I would recommend buying a Wems D1 mini, it has everything you need on board for programming and operation once the tasmot is loaded.
3. a button - which will be used to put the ESP into a configuration state.
4. wires to connect the ESP8226 to the input of the PZEM 004-t Module, you can also buy the original cable with plug that fits the PZEM 004-t.
5. the female-to-female wires will also be useful if you purchase the Wemos D1mini.
6. 5V relay module
7. 5V power supply - a phone charger can be used.
8. Tasmota software and NodeMCU Flasher links above.

How to connect the module
PZEM to ESP there is a lot of this on the internet, as well as how to upload the Tasmota and its first start-up. I do not want to duplicate these instructions here, they can be found on google.
Borrowed diagram from google:

We connect the PZEM module to GPIO 4 and GPIO 5 GPIO 4 TX PZEM to GPIO 5 RX PZEM.
We connect the relay module to the free GPIO.
To GPIO 0 and to GND we connect the button giving GND to GPIO0 6 times puts the module into hot-spot mode while giving GND to GPIO while turning on ESP puts it into flash mode.
After loading the tasmota and the first start-up, having the ESP with the tasmota already in our local network, we move on to the module settings:

Such settings we save the module restarts and we have the screen:

We can check if our relay is working and if we have voltage on the PZEM
Of course we connect 230V to the PEM according to the diagram above.
I for testing did it like this:


The picture shows a 4 channel relay module connected under two GPIOs because I was testing two rules which are designed to switch on individual relays at different powers. That is, for example, the power going through the PZEM, e.g. above 2000W turns on relay 1, the power going above 3000W turns on relay 2.
How much power we set is an individual matter.
Another key setting is the rule by which the whole system works. A rule borrowed from another forum from my colleague isom to whom I thank for his kindness.
Go to the console tab:
We specify the key rule to run.
Rule1 on Energy#Power>2000 do Power1 1 ENDON on Energy#Power<2000 do Power1 0 ENDON
And enabling the rule to make it work:
Rule1 on
In the first part of the rule:
Energy#Power> 2000 - we specify from above what power the relay should turn on.
In the second part of the rule:
Energy#Power< 2000 - we specify from below what power the transmitter should switch off.
Now checking that everything is working is enough to mount it in the switchgear.
We mount the measuring clamp on the phase conductor going directly from the inverter and take 230V from the same phase to the PZEM.
The PZEM module sees the power and current flow no matter which way it flows, so we have to mount it directly on the wire from the inverter.
The cost of the whole project should not exceed 100zł even if you buy the components on allegro.
I encourage colleagues to discuss and comment on my idea, maybe thanks to colleagues from Smart Home IoT the project will get more functions and will be extended.
I have also made a project on 3 PZEM modules which monitors the energy consumption for the house was mounted directly on the power supply of the distribution blocks for the protection on the house. The inverter has been plugged in front of the blocks that supply the house thanks to this in tasmotoa I can see the energy consumption of the house and the current power flowing from the inverter.

The above project has not yet gained a casing is currently a prototype but I think that the casing and implementation will already be an individual matter of each, I wanted to throw in a general idea of making such a control for water heating counting on the ideas of other more experienced users in the software Tasmota and ESP8266.
Cool? Ranking DIY