📜 ⬆️ ⬇️

Automatic regulator of temperature of a geyser

I want to talk about the creation of an uncomplicated device that greatly eased the lives of home inhabitants — an automatic regulator of the geyser temperature. Similar devices have already been created and described here in Habré, I wanted to make a slightly more advanced device and describe in detail the whole process of creation from concept and measurement to implementation, without using ready-made modules like Arduino. The device will be assembled on a breadboard, the programming language is C. This is my first development of a complete (and working!) Device.

1. Baseline


We live in a rented apartment, which has one very unpleasant property: there is no hot water in the house, cold water is heated in place using a heater (Flow Gas Heater - HSV ), which is located in the kitchen. While taking a shower, if there is another pressure surge, you have to spank naked to the speaker or call someone. Integrate a full-fledged "smart home" is not possible, so it was decided to introduce automatic heater control. By the way, I quickly found several similar solutions, for example here , which means my problem is known and solved in its own form.

HSV Model: Vector lux eco 20-3 (China)
Water pressure: about 1.5 kgf / cm² (low pressure, the heater works just above the allowable limit)

Solution Requirements



')

System architecture


After some thought, the device architecture was scribbled as follows:

Further I will describe the development process in chronological order.

2. Servo Drive


Since my profession is software and mechanics has always remained the most difficult part - I decided to start with it. I must say that for the first stage I could not get together for a long time, the HSV was very afraid to touch it, but another pressure drop forced me to start.

After examining the column and looking around, I found places to install the TowerPro MG995 servo, once ordered for delivery on aliexpress.



To eliminate the backlash drive drive made one thrust spring-loaded. The backlash was completely eliminated, but another problem emerged - the servos with a moment> 10 kg * cm turned out to be too impudent for the HSV. When turned on, the transients in the electronics of the machine cause a jerk to a random position and, after a couple of idle inclusions, the thrust was bent! Silumin column definitely will not withstand such treatment. The geometry of the rocking chair, which was not on the axis of the regulator, also caused complaints, which led to non-linearity of the adjustment. The final view of the throttle actuator assembly:



The knot is redone - springs from the VAZ (from the carburetor - bought in the auto parts store) are used and the rocking chair is now on the geometric axis of the shaft. This design has a slight backlash, but is linear in adjustment and can dampen the rage of the steering machine. The angles are set to the optimal values ​​for adjustment in the most demanded positions of the regulator.

3. Sensor block of HSV


The HSV thermistor changes its resistance within 20..50 KΩ, it is problematic to use directly as a divider - we get low measurement accuracy. But as it turned out in practice - with an increase in the supply voltage up to 12V, it is possible to get an acceptable output signal range without problems - only use the DU in the repeater mode (if necessary, you can change the gain) to isolate the divider from the load. Block diagram inside HSV:



The divider R2 and the thermal sensor of the column generates a signal with a voltage of 1.4..4.96 V in the full range of measurements (in practice - 20..60 degrees Celsius). Initially, he developed a bridge circuit - which can compensate for the loss of the power source, but was discarded due to the fact that the power source had little effect, and the first “TK” item was “simplicity”. Operational amplifier provides a divider decoupling and load. Zener diode D1 limits the output voltage at 5.1 V for cases of disconnecting the sensor (otherwise the output would be 12V - which is deadly for the controller) - that the controller's circuit would be considered an unconditional error. The integrated stabilizer 7805 nourishes the servo - the solution is unsuccessful, with the stopper of the machine it heats up terribly and I think it can fail with the drive wedge (if the built-in protection does not work). More on this block I will not focus.

4. Controller


The controller is assembled on the basis of IC Atmega8 in a dip package.



Clocking - internal oscillator at 8 MHz. Power - another 7805 on the board. Indication through a standard LCD1602 display. Block scheme:



Power management of the unit is carried out from the column through the transistor - using a small-sized relay. The temperature sensor signal (Contact No. 4 of the connector) has a pull-up to the ground and when disconnecting the sensor during operation, it will show a very high temperature - which will reduce the regulator and will not cause dangerous situations. Assembled unit:





4. Testing and adjustment


To test the PID controller, a HSV model was written on Qt. On it were worked out the main points and situations of the heater - cold / hot start, pressure drops. To remove the characteristics, a UART-connector was added to the controller board, where data on indicators were sent once a second - current temperature, throttle position, etc.



When testing revealed the following:


The results of measurement and calibration of the temperature sensor, Dependence can be considered conditionally linear:



The first runs in the telemetry drawing program from the column:



(I forgot to add a legend to the charts. Hereinafter - red - sensor temperature, green dotted - throttle position, blue - temperature desired by the user)


Almost successful adjustment


Successful odds options


A good start option

The first runs showed the main parameters of the system, it was no longer difficult to measure them and adjust by the accelerated formula , the parameters were selected for a long time and painfully. It was not possible to get rid of the oscillations completely, but fluctuations within 1 degree are considered acceptable. Accepted option:





In the process of selecting the integral factor had to be completely disabled, I think that this is due to the large inertia of the system. Totals:

float Pk = 0.2; float Ik = 0.0; float Dk = 0.2; 


5. Enclosing


The device is assembled in a plastic box junction box.



And in this form it works.

6. Safety of use


An important question that was asked from the very beginning. Let's go through the main points.

Galvanic isolation of the circuits of the column and the regulator


What happens if the 12V power supply shorts and 220 volts appears on the sensor circuit? It will not cause a gas supply to the column. As it turned out - it will not cause - in the column there are two levels of gas supply - the solenoid valve of the controller and the mechanical valve of water. Open only the solenoid is small - gas will not flow without water flow.

Disabling or tearing off the sensor inside the HSV


When the thermistor is disconnected from the unit inside the HSV, a 0xFF (5.1V) signal will be generated at the output, which is checked by the program as an error, the controller stops the program execution, the servo is set to minimum.

Disconnect or detach the sensor from the controller


In this case, a high temperature is generated (tightening the sensor line to the ground), which will bring the drive to the minimum value, which is just as safe for the user.

Electron-mechanical protection of HSV


Values ​​of protection of HSV remain functional in normal mode, in case of boiling / overheating / thrust sensor columns, regular systems should turn it off.

7. Files


The full project archive is available on github . In the project directories, measurement results, controller firmware, and boiler boiler on Qt are available.

Thanks for attention!

Source: https://habr.com/ru/post/262437/


All Articles