Smart home based on Arduino controllers: design and organization of controlled space

Smart home control scheme: design and controller selection | 21st century technology smart home

Building a project on Arduino

We will show the process of creating and configuring an Arduino "smart home" using the example of a system that will include the following functions:

  • temperature monitoring outdoors and indoors;
  • window state tracking (open/closed);
  • monitoring weather conditions (clear/rainy);
  • generation of a sound signal when the motion sensor is triggered, if the alarm function is activated.

We will configure the system in such a way that the data can be viewed through a special application, as well as a web browser, that is, the user can do this from anywhere where there is Internet access.

Abbreviations used:

  1. "GND" - ground.
  2. "VCC" - food.
  3. "PIR" - motion sensor.

Necessary components for the manufacture of a smart home system

The Arduino smart home system will require the following:

  • Arduino microprocessor board;
  • Ethernet module ENC28J60;
  • two temperature sensors brand DS18B20;
  • microphone;
  • rain and snow sensor;
  • Motion Sensor;
  • reed switch;
  • relay;
  • resistor with a resistance of 4.7 kOhm;
  • twisted pair cable;
  • Ethernet cable.

All components cost approximately $90.

Smart home based on Arduino controllers: design and organization of controlled spaceTo build a system with the functions we need, we need a set of devices worth about $ 90.

How does such a smart home work?

To create a smart home with your own hands, you will need the Brownie Kuzya skill. Through it, you can not only control a smart home, but also integrate virtual devices directly into Yandex.Alisa. This means you don't have to constantly unlock a skill just to turn off a light bulb. The skill will communicate with the microcontroller via web hooks.

YaTalks 2020 Conference

December 5 at 09:00, Online, Free

Events and courses on

For webhooks, the Blynk platform, a device control panel for Arduino and Raspberry Pi, is great. There you can easily create a graphical interface through which you can control the device via Wi-Fi (and also via Ethernet, USB, GSM and Bluetooth).

Stages of creation

It should be said that the stages of creating a "smart home" system with the involvement of specialists or with their own hands will be the same. True, in the latter case, the finished version as a whole will cost significantly less than if you involve specialists who are already in short supply on the market. For this reason, their salaries will be appropriate, which means that if you do not want to spend extra money, then you can do it on your own. So, let's start with the components for this system, if you still decide to create it yourself.

Smart home based on Arduino controllers: design and organization of controlled spaceSmart home based on Arduino controllers: design and organization of controlled space

Equipment

If we talk about the configuration of the system, the technology will include the following set of components:

  • Motion Sensor;
  • temperature and humidity sensor;
  • light sensor;
  • a pair of temperature sensors marked DS18B20;
  • Ethernet module brand ENC28J60;
  • microphone;
  • reed switch;
  • relay;
  • twisted pair cable;
  • Ethernet category cable;
  • a resistor having a resistance of 4.7 kilo-ohms;
  • Arduino microprocessor board.

Smart home based on Arduino controllers: design and organization of controlled spaceSmart home based on Arduino controllers: design and organization of controlled space

Connection algorithm

It should be said that a smart home should be equipped exclusively with LED bulbs, since conventional options simply cannot withstand high voltage. When the project is ready, and all the necessary spare parts have already been purchased, you should start connecting sensors and controllers. This must be done exclusively according to the scheme created earlier. Contacts must be completely insulated.

In short, the step-by-step connection algorithm will look like this:

  • code installation;
  • setting up an application for a PC or mobile;
  • port forwarding;
  • testing software and sensors;
  • Troubleshooting if found during testing.

So let's start by installing the code.

First, the user should write the software in the Arduino IDE. It presents:

  • text editor;
  • project creator;
  • compilation program;
  • preprocessor;
  • a tool to upload software to the Arduino mini-processor.

It should be said that there are software versions for the main computer operating systems - Windows, Linux, Mac OS X. If we talk about the programming language used, then we are talking about C ++ with a number of simplifications. Programs written by users for Arduino are commonly referred to as sketches. The system creates a number of functions automatically and the user does not need to understand their writing, prescribing a list of common actions. There is also no need to include the header type files of regular libraries. But you need to insert custom ones.

