📜 ⬆️ ⬇️

Another smart home, in three parts. Part One, Iron

I want to tell and show the results of the project, which has been developing for about 10 years. It develops as a hobby, so it happens that in a week a new device is made, and then in half a year nothing is done. I really do not like the phrase "Smart Home", so it will not meet further. Also, there will be no circuits, code examples, wired prototyping boards and other boring things. There will be a lot of photos and discussions on general topics.

image

How it all began, or Lighting Controller


About 10 years ago it somehow coincided that I got a job as a developer of embedded electronics and bought an apartment. There was little money, the apartment was a one-room, I lived alone. I wanted something that, as I later found out, was called "Studio Apartment". An exciting lesson began that could not be completed - repairs. And from what the person who has taken a soldering iron picked up before hand begins to do repair? Correctly, with the wiring. I wanted to turn on the light from the remote control from the TV. No sooner said than done. Then I wanted to, in the dark time when opening the front door, the light in the hallway turned on. Reed switch in the door works. Then I wanted the doorbell to be turned off. Ok done. Then he wanted to go to the toilet at night, turn on a small light bulb. Ok, I connected the motion sensor. Well, since I have such a smart switch - can I connect it to a computer? Hooked up. In general, after about five iterations of hardware and hundreds, if not thousands of software iterations, this is the lighting controller.

image
')
What does he do?


Lighting and heating controller


The next step was the repair in the bathroom. And what is most important in the toilet and bathroom? Freshener, book or tablet. Warm floor. And there is also a fan, and a pair of channels of light. And I want to open the door at night and the faint light would turn on itself. And then the fan was turned on for a couple of minutes. So, stop. 4 exits. Yeah, there is a lighting controller! I redid it a bit, and in the end I got a lighting controller and a warm floor. Looking ahead - then it was divided into two slightly different logical devices - for heating and for bathrooms, balconies, kitchens. In the first, three temperature sensors are connected, one in the control loop, two simply for measurements; for example, outdoor temperature and, for example, coolant temperature. The second remained with one temperature sensor, but got a pair of leakage sensors. Here it is in the photo:

image

What does he do?


Then he took up the balcony. There are also a couple of channels of light, warm floor. The second controller got a brother.

Power supply controller


Everything worked, everything was fine until I went on vacation ... I came back - the refrigerator does not work. An autopsy revealed a blown varistor and fuse. It is clear that the voltage jump, it’s good that they limited everything to two. Changed, earned. But the trouble does not come alone, after a couple of weeks the same thing happened with the air conditioner.
Need to do something. What? That's right, the controller to protect the power grid.

image

What does he do?


Water supply and irrigation controller


At the same time, I changed jobs, began to dress better, I bought a car and saved up some money. And what does a city dweller do with a car and some free money? Buys a cottage. I did not become an exception. Electricity there was constant, but the water was worse. There was a pipe from which in a day there was barely anything that flowed there. The task is clear, we need a barrel, a pump station and a boiler. And of course, another controller. This time the water supply and irrigation.

But here the interesting begins - pressure and water level sensors, soil moisture sensor. The industrial ones are not at all humane, so I decided to do it myself. The water level in the tank - first tried capacitive, did not work. And different sensors, and different schemes - no way. All right, I will try another principle, ultrasound, since there are many inexpensive ones in China. It worked. At the same time there added a humidity sensor and temperature.

image

Pressure. Where else measure the pressure of liquids? Yeah, car! I chose the Gazov oil pressure sensor. According to the parameters of 0-6 atm, the thread is the same as on the water dial gauges. There were doubts about corrosion resistance - but for three years everything has been working. You can change in advance, they are worth a penny. Here it is, to the left of the pressure gauge. The flow meter was made on the basis of a conventional water meter, sticking a magnet on the impeller, and a Hall sensor on the case.

image

Soil moisture sensor. I also made capacitive, but did not grow together, in the end I simply measure the resistance with two probes. Well, the temperature of the soil, let it be.

image

It turned out something like this (yes, apparently they are all the same):

image

What does he do?


RGB tape controller


Then at home I wanted to make a decorative lighting. Bought RGB tapes, and how to manage? Buy ready? Not my method, we do the interior lighting controller. Here is this:

image

What does he do?


RS485 Gateway - Ethernet


All is well, but RS485 ... where is it? There were several options, I will describe in the next part, in the end it all came down to another controller. He also connected the drive of the entrance gate.

image

What does he do?

Summing up


I would like to talk about some of the nuances from my point of view.

Why RS-485, and not wireless interfaces? Why not Wi-Fi?
I don’t already remember where, but I heard such a phrase - where you can lay copper, you need to lay copper there. As you can see, for the introduction of this system it is necessary to almost completely redo the wiring. So why not lay additional signal wires? What is better - not just sitting down batteries, clogged air or good old copper?

Why not ARM with Linux, and the ancient 8-bit controller? How is the internet of things?
Everything is simple - the principle of reasonable sufficiency. Why use megabytes of memory and Linux to light a light bulb? And in any case, the power unit, input circuits, etc. will be exactly the same.

Why not touch screens, custom switches, mobile phones, tablets, voice control?
I believe that interfaces should be uniform. When I wake up at night to drink water, I don’t want to figure out which of the 5 buttons I press to turn on the light. I want to click on the standard switch, drink water and go to bed on. I do not want each of the visitors to tell me what needs to be done in order to turn on the light in my house. It's one thing with the tablet to set up a schedule for watering or lighting, set limits for the allowable voltage to protect, and quite another to turn on the lights.

But what about management via the Internet?
Of course, control over the Internet is. I can do anything from anywhere within a framework implemented in hardware. But there is one thing - all controllers must be autonomous and carry out their basic functions without any network, Internet or other servers. If I forgot to pay for the Internet - I do not want to be without light. If I have a bad connection in the country - I just want to press a button on the controller to turn on the pump and tank. A watering schedule - you can customize and then.



With the iron part on it all, in the next, second part, I will describe the server part. And I will show some more photos of all this in the collection on the example of a couple of projects.

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


All Articles