We remotely monitor the condition of the gas boiler

The CC2530 chip is perfect for controlling radio-channel gates, and it will also serve well as a leakage sensor. Do not forget that the sensor will be used in a country house, the total area of ​​which does not exceed 40 m22. For rooms with a complex floor configuration or thick concrete walls, this solution is most likely not suitable. With an awareness of the technical boundaries, let’s move on to the exchange protocol. The Zigbee use case was not considered from the very beginning, despite the fact that devices working with this technology could be very interesting. In the absence of a stable cellular connection to connect to the Internet and a limited number of events, a small task manager based on Sleep Timer will be enough. We put the commands into the protocol:

Team

Description

Add a device to the database

Each sensor must have a unique number by which it will be identified on the network

Remove a device from the database

Temperature

Events about which the user needs to be informed

Voltage

Leak

Service exchange

Empty command, evidence that the device is online

Probably, my neighbor in the country will someday also want to make himself a radio channel system, using the CC2530 chip as a basis. I do not rule out that he will come up with a similar protocol with a similar set of commands and use the same radio frequency range. And although the probability of such an event is negligible, this does not mean that it is necessary to develop a device for one specific task. Now we are not thinking about a specific problem, but about the system architecture to solve it! You can avoid conflicts in a radio channel network using addressing.

The shorter the data packet size, the less energy is required to transmit it. The small CR1220 battery will be happy to know that only 3 bytes are allocated for the address and 2 for the command. Combined with the preamble, sync word and CRC, the total packet length is 12 bytes. Unique in the range from 0 to 220 We generate the address using a random number generator, using hardware RND with an initial value from the airwaves. In the address field we put 4 bits under the device type.

The sensor sends a command to register in the network (record the address in the database) when the reed switch is closed. As mentioned above, the sensor was planned to be literally buried. A button for issuing a command would be more convenient, but you have to be content with what you have. After registration, a confirmation package is returned for each request. Failure to receive the latter results in the request being repeated. There is no synchronization of devices, but the RNG mentioned above is used for a random offset within the exchange period if confirmation has not been received from the master for three requests in a row. Without synchronization, conflicts in the network are inevitable, because The internal low frequency oscillator used has poor stability. Each device will measure time with different accuracy, which will lead to a collision. The Clear-Channel Assessment (CCA) mechanism is not used in my case, because… requires additional energy expenditure. When the number of devices in the network is small, the within-period periodic shifting scheme seems more attractive.

Separately, it is worth mentioning the internal temperature sensor CC2530, the accuracy of which without calibration is ±10 °C (testing on two microcircuits showed -2 ​​°C and -9 °C relative to room temperature). In one of the publications, I blamed the low accuracy and poor sensitivity of the internal temperature sensor of the STM32G0 microcontroller. I was wrong, everything is learned by comparison. So multi-point temperature calibration is an integral part of the development process. Fortunately, in my case, high accuracy of readings is not required; operation is needed according to an approximate threshold value. So, the sensor wakes up every second, checks the condition of the electrodes, and monitors the battery voltage and temperature every 30 minutes. Data is sent over the air every 10 minutes. On the other side, a similar transceiver in the relay constantly operates in receive mode.

Figure 2 - Composition of the radio channel system

Figure 2 – Composition of the radio channel system

The relay board has active power supply and a clock frequency of 32 MHz, i.e. Most of the time the microcontroller has nothing to do. Let it also measure the temperature, and also periodically send AT commands to the GSM module SIM800L, in the hope of receiving “/r/nOK/r/n”. Depending on the temperature readings, the relay switches, the hysteresis is set by software.

Information about working with the SIM800L module on the Internet enough, the whole point comes down to sending and processing AT commands via the UART interface. However, the module is not very friendly and requires some skill in handling. Particular attention should be paid to the supply voltage; in addition, the behavior of the module may differ slightly depending on the firmware. The code that was once tested on the designed GSM button refused to be executed the first time on the new board. The reincarnation of neural connections in the head about the composition of AT commands and the addition of Russian-language functionality (PDU format for sending messages) took some time.

