📜 ⬆️ ⬇️

Automatic home heating control with their own hands. Part 2

Let me remind you that we are talking about the home heating control system using the timer thermostat NM8036 ( start here ).



Analog (ADC) controller inputs and temperature sensor connections.

So, ADC. Not everyone and not immediately clear what it is and what it is eaten with. Therefore I will try to explain in my own words.
')
In general, what is an "analog" input? The controller has two types of inputs: digital and analog. Digital can take only two values: zero and one. Zero - no voltage, unit - there is voltage. Information is transmitted to the digital input pulses in time. But the analog input is able to accept not only these two values, but in general any voltage.

The NM8036 controller has two analog inputs (see about the assembly of the NM8036 unit in the first part). Each of these inputs can be supplied with any voltage ranging from 0 to the supply voltage (5 V). For example, 1.8 volts, or 3.2 volts ... In short, any, but not more than 5 volts.

What does the controller do with this voltage? Very simple: measures and digitizes it. Moreover, it does this in the range from 0 to 1023. This is binary data (bin-data), in which the upper limit (1023) equals to a voltage of 5 volts. This is the Analog to Digital Conversion (ADC).

But the actual tension - it is the actual. 5 volts - they are 5 volts. This value is considered here as "Volts". That's right, there are volts.

But here you can imagine this voltage in other physical quantities (Physics). For example, we connected a pressure or humidity sensor to the input, or also a temperature sensor, but not a digital one, like the DS1820, but a thermistor. This thermistor sensor will give us a voltage of 0 to 5 volts (electronic engineers, do not get excited! This is just for example.), But it’s important for us to know the temperature, not the voltage!



So we calibrate these values. Set the lower limit in the settings, for example, to 16 degrees, and the upper limit to 30 degrees. Here we have such a sensor, you see, it is connected. And the number of decimal places will be 2. And we indicate the prefix: C (I mean, degrees Celsius).

And what do we get? And we get that when the sensor sends a voltage to the input, for example, 2.5 volts, the controller quickly recounts everything and gives us three options for the results: 512 (bin-data), 2.5V (Volts) and 23.00 (degrees Celsius ). In this way, you can configure work with almost any sensor that produces an analog voltage value at its output.

The existence of two analog inputs at the controller is not only the ability to connect the above sensors. You can come up with a lot of schemes that can be very useful for different purposes in a private house.

I will list offhand possible of them:
Simple switch on 2 positions. May have at the output Data either 0 volts or 5 volts. It is connected by three wires: Vcc (+ 5v), Data (data) and Gnd (common wire). This switch can set two different modes of operation of the loads when programming the system.



A switch to more positions may allow programming and more modes. Here, for example, in 3 positions. Each position has its own output voltage. The lowest position is at the output of 1.25 v, average 2.5 v and the upper 3.75 v. By increasing the number of resistors in the chain, you can increase the number of switch positions.



These were options for step adjustment, but there is also a version of stepless regulation. Here, the output voltage depends on the position of the variable resistor motor.



Can be used, for example, to manually adjust the temperature. Make the program so that it maintains the temperature in the room as set by the controller. Automatic adjustment is one thing, but often you want to turn something somewhere, click to make it warmer, or, conversely, cooler. A man is a fastidious creature.

Or use such a scheme to control, say, the water level in the tank, in the well ... It is simple: a float on a string wound on the variable resistor knob. Spring loaded, naturally. But this is so, offhand, without a detailed study.

If you continue to fantasize, you can still measure the level of illumination and turn on / off the lamp at the right time ... In short, there are plenty of possibilities for these analog inputs, the NM8036 can well master many tasks not only in managing the heating of a private house, but also for solving many other tasks . On the possibilities of customization and programming we will talk in the following articles.

By the way, about adjusting the temperature in the room is a very good decision, taken by me from the forum MasterKit . In response to someone's question, the author of the message Brokly (he is also the author of the Advanced Manager program, I will also talk about it later) gave an example of the use of an analog input. I quote literally:
You would be even harder to come up with a thread. Put the contact wall thermostat, connect to the analog input, and let the drunks themselves twist it. And free the cleaner, and drunk fun. And the controller has less work, the thermostat has tripped - you can not warm it.

How do you like this, Master? And you know, I liked it.

Now about connecting temperature sensors. In the manual, of course, there is a wiring diagram, but I would additionally emphasize your attention to the fact that the sensors must be connected in series, without the formation of a “star”.