Smart home based on Arduino controllers: design and organization of controlled space

You can add libraries to the IDE project manager in various ways. In the form of source codes written in C++, they are added to a separate directory on the working directory of the IDE shell. Now the names of the required libraries appear in the defined IDE menu. Those that you mark will be included in the compilation list. There are few settings in the IDE, and there is no way to set the subtleties of the compiler at all. This is done so that an ignorant person does not make any mistakes.

Smart home based on Arduino controllers: design and organization of controlled spaceSmart home based on Arduino controllers: design and organization of controlled space

If you downloaded the library, then you need to unpack it and simply insert it into the IDE. There are comments in the program text that explain how it works. It should be noted that all Arduino applications work on the same technology: the user sends a request to the processor, and he, in turn, loads the desired code on the device screen. When a person presses the Refresh key, the microcontroller sends information.From each of the pages with a certain designation comes a program code that will be displayed on the screen.

The next set of actions is to install the client on a personal computer or smartphone. You can download it on the Internet, in the Google Play Market or from another source. In order to do this, you need to open the file on the phone that you downloaded, then click on it and in the window that appears, press the "Install" button. In this case, you should be aware that for this the option must be activated that allows you to install programs not from the Google Play service. To enable this option, you need to enter the settings section and select the “Security” item there. This is exactly how you need to activate the corresponding option. When the installation is completed, you can activate the application and configure it.

Smart home based on Arduino controllers: design and organization of controlled spaceSmart home based on Arduino controllers: design and organization of controlled space

How do you plan to manage your smart home

If you figured out the question “what will be automated”, the next exciting topic is “how to manage all automation”:

  • You can organize a central panel with a screen;
  • Remote control and management from a smartphone;
  • Smart sockets and switches;
  • Fully automatic house;
  • Household appliances capable of operating in automatic mode without network access;
  • various combinations of these methods.

Smart home based on Arduino controllers: design and organization of controlled space

It’s worth remembering that your budget also controls automation. Some technical solutions can better cope with the task, but they are quite expensive, but the modern market allows you to find a replacement for them for quite adequate money.

Read also:  What is a VVG cable: decoding, characteristics + subtleties of choosing a cable

What is a "smart home"

This term has a more understandable counterpart - "home automation".The essence of such solutions is to ensure the automatic execution of various processes occurring in a home, office or specialized facilities. The simplest example is the automatic switching on of lighting at the moment when one of the tenants enters the room.

Smart home based on Arduino controllers: design and organization of controlled spaceThe Arduino smart home system is a set of equipment for controlling the operation of various devices using an Android mobile phone.

In any "smart home" system, the following components can be distinguished:

touch part. This is a set of devices, the main part of which is represented by various sensors that allow the system to register events of a different nature. Examples are temperature and motion sensors. Other devices of the touch part are used to transmit user commands to the system. These are remote buttons and remote controls with receivers.

Executive part. These are devices that the system can control, thus reacting to a particular event in accordance with a user-defined scenario. First of all, these are relays, through which the smart home controller can supply power to any electrical device, that is, turn it on and off. For example, by clapping in the palm of your hand (the system will “hear” it with a microphone), you can configure the switching on of the relay that supplies power to the fan

Please note: in this example, the fan can be anything. But you can also use a device specially released to work as part of a particular system.

For example, the Arduino company produces electric motors for its systems, with the help of which, for example, you can close or open the window, and Xiaomi (a Chinese manufacturer of such systems) produces air cleaner control devices. Such a device is fully controlled by the system, that is, it can not only turn it on, but also change the settings.

CPU. May also be called a controller. This is the "brain" of the system, which coordinates and coordinates the work of all its components.

Software. This is a set of instructions that the processor is guided by. In systems of some manufacturers, including those from Arduino, the user can write a program on his own, in others, ready-made solutions are used in which only typical scenarios are available to the user.

Modern systems "smart home" are divided into several varieties:

  1. Equipped with its own controller.
  2. Using in this capacity the processor of the user's computer (tablet, smartphone).
  3. Processing information using a remote server owned by the developer company (cloud service).

