Categories: Featured Articles » Home automation
Number of views: 56774
Comments on the article: 6

Using Raspberry Pi for Home Automation

 

Using Raspberry Pi for Home AutomationAbout two years ago, the Raspberry Pi Foundation released a rather interesting device - a single-board computer, the size of which is slightly larger than a bank plastic card at a very attractive price. The novelty immediately gained immense popularity, the line of pre-orders for it stretched out for several months.

Raspberry Pi was presented in two trim levels: model “A” and model “B”. Both versions are equipped with a Broadcom BCM2835 ARM11 processor with a clock frequency of 700 MHz and a 256 MB / 512 MB RAM module. Model "A" is equipped with one USB 2.0 port, model "B" - with two. Model “B” has an Ethernet port. The BCM2835 processor also includes a graphics core. Video output is made through a composite RCA connector or through a digital HDMI interface.

The file system, kernel image, and user files are located on an SD, MMC, or SDIO memory card. The most attractive feature of the Raspberry Pi is its low power consumption (5V / 700mA), the presence of GPIO I / O ports with I2C, SPI, UART interfaces, as well as the ability to work remotely via Ethernet.

Currently, only the “B” model is released with 512 MB of RAM and Ethernet support. In addition, a new version appeared on sale, which differs from the previous model “B” in a more compact arrangement of components, the presence of 4 USB ports, an increase in the number of GPIO I / O ports and the absence of a composite video output. The appearance of model "B" and the new model of the Raspberry Pi computer is shown in Fig. 1

raspberry pi

Fig. 1

Why can I use such a device? First of all, it should be noted that the Raspberry Pi is, although not very powerful, but at the same time quite a full-fledged computer. By connecting a monitor, keyboard, mouse to it and installing any distribution kit of the Linux operating system, it can be used as a desktop computer for solving tasks that do not require powerful computing resources.

Raspberry Pi is quite suitable for use as a home media server, a storage server, the brain of a robot or machine, a home automation server (or the so-called "smart home").

The appearance of the Raspberry Pi immediately caused a stir around this device. When the passions calmed down a bit, and he appeared on free sale at an adequate cost, I decided to get to know this minicomputer better. For me, the Raspberry Pi was primarily of interest from the point of view of using it in a home automation system, the idea of ​​which was "ripe" for a long time and required practical implementation.

I use the term “home automation” because I strongly dislike the expression “smart home”. No, there is nothing wrong with the term “smart home”, but recently this concept has been very perverted.


A smart home is a complex “multi-circuit” system, which, in addition to executing various scenarios specified by the user, can make various decisions depending on a particular emergency situation. In other words, it is a “thinking” (of course, on a machine level) system. And lately I’ve called anything “smart home” - for example, GSM alarm, water leakage sensor, light control by motion sensors, etc. Yes, these are all separate components of a smart home, but not a smart home as a whole.

So, we will consider the structure of building a home automation system using Raspberry Pi (Fig. 2).

Raspberry Pi Application

Fig. 2Structure of building a home automation system using Raspberry Pi (click on the picture to enlarge)

The home automation system consists of a central server connected via RS485 interface with controllers installed in each room, and in turn, various control, monitoring, regulation and protection devices are connected to the controllers.

The advantage of such a network architecture is that there is no need to pull the wires from each device to the server, but rather connect the controllers to which they are connected with one UTP cable - one pair of wires of which is used for the RS485 interface, and the remaining pairs for powering the controllers and sensors. In addition, the logic of work is conceived so that the failure of any controller or even a central server should not affect the performance of the rest of the system.

Raspberry Pi is used as the central server of the home automation system. A Web server is installed on it, through which the user from any communication device (smartphone, laptop, tablet) through the browser can receive information about all the processes taking place in the house and, accordingly, manage them. Access to the Web server by entering the login and password can be obtained both from the home local network and from the Internet via a Wi-Fi router.

The serial port UART Raspberry Pi through a matching device via the RS485 interface connects controllers with a different set of inputs / outputs. In addition, a GSM modem can be connected to RS485 to access the system through a cellular or landline telephone network in case there is no way to get Internet access at the point where the user is located. Access to the system in this case is also done by entering a password.

Another device on the RS485 network is a radio module. Its purpose is to bind to the general automation system of all radio sensors and radio remote controls.

Raspberry pi
Home automation

Currently, the first version of the home automation system using the Raspberry Pi has been developed. In addition to the central server, it includes several types of controllers that have an RS485 interface for communication with the server:

  • Eight-channel temperature and humidity controller. The controller allows you to collect temperature and humidity readings from one DHT22 sensor and seven DHT11 sensors;

  • Four-channel temperature regulator (thermostat). The controller can control 4 loads both in manual mode and according to the set temperature parameters. Entering temperature values ​​is possible either directly on the controller or remotely via the web interface. Modes of direct and reverse type of channel control allow you to use the controller for both heating and cooling control;

  • The radio module is used to emulate remote controls and collect information from radio sensors. Allows you to emulate up to 5 remote controls and receive data from 10 radio sensors;

  • Universal controller. It has 4 independent inputs and outputs and two inputs for connecting temperature and humidity sensors DHT11 and DHT22.

There you will also find links to the description of the software installation for the Raspberry Pi, as well as to materials that describe the manufacturing technology of the controllers, which were described above. I would like to note that this project is completely non-profit, with open sources for circuit and software solutions and with technical support on the forum.

Mikhail Tikhonchuk

31.10.2014

See also on this topic:Differences between Orange pi and Raspberry pi boards, what to buy?

See also at bgv.electricianexp.com:

  • Differences between single-board computers Orange pi and Raspberry pi, what to buy?
  • Internet-controlled relays
  • Smart home on the LOGO controller from SIEMENS
  • About the technology and principles of Smart Home operation using the BeNext system as an example
  • What are Nextion displays and how to work with them?

  •  
     
    Comments:

    # 1 wrote: Alexei | [quote]

     
     

    It turns out, with this system you can control the heating in the house via the Internet?

     
    Comments:

    # 2 wrote: Sergei | [quote]

     
     

    It is possible and not only heating.

     
    Comments:

    # 3 wrote: Michael | [quote]

     
     

    Alexei, you can manage anything. Both through power relays in the controllers, and through emulation of remote controls. If you have control, for example, of roller shutters

     
    Comments:

    # 4 wrote: Alexei | [quote]

     
     

    Thank you, but roller shutters are irrelevant for me :) But heating control would be nice to implement.

     
    Comments:

    # 5 wrote: Gregory | [quote]

     
     

    An interesting solution! It is suitable as an alternative to commercial "smart homes" for those who can keep a soldering iron! I hope that someday I will make myself something similar, at least there is a very great desire.

     
    Comments:

    # 6 wrote: Michael | [quote]

     
     

    For a description of the new version of this system, see here - electromost.com/news/kompleksnaja_sistema_
    domashnej_avtomatizacii_na_raspberry_p
    i / 2016-01-29-140