To make it clearer, here's a picture: each sensor has its own cable for connecting to the controller, and somewhere at the controller itself, these cables are connected into one. This is the star connection.



No doubt, of course, it is more convenient to scatter sensors. Only then there may be problems with their definition, and in the work the device will have unexplained glitches.

This circuit is an example of the serial connection of DS18B20 temperature sensors. That is, the sensor behind the sensor is connected in series to one continuous cable connected to the NM8036 along the cable.



Generally, if strictly judged from the point of view of electrical connections, this connection is parallel, but I called it in my own way for a better understanding. After all, the star connection is also parallel ...

In general, this type of connection, as shown in the figure, is the most correct, but it is not always convenient in real conditions, when sensors must be located in different rooms, scattered not at all in accordance with the logic of the series connection of sensors. And what to do?

The exit in such a situation is the connection with the returns, it was along this path that I went. Where it was impossible to stretch the cable sequentially from the sensor to the sensor, I returned from the next sensor to the starting point and then went back to the next sensor.



This scheme is just an abstract example, giving an idea of ​​the method of connecting sensors in real conditions. As you can see, the principle of serial connection is fully observed here.

When installing temperature sensors, I used the cable "twisted pair", which lay computer networks. This cable has 8 multi-colored cores twisted in pairs. Firstly, it turned out to be very convenient for making connections with a return, and secondly, the “twisted pair” cable is just very good for such purposes, reducing the number of induced interferences.

You can buy such cable in any computer workshop, service, in electronics stores. Not so expensive, rupe thing, three rubles a handful.

The cable has four pairs: blue and white blue, brown and light brown, pink and white pink, green and white green. I use all white wires for a common wire. Brown wire - Data at the entrance, blue - power at the entrance. At the exit: Data - green, food - pink.

At the other end of the cable “with return” I connect the sensor according to the indicated scheme, i.e., all white - common, green and brown - Data, blue and pink - power.







Now the pinout of the sensor, the appointment of its findings. Of course, they should not be confused. We take the sensor by the legs and look at its front side, where the inscriptions are located. At the same time, there will be a power output on the right, a common one on the left, and a data output in the middle.



But here the cables are spread, the sensors are soldered. How to fix them? The question is ambiguous, if we ask ourselves to measure the temperature with an accuracy of tenths of degrees. Actually, the sensor measures it, but it measures its temperature. And measuring the temperature of the sensor and the temperature of the water in the pipe is far from the same.

It would seem, what is so difficult? I stuck the sensor to the pipe - and it will measure the temperature of the water in the pipe. Is not it logical? Is logical. But wrong. Firstly, the surface of the pipe itself already gives an error, because it is washed by air, the temperature of which is not always equal to the temperature of the water. Secondly, and most importantly, the sensor is pressed against the pipe with only one surface. The rest are washed by air again and the temperature of the sensor itself is not at all equal to the temperature of the pipe surface.

The exit suggests itself: to insulate the sensor and the pipe section and make a kind of casing over the sensor mounting point, protecting it from the effects of outside air.

But I, again, followed the path of simplification and attached the sensors to the pipes with the help of an ordinary fabric patch. Yes, the readings of the sensors are not true. The difference is from one to one and a half degrees. So what?

I do not collect the thermostat for scientific experiments, I just have a control system for the heating of a private house. And while programming the system, nothing prevents me from taking into account this difference, which I actually did. For example, in the hallway, I have a difference in the readings of the sensor and the thermometer (one from the other in 2 millimeters) - 1.3 degrees. Thermometer shows 24, and the sensor - 22.7. Which of them is lying - is it important? Although, I still trust the digital sensor.

What else about the sensors? Look like that's it. Yeah, here's another: do not rush the sensors at once everything in place screw / primativat. Identify them later will not be easy. Let them hang in the air so that later, when you launch the “Search for sensors” settings and all of them are determined, you can change their temperature with your palms and give names in the system.

After all, the system will detect the sensors by their serial numbers and dump you a list of these serials. How does she know that this serial belongs to the sensor near the toilet, but this one belongs to the sensor under the bed? Then you crawl under the bed, warm the sensor with your palms, breathe on it, and ask your spouse to look at the list of sensors. And you will find out among all whose temperature has risen. And you will find out what serial number he has, and you will assign him the name: Bed!

To be continued…

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


All Articles