Results and testing in practice

When choosing a tariff plan for my “Smart Thing,” I was quite surprised at the prices, or rather the need for a monthly subscription fee. Surely there are smart things in nature that require 500 MB of mobile Internet, 100 SMS and 30 minutes for communication for 1,200 rubles per year. But this is not my case; it is better to choose the usual per-second billing and refuse the buffet. After all, one outgoing SMS is enough to transmit readings, and one outgoing call is enough for an alarming event. As for requesting testimony, an incoming call with number verification is used. In response, depending on the state of the sensor, we receive a message like:

Figure 3 - Options for messages from the GSM relay

Figure 3 – Options for messages from the GSM relay

When registering for a tariff plan, an initial payment of 400 rubles is made. Almost the entire amount is available in the account. Considering that one message costs 2.5 rubles, the funds should be enough for several months, even if you request information daily. But it was not there.

Figure 4 - Sending messages abroad

Figure 4 – Sending messages abroad

And while I was trying to figure out why sending messages in PDU format did not work, the account balance was happily decreasing. SIM800L is not a mobile phone; you must enter the country code correctly.

Currently, the product has successfully passed balcony tests and has been placed on site. Even taking into account the fact that the hardware was ready, development took a lot of time. Starting in October, it gradually dragged on through weekends and free evenings. And only the weather forecast, with expectations of -17 °C at night, forced me to muster my will and bring the task to the final stage.

Figure 5 - GSM relay placed on the collector cabinet

Figure 5 – GSM relay placed on the collector cabinet

The relay was planned to be installed on a DIN rail in a manifold cabinet, where due to the accumulation of pipes it is always warmer, but due to the metal screen the module was unable to communicate. Well, let it lie on top, without any slats. The radio channel sensor is located on the floor, in the corner of the room. Thus, it is possible to obtain a more or less objective idea of ​​the room temperature and “grope” for the minimum threshold at which the operation of the gas boiler can be maintained. The leakage control function is not used, the inlet tap of the water supply system is closed. I did not connect the relay to the boiler terminals, as before it works from a mechanical thermistor.

So on Saturday I experimented with the location of the sensor, “felt” and set the temperature to the minimum level. Firstly, heating unused space is a waste of money, secondly, operating a gas boiler reduces its resource, thirdly, there is an environmental aspect, i.e. environmental pollution due to gas combustion. Well, on Sunday I watched the sunrise in the car, at night I received a call, the room temperature dropped below 6 °C. I flew to the dacha along a snowy road and talked to myself:

– The call came at 5:30 in the morning, I slept through it and now it’s 8:10. Those. At least three hours have passed since the boiler turned off. It is advisable to hurry;

– The speed limit is 60 km/h, there are cameras on the roads, and there is ice in some places. It is not advisable to rush;

– If we take into account that the temperature does not fall linearly, but exponentially, then the temperature drop will gradually slow down, which means there is a lot of time. In addition, the room has a certain heat capacity. There is no need to rush.

“But it all depends on what level the temperature will drop to.” I open the Weather application. Saratov, daytime temperature -14 °C. To hell with the exhibitor…”

The story ended happily. Error code E3 – no traction on the air pressure switch. This happens if condensation forms in the chimney. The latter is a consequence of the rare operation of the boiler at strong negative temperatures. I personally reduced the maintained temperature to + 12 °C. It turns out that the problem arose due to my interference in the normal operating cycle of the equipment. When the room needs to be maintained at +20 °C, the boiler turns on every 15…20 minutes, and the condensate does not have time to freeze. If the temperature of the entire system drops, the risk of icing increases.

This is how, when testing a useful little thing for the dacha, one of the golden rules of engineering was violated: IT WORKS – DON’T TOUCH.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *