There is a small ventilation system that we were instructed to run sometime, and today I use it as an
online thermometer . How did it happen? It was the first automation cabinet adopted immediately after the agreement to work.
Then a ventilation unit with a plate heat exchanger and electric heaters, with several dampers on the duct branches, was delivered. There was no clear technical task, the little company was just starting its way, we acted according to the sensations.

The cabinet was assembled from: Aries PLK160, touch panel SP270, PChV203, every kind of electrical junk. To measure the temperature, Oven thermometers and a pair of analog input modules were used.
')
Heaters are controlled by a PD controller (as I imagine it) and a PWM switch with a one and a half minute period for switching starters (contactors) with brute force. The heater before the recuperator is set at a fixed temperature of 3 ° C - this value is selected after the “experiments” with frostbite of the exhaust duct and floods, so a drainage and water drainage set up. The heater after the heat exchanger reheat to the required temperature.
In general, imported specialized controllers have a lower limit for outdoor temperature when ventilation stops. However, for us this luxury is unacceptable, even if we have –35 °.
It is not good to consider other people's money, but it is interesting.In winter, heaters operate at about 40 kW out of 120 possible, two 7.5 kW fans averaged to 5 kW due to switching speeds, the working day is 15 hours. Approximately, 50 * 15 = 750 kWh per day. At 2.75 rubles about 2000 rubles per day, 60,000 rubles in the winter month.
Fans are set to the frequency of the voltage: 0, 35 or 50 Hz. Initially, the fans were regulated by the number of open dampers on the branches, but after a while the drives stopped “responding” - the Chinese motors rusted without a casing -
it's funny to say, but during the transition period someone walks and inserts / pulls the plates across / from the duct . Then for the fans it was possible to enter any frequency value from the range, but this turned out to be “too difficult” - no one bothered, set the minimum or maximum value. In addition, the power of the heaters depended on the speed of the fans, but it quickly came to the realization that the regulator performs 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 form on the screen, and the “snail” thumbnails were rotated with their blades. A quick inspection of examples of constructing mnemonic schemes showed that graphical imitation of real objects is a generally accepted practice. Then came the preventive day, and a new interface.

Then the flat design with might and main trampled its sphere, and the picture on the cabinet slightly pulled to the trend.
Years have passed (3 pcs.), From the experience of automation within the team, the thought of an SCADA-ventilation system came through, but I (not very professional, or not very professional) did it my own way. It should be noted that no wishes were received from the building owner for remote control - this is how my samopal was justified.
There was only one Raspberry-Pi left from some unrealized project (sound recorder). Well, node-js got there, because at once one script managed to describe the exchange with the PLC and the web presentation. Naturally, Internet access was an obvious and integral task.

Between the single-board and PLC exchange occurs on modbus-tcp. Raising the connection was quite simple. The first library from the search engine
github.com/dresende/node-modbus-tcp , and after a few hours the fans were controlled from the browser.
The single-plate device is connected to the site as the client — by a web socket — I did not really 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 was very much like that horror on the touch panel, just from a different sphere. For some time I fought for beauty, but very quickly tired.

Now you need to rotate the virtual "Krutilki" inside the disclosed items.
Authorization of the client for the ability to control is now done very simply, by coincidence of one line, and the entire exchange between the client and the PLC goes through the site-router-router-single-board chain. Although prior to this, the scripts on the page provided for switching the web socket to a single-board device, where gray dynamic addresses for two subnets were determined by the procedure from a single-sided device, and authorization was allowed only to clients from the internal network.
There are still many details for improvement in this ventilation system, and in the near future we will have to add three more supply and exhaust systems with an indefinite number of micro extracts. I suppose that we will also combine them within the network of the building via ethernet to a computer with some normal scada program.