The use of a microcontroller as part of a device for measuring humidity using the thermogravimetric method

. The use of a microcontroller as part of a device for measuring humidity using the thermogravimetric method is considered. The main nodes of the device have been designed, in which the microcontroller receives and processes information from them, and also controls these nodes. They use various microcontroller capabilities, including several data transfer interfaces: I 2 C, SPI, etc. A built-in analog-to-digital converter is used. The power control unit allows you to flexibly set the required heater power in the device. A unit has been created to control the mass of a material sample in the drying chamber of the device, which provides an accurate measurement of the mass of the substance. The temperature control unit allows the microcontroller to evaluate the material drying parameters and select the operating mode of the power regulator. The performance of the designed units was tested. It is noted that they can be used in a device for measuring humidity using the thermogravimetric method under the control of a single microcontroller.


Introduction
Currently, there is a wide range of tasks to improve the efficiency of agricultural production [1][2].Technological lines of enterprises require deep implementation of automation systems.Measuring devices built on outdated models of electronic components also require modernization.One way to solve these problems is to use microcontrollers as the basis of the entire system.This solution cannot be effective without a correctly constructed algorithm for the operation of devices, and, consequently, correctly composed program code.
Measuring humidity by the thermogravimetric method is based on calculating humidity through the mass of moisture that has evaporated as a result of drying [3].In a device that measures humidity using this method, important components are a power regulator, a mass meter and a temperature control unit.Another important part of the device is the LCD module, with which the user interacts with the device.Obviously, it is the microcontroller that will allow you to implement a convenient interface on it.
The efficiency of heating the analyzed sample depends on the correct choice of heater power.The optimal power value can be set using data from the temperature sensor, which is processed with high accuracy by the microcontroller.After processing the data, the microcontroller sends a control signal to the power regulator.
During thermogravimetric moisture measurement, the mass of the heated sample is continuously measured.High accuracy of data processing on sample mass can be achieved using a microcontroller included in the device.

Materials and methods
An analysis was made of the use of microcontroller capabilities for designing a power controller and a mass meter for a humidity measuring device using the thermogravimetric method.A block diagram of the device was drawn up (Figure 1) and a list of components of the main components of the device was determined.Units for power regulation, mass measurement and temperature control were designed.A prototype of the power regulator was tested using a heating element in the form of a cylinder with nichrome wire wound around it.During the study, the temperature of the element was monitored during heating in various operating modes of the unit and subsequent cooling.The mass control unit was tested by placing weights of known mass on its sensing element.The digital code values corresponding to each load were used for the subsequent development of an algorithm for converting them into mass values.

Power regulator
The operating principle of the designed power control unit is based on transmitting a certain number of half-waves of mains voltage to the load [4] and implements two control methods.In the first, the regulation period is fixed and the number of half-waves transmitted to the load during the period is changed.In another method, the number of halfwaves is fixed, and the variable value is the control period.
The designed unit (Figure 2), the main part of which is the microcontroller, consists of: a zero detector, designed to determine the moment of transition of the instantaneous value of the network voltage through zero; potentiometer, with which the control level is set; triac to which the load is connected.A control program for this unit has been developed, with the help of which both of the above control methods can be implemented.The program uses an analog-to-digital converter (ADC) integrated into the microcontroller to process the signal from the potentiometer and set the load power control mode.

Sample mass meter
To control the mass of a material sample placed in a device for measuring humidity using the thermogravimetric method, a special unit was designed (Figure 3).It consists of a microcontroller, a strain gauge and a 24-bit analog-to-digital converter.The strain gauge is an aluminum plate on which strain gauges are placed, connected in a bridge circuit.The diagonal stress of this bridge depends on the degree of deformation of the strain gauge.For ease of operation, an LCD module is used when studying the designed unit.
A program has been developed for processing strain gauge bridge diagonal voltage values obtained from a 24-bit analog-to-digital converter.In order to eliminate the influence of fluctuations in this value, an algorithm is provided for calculating the arithmetic mean of every ten measurements.
A study of the operation of the mass control unit was carried out.Weights weighing from 10 mg to 5 g were placed on the sensitive element.For each measurement, the electrical voltage was recorded for subsequent conversion to a mass value.Further study of the operation of the mass measurement unit made it possible to establish that the dependence of the number displayed on the device display from the analog-to-digital converter on the mass of the load placed on the strain gauge is a linear function.A corrective equation was compiled and entered into the program code.Thus, the microcontroller converts the voltage value of the diagonal bridge circuit of the strain gauges into the mass value, taking into account all transformations and displays the information on the LCD module.

Temperature control unit
To measure the temperature in the drying chamber of the humidity measuring device using the thermogravimetric method, a temperature control unit was designed (Figure 4).The main part of the node is a microcontroller that receives and processes information from the temperature sensor.A thermocouple is used as a temperature sensor, which is connected to the microcontroller through a converter.Thanks to the converter, the voltage value on the thermocouple is converted into binary code, which is easily processed by the control program.For the convenience of studying the operation of the unit, the temperature value is displayed on the LCD module.

Discussion
Studies of the operation of the designed units have shown that they can be used in the design of a device for measuring humidity using the thermogravimetric method.
The heater power control unit has shown its effectiveness on high-inertia types of electric heaters, the temperature of which does not drop during the pause between the supply of half-waves of the supply voltage and the "blinking" effect does not occur, as happens, for example, when using an incandescent lamp when regulating its power using this method.
The absolute error of the mass measurement unit does not exceed ±0.01 g.This makes it possible to calculate the moisture content of a material through the mass of moisture evaporated from it with satisfactory accuracy.
The temperature control unit allows, using a microcontroller, to process information about the state of the sample in the drying chamber of the device and adjust the power of the heating element of the device.

Conclusion
In all the above designed nodes, the leading role was played by the microcontroller, which allows you to receive, process and transmit information from the device nodes and control them.The development of these nodes showed the wide range of capabilities that the microcontroller has as the basis of the designed system.Thus, directly in the humidity measurement device, all these nodes can be combined by one microcontroller.The greatest effectiveness of its use will be achieved in combination with a properly designed program.

Fig. 1 .
Fig. 1.Block diagram of a device for measuring humidity by thermogravimetric method.

Fig. 4 .
Fig. 4. Block diagram of the temperature control unit.