The system can not only activate a particular device, but also inform the user about the event by sending a message to the phone or in some other way. Thus, alarm functions, including fire prevention, can be assigned to it.

Scenarios can be much more complex than we have described in the examples. For example, you can teach the system to turn on the boiler and transfer the hot water supply to it when the centralized supply is turned off, if the presence of one of the residents in the house is detected (infrared, ultrasonic sensors, as well as motion sensors help).

Remote control smart home

Smart home based on Arduino controllers: design and organization of controlled spaceHome Automation Arduino and Raspberry Pi

As mentioned above, with the help of a Node.js server, you can connect things to each other. This also applies to the visualization of home automation processes on the Internet through cloud services. This is one way to control your home over the Internet. You can turn on the boiler or heaters manually in advance before arriving at the house.

Another way is to receive data and control the "smart" home on the Arduino platform using SMS and MMS messages. After all, the Internet may not always be at hand. And, if the inclusion of any device may not be critical, then receiving a message about a water leak may be simply necessary. And here, Intel's Edison board can come to the rescue in developing a fully functional "smart" home on the Arduino platform.

And what do we get?

As you can see, Arduino is not just a board for developing some simple automation devices. On the Arduino platform, you can easily create even smart home automation with your own hands. At the same time, there is no need to overpay for devices from Siemens, which are expensive and cost 5-10 times more than Arduino.

Arduino can be connected to a computer and get a visualization of processes on the screen of a monitor or tablet. Smart home automation on the Arduino platform can be controlled via the Internet or using SMS and MMS messages. On the Arduino, you can create quite complex devices with your own hands.

Assembling a "smart home": step by step instructions

Program code development

The program is written by the user in the Arduino IDE shell, which saves files in the ".ino" extension.When programming, the C ++ language is used in a simplified form - many library files and headers are automatically compiled by the IDE. The user must specify the setup () and loop () settings at the start (permanently performed), specify user libraries. Even a novice programmer will not get confused in simple IDE settings.

Now there are a lot of ready-made programs and sketches for Arduino on the Internet, so you can use ready-made software with explanations of the principle of operation. You just need to download, unpack the archive and send it to the IDE folder.

Installing the client application on a smartphone (for Android OS)

For tracking and smart home control from a smartphone you need:

  • download SmartHome.apk file;
  • allow the installation of software on the phone;
  • activate and configure the application.

Working with a router

For router settings:

  • go to the device settings;
  • enter the IP address of the Arduino;
  • indicate the transition to the Adruino chipset on port 80.

What is a control controller

The heart of this system, the controller not only manages all consumers and devices included in the smart home system, but also sends a report to the owner about the state of a particular device at the moment. It can be programmed to perform various actions at the desired time interval or according to an approved turn-on schedule. The entire smart home system can work offline, that is, without human intervention, communication with it occurs in several ways through:

  • Computer network;
  • Mobile phone;
  • By radio transmitter.

The choice of controller must be made depending on the architecture of the control system. That is, the whole complex can be:

  1. Centralized, which is controlled by a single controller with high performance and capabilities. It has its operating system based on a small computer mounted in a small plastic case. Depending on the configuration, it may have a built-in GSM module that is needed for remote access, as well as a touch screen with a push-button interface. To connect to the network there are all kinds of connectors;
  2. Decentralized (regional), consists of several control systems, that is, it includes several simpler controllers. Each of them performs fewer functions and is responsible for managing a specific room, room, or a group of instruments and devices for a specific purpose. It has a low-power electronic logic unit without an operating system. It is configured for elementary tasks and scenarios, which can be based on time or the state of the sensors. For example, a light sensor connected to it gives a control signal to turn on the lighting when it gets dark. The switching process itself, of course, is carried out through a relay.

What solutions does Arduino offer?

Many manufacturers produce sensors and devices compatible with Arduino, so the range of components for the Arduino Smart Home system is impressive:

  • Sensors for monitoring temperature, illumination at different times of the day, humidity, precipitation and atmospheric pressure.
  • Motion sensors.
  • emergency sensors.
  • Other devices and remotes.
Read also:  How to install and connect a grounded socket: learning to ground sockets

The Arduino Start kit (for most manufacturers - StarterKit) includes some indicators and sensors.

To execute commands sent by the Arduino-based Smart Home system, you need:

  • relays and switches;
  • valves;
  • electric motors;
  • 3-way valves with servo drive;
  • dimmers.

Basic configuration options

Constantly striving for perfection and automation, a person invents more and more new mechanisms for this. Also, this desire is aimed at reducing the size of devices without losing their functional features.Smart home based on Arduino controllers: design and organization of controlled space

For the controller controlling the mechanisms and for the entire smart home system, there are basic requirements:

  1. automatism;
  2. self-control;
  3. precise control, without making mistakes.

The configuration options for any such system depend on many factors, which have already been mentioned above, here are the options for systems that can be connected to the controller:

  1. Adjustment and control of lighting both in the room itself and in the adjacent territory, and in places of architectural structures;
  2. Climatic installations (air conditioning, ventilation, heating);
  3. Closing and blocking doors, gates and windows;
  4. Audio systems, and television, home theater;
  5. Management of curtains, blinds and sun-protection rolleta;
  6. Water supply system;
  7. Feeding pets and aquarium fish.

That is, everything lies in the desire of the client and his material capabilities.

Arduino Projects for Beginners

If you look at all Arduino projects, information about which is available on the Internet, you can divide them into several main groups:

Initial learning projects that do not claim to be of any important practical use, but help to understand various aspects of the platform.
Flashing LEDs - beacon, flasher, traffic light and others.
Projects with sensors: from the simplest analog to digital, using a variety of protocols for data exchange.
Devices for recording and displaying information.
Machines and devices with servo drives and stepper motors.
Devices using various wireless modes of communication and GPS.

Projects for home automation - smart homes on Arduino, as well as individual home infrastructure controls.
Various autonomous cars and robots.
Projects for nature research and agricultural automation
Unusual and creative - as a rule, entertainment projects.

For each of these groups, you can find a wide variety of materials in books and on websites. In this article, we will begin our acquaintance with the description of the simplest projects, which are recommended to start with for beginners.

How to create an Arduino project

Smart home based on Arduino controllers: design and organization of controlled space

An Arduino project is always a combination of an electronic circuit, some related hardware and mechanical devices, a power system, and software that controls all this chaos. Therefore, when starting work, you must firmly understand that creating a device alone, you will have to become a programmer, an electronics engineer, and a designer.

If we are not talking about a training project, then you will definitely come across the following stages of implementation with the following tasks:

  • Come up with something that will be useful and (or) interesting to others. Even the simplest project has some benefit - at least it helps to learn new technologies.
  • Assemble the circuit, connect the modules to each other and to the controller.
  • Write a sketch (program) in a special environment and upload it to the controller.
  • Check how everything works together and fix any bugs.
  • After testing, prepare to create a finished device. This means that you need to assemble the device in some kind of usable case, provide for a power supply system, communication with the environment.
  • If you are going to distribute the devices you have created, you will also have to deal with the design, the transportation system, think about the safety of use by untrained users and educate these same users.
  • If your device works, it has been tested and has some advantages over other solutions, then you can try to turn your engineering project into a business project, try to attract investments.

Each of these stages of creating a project is worthy of a separate article.

But we will focus on assembly stages of electronic circuits (basics of electronics) and controller programming

Electronic circuits

Electronic circuits are usually assembled using prototyping boards that hold the components together without soldering or twisting. You can find out how the modules and connection diagrams work on our website. Typically, the project description specifies how to mount the parts. But for most popular modules, there are already dozens of ready-made schemes and examples on the Internet.

Programming

Sketches are created and flashed in a special program - a programming environment. The most popular version of such an environment is the Arduino IDE. On our site you can find information on how to download, install and configure this program.

Think tank of the "Smart Home" system

In fact, these systems have all the necessary equipment, and with the help of technical controllers, the information received from it is processed, thanks to which it is possible to manage each process separately.In our lessons, we will take Arduino, Wemos, Raspberry and other microcontrollers available for purchase at low prices as a basis.

Specialized power elements make it possible to use an uninterrupted supply of electricity, and when using special elements, the operation and regulation of the operation of household appliances under the control of the system is carried out.

The presence in the system of equipment with remote control makes it possible to perform general control over all devices that are controlled by the system. They come in the form of stationary or portable modules. The portable module is more practical because it allows remote control using any electronic device, such as a phone or laptop.

At the same time, the owner can control any process that occurs in the room, at a distance from the dwelling where this system is directly installed. Thanks to this function, the owner can set any action program for the smart home for a long time, and as a result, simply control the ongoing processes. This may include both air conditioning of the premises, and its automatic lighting at a certain time interval, and other similar automated functions, including a security system.

Smart home based on Arduino controllers: design and organization of controlled space

Data transfer from Arduino

First, we will make our arduino send data to a separate site that will display the data received from the arduino sensors. For this, the site for the Internet of things - dweet.io is perfect.

This site can display a graph of temperature, light, humidity, anything that changes over time.

Let's try to transfer data on changes in the temperature of our room to it.

You can do without creating your own key, and in the code (where you need to insert the key), you can write anything you like and the site will still display a graph of changes in the sent data over time. But in order to create a network of online devices in the future, you will have to take this site more seriously.

On the main page you can see the possible options for the work of this site

Smart home based on Arduino controllers: design and organization of controlled space

Smart home based on Arduino controllers: design and organization of controlled space

Also create your account and key network for different devices so that you don't have to worry about data security and can find out what's going on in your house from any device.

Read also:  Vacuum cleaner defoamer: types of products and rules for use + the best manufacturing companies

Smart home based on Arduino controllers: design and organization of controlled space

Smart home based on Arduino controllers: design and organization of controlled space

Common brands of controllers

The quality of command execution and the functionality of any smart home system directly depends on the controller and its manufacturer.

Aries

Smart home based on Arduino controllers: design and organization of controlled spaceThis 100 PLC modification smart home controller is a basic solution. A feature of which is the use of the Modbus protocol. It is he who organizes the exchange of information between communication channels. The controller "Aries" is designed for the use and creation of automatic systems for residential buildings and cottages with no more than two storeys, street lighting, floor heating, and alarm devices. The logic controller is connected to the operator panel and the I/O device via the RS-485 interface. Programming takes place by the owner himself, unless, of course, he has such a desire. The menu consists of six informative control blocks, each of which is responsible for a specific segment. There is a function of sending SMS using an element of the GSM controller.Notification occurs in case of emergency situations with power supply or malfunction of the supply circuits of individual key elements of the "smart home" system.

VeraEdge

The model of the Vera family is distinguished by a large margin of user confidence, due to the use of their equipment in this industry for many years. The main advantages of this model are:

  • High performance;
  • Ergonomics;
  • Compactness;
  • Reliability.

Smart home based on Arduino controllers: design and organization of controlled spaceThe developers used here a new platform that gives high performance indicators called SoC, its frequency is 600 MHz, and the RAM is increased to 128 MB. The main innovation is implemented on the Z-Wave Plus chip, which is the fifth generation of these microcircuits. The user can simultaneously control and manage the mechanisms, the number of which has been increased to 200 devices. The VeraEdge controller is equipped with a Wi-Fi communication module. One of the drawbacks that still exist in any system can be considered the lack of an integrated uninterruptible power supply unit, which can be purchased and installed additionally.

Arduino

Smart home based on Arduino controllers: design and organization of controlled spaceThe Arduino controller offers a rather unusual, but quite logical solution for controlling a smart home. Some craftsmen easily connect and install with their own hands, this is possible due to the ease of working with it. The logic controller has very small dimensions. And also in the kit there are sensors, sensors, as well as all kinds of indicators. The developers almost managed to bring the optimization of the device to perfection. All sensors have a wireless connection and are characterized by minimal errors in operation, and for control there are blocks that have an unusual appearance, with a convenient and unique web page. It is also available as a mobile application.

Siemens

These systems of German quality are used not only for automation of systems in everyday life, but also in production, in industry. The controller of this company is expressed by the LOGO line involved in the creation of a “smart home”. This is the traditional two-component model. One of which is made in the form of a keyboard with a display and is an input-output system, and the second allows you to perform manipulations and connect to the controller through a convenient and reliable wired interface. The company also offers independent development of certain operating modes, for which a special Soft Comfort program is attached. When LOGO is used as a central controller, it can be used to create entire algorithms for the operation of circuits. Constantly new introductions and modifications improve the performance of this apparatus.

What would you like

The greatest desire of any gardener is to get the maximum yield with the minimum expenditure of labor. One solution to this problem is greenhouses. But even in this case, I want the beds to be watered, illuminated, and heated when necessary. And of course, an automatic ventilation system was organized to minimize the effort to open and close the windows.

Monitoring and tuning

Smart home based on Arduino controllers: design and organization of controlled space

Of course, first of all, a management system for all this highly intelligent economy is required. In addition, it is desirable to receive information about the current state directly either on a home computer or on a smartphone. For this purpose, the controller for the greenhouse on the Arduino will be used.

Control

In accordance with the desires, it is necessary to organize automatic control of floor heating (as the basis for heating plantings), opening vents, and moistening the soil.A lighting control system that lights it up if it's dark outside will be good.

What is Arduino

Arduino is an open, small electronic board with an easy-to-use processor and software. The platform reads incoming information, then, according to a previously entered algorithm, reshapes commands to various devices powered by electricity. For this, the Arduino programming language and the Arduino software (IDE) based on the Processing project are used.

The board's open source code allows the use of components from different manufacturers. To design a Smart Home system on Arduino, it is easy to select devices for user requests

People with minimal programming and electrical knowledge should pay attention to this system.

Smart home based on Arduino controllers: design and organization of controlled space

Principle of operation

Smart home based on Arduino controllers: design and organization of controlled spaceMany of us have heard of automation systems, but few have the right understanding of the operation of such numerous sensors and controllers. Such devices, provided they are properly planned, can control the operation of all appliances in the house, security, utilities, and so on. Moreover, in each case, the functionality of such a life support system will vary significantly depending on the specific requirements of the homeowner.

If, until recently, such systems had a high cost, which was explained by the complexity of the technology and the need to use special microprocessors and control software, today, on the Arduino platform, you can easily implement such simple life support systems that will have advanced functionality.

Platform components

Standard Smart Home includes the following components:

  1. The sensor part, which includes various sensors that can respond to temperature, humidity, movement, or various other events.
  2. The executive part, that is, devices that users or the system itself can control by sending appropriate commands to turn them on or off. This executive part includes various relays, electric motors, air cleaner control devices, and so on.
  3. The microprocessor is the “brain,” which coordinates and coordinates the work of all components.

The software is a set of instructions and simple applications with which the user can configure the program on their own or download ready-made presets and scripts.

Project for the system for different areas of the apartment

Before you start assembling an electronic system, you should draw up a plan for a smart home project on Arduino. For example, let's take a small house and try to draw up a scheme for the operation of a "smart complex". So, we need to ensure the intelligent functioning of different devices in different zones.

Smart home based on Arduino controllers: design and organization of controlled space

  • The entrance to the adjacent territory should be provided with automatic switching on of lighting in the dark, when the owners approach the house, also when leaving the house, when the door is opened. You will need: a motion sensor and a door open sensor.
  • Entrance hall of the apartment - when moving along the passerby, the lighting should automatically turn on. Required: motion sensor.
  • Bathroom. Automatic switching on of the electric water heater when the owners arrive home. The hood and lighting in the bathroom turns on when the door is opened. Required: sensor is moving
    ia and opening the door.
  • Kitchen. The lighting turns on when the tenant enters the room.
  • When you turn on the hob, the extractor should start at the same time. You will need a relay to install on the power wiring of the electric stove and a presence sensor.
  • Living rooms. Automatic switching on of light, temperature control by electric convectors in winter and air conditioners in summer. You will need a presence detector, a temperature and light sensor.

Rating
Website about plumbing

We advise you to read

Where to fill the powder in the washing machine and how much powder to pour