One small ventilation
There is a small ventilation system that we were once commissioned to launch, and today I use it as an online thermometer . How did it happen? That was the first automation cabinet, adopted immediately after agreeing to work.
Then a ventilation unit with a plate recuperator and electric heaters, with several dampers on the branches of the duct. There was no clear technical task, the company was just starting its way, we acted on sensations.

The cabinet was assembled from: Aries of PLK160, touchpad SP270, ПЧВ203, all kinds of electrical junk. To measure the temperature, they took Aries resistance thermometers and a couple of analog input modules.
The heaters are controlled by a PD controller (as I imagine it) and a PWM switch with a half minute period for switching starters (contactors) with enumeration of steps. The heater in front of the recuperator is set to a fixed temperature of 3 ° C - this value is selected after the "experiments" with frostbite of the exhaust duct and floods, so drainage and a drainage kit emerged. The heater after the recuperator warms up to the required temperature.
In general, in imported specialized controllers there is a lower limit for street temperature when ventilation stops. However, such luxury is not permissible for us, even if we have –35 °.
The fans are set voltage frequency: 0, 35 or 50 Hz. Initially, the fans were regulated by the number of open dampers on the branches, but after some time the drives stopped responding - Chinese motors without a casing rusted - it’s ridiculous, but during the transition period someone walks and inserts / pulls plates across / from the duct . Then for the fans it was possible to enter any frequency value from the range, but it turned out to be “too complicated” - no one bothered, they set the minimum or maximum value. In addition, the power of the heaters depended on the speed of the fans, but then it quickly came to the realization that the regulator works well without adjustments.
Yes, there is someone who, according to the state of the air and the number of visitors, switches the speed with “buttons” on the touch panel.
The first version of the user interface on the touch panel (SP270) terrified me, but the buttons and indicators in the frames continued to fold on the screen, and the miniatures of the “snails” rotated with their blades. A quick examination of examples of constructing mnemonic diagrams showed graphical imitation of real objects is a generally recognized practice. Then came a preventive day, and a new interface.

Then a flat design was already trampling its sphere with might and main, and the picture on the cabinet was a little drawn to the trend.
Years passed (3 pcs.), From the experience of automation within the team the idea arose about an SCADA-based ventilation system, but I (as not very professional, or how not very professional) did it my own way. It should be noted that no wishes for remote control were received from the owner of the building - this was how my samopal was justified.
From some unrealized project (sound announcement), only one Raspberry-Pi remained. Well, node-js got up there, because immediately with one script it was possible to describe the exchange with the PLC and the web view. Naturally, accessing the Internet was an obvious and integral task.

Between single-board and PLC, the exchange takes place via modbus-tcp. It turned out to be very easy to raise a connection. The first library was from the search engine github.com/dresende/node-modbus-tcp , and after a few hours the fans were controlled from a browser.
A single-subscriber connects to the site like the client does - with a web socket - I really did not understand how it happened. The data itself is formed into json strings and converted directly on the page. At first the web page was filled with elements of standard forms, but it strongly resembled that horror on the touch panel, only from a different sphere. For some time I fought for beauty, but very quickly got tired.

Now you need to rotate the virtual “twists” inside the disclosed items.
Client authorization for management is now done very simply, by matching one line, and the entire exchange between the client and the PLC goes through the site-router-router-single-circuit chain. Although before that the scripts on the page provided for switching the web socket to single-board, where gray dynamic addresses for two subnets were determined by the single-board procedure, and authorization was allowed only to clients from the internal network.
There are many more details for improvement in this ventilation system, and in the near future three more supply and exhaust systems with an undetermined number of micro-extractors are to be added. I suppose that we will also combine them inside the building’s network via ethernet to a computer with some normal scada program.
Then a ventilation unit with a plate recuperator and electric heaters, with several dampers on the branches of the duct. There was no clear technical task, the company was just starting its way, we acted on sensations.

The cabinet was assembled from: Aries of PLK160, touchpad SP270, ПЧВ203, all kinds of electrical junk. To measure the temperature, they took Aries resistance thermometers and a couple of analog input modules.
The heaters are controlled by a PD controller (as I imagine it) and a PWM switch with a half minute period for switching starters (contactors) with enumeration of steps. The heater in front of the recuperator is set to a fixed temperature of 3 ° C - this value is selected after the "experiments" with frostbite of the exhaust duct and floods, so drainage and a drainage kit emerged. The heater after the recuperator warms up to the required temperature.
In general, in imported specialized controllers there is a lower limit for street temperature when ventilation stops. However, such luxury is not permissible for us, even if we have –35 °.
Counting other people's money is not good, but interesting
In winter, heaters operate at approximately 40 kW out of 120 possible, two 7.5 kW fans averaged to 5 kW due to gear changes, the working day is 15 hours. It is estimated that 50 * 15 = 750 kWh per day. At 2.75 rubles about 2000 rubles per day, 60 000 rubles in the winter month.
The fans are set voltage frequency: 0, 35 or 50 Hz. Initially, the fans were regulated by the number of open dampers on the branches, but after some time the drives stopped responding - Chinese motors without a casing rusted - it’s ridiculous, but during the transition period someone walks and inserts / pulls plates across / from the duct . Then for the fans it was possible to enter any frequency value from the range, but it turned out to be “too complicated” - no one bothered, they set the minimum or maximum value. In addition, the power of the heaters depended on the speed of the fans, but then it quickly came to the realization that the regulator works well without adjustments.
Yes, there is someone who, according to the state of the air and the number of visitors, switches the speed with “buttons” on the touch panel.
The first version of the user interface on the touch panel (SP270) terrified me, but the buttons and indicators in the frames continued to fold on the screen, and the miniatures of the “snails” rotated with their blades. A quick examination of examples of constructing mnemonic diagrams showed graphical imitation of real objects is a generally recognized practice. Then came a preventive day, and a new interface.

Then a flat design was already trampling its sphere with might and main, and the picture on the cabinet was a little drawn to the trend.
Years passed (3 pcs.), From the experience of automation within the team the idea arose about an SCADA-based ventilation system, but I (as not very professional, or how not very professional) did it my own way. It should be noted that no wishes for remote control were received from the owner of the building - this was how my samopal was justified.
From some unrealized project (sound announcement), only one Raspberry-Pi remained. Well, node-js got up there, because immediately with one script it was possible to describe the exchange with the PLC and the web view. Naturally, accessing the Internet was an obvious and integral task.

Between single-board and PLC, the exchange takes place via modbus-tcp. It turned out to be very easy to raise a connection. The first library was from the search engine github.com/dresende/node-modbus-tcp , and after a few hours the fans were controlled from a browser.
A single-subscriber connects to the site like the client does - with a web socket - I really did not understand how it happened. The data itself is formed into json strings and converted directly on the page. At first the web page was filled with elements of standard forms, but it strongly resembled that horror on the touch panel, only from a different sphere. For some time I fought for beauty, but very quickly got tired.

Now you need to rotate the virtual “twists” inside the disclosed items.
Client authorization for management is now done very simply, by matching one line, and the entire exchange between the client and the PLC goes through the site-router-router-single-circuit chain. Although before that the scripts on the page provided for switching the web socket to single-board, where gray dynamic addresses for two subnets were determined by the single-board procedure, and authorization was allowed only to clients from the internal network.
There are many more details for improvement in this ventilation system, and in the near future three more supply and exhaust systems with an undetermined number of micro-extractors are to be added. I suppose that we will also combine them inside the building’s network via ethernet to a computer with some normal scada program.