Smart wifi light switch. Wireless switch, what is it and is it worth it to install. Strengths and weaknesses of the device

Good day, dear reader.

Some lyrics at the beginning. The idea of ​​a “smart” light switch is not at all new and, probably, this is the first thing that comes to mind for those who have begun to get acquainted with the Arduino platform and IoT elements. And I am no exception to this. Having experimented with circuit elements, motors and LEDs, I want to do something more applied, which is in demand in Everyday life and, most importantly, it will be convenient to use, and will not remain a victim of the experiment to the detriment of comfort.

In this article, I'll show you how I made a switch that will work like a normal one (i.e. one that is usually mounted on a wall) and at the same time allow you to control it via WiFi (or via the Internet, as is done in this case).

So, let's make a list of what you need to implement your plan. I must say right away that I intended not to spend much on components and chose components based on feedback on the forums and the price-to-quality ratio. Therefore, some components may seem out of place here for experienced electricians, but please do not judge strictly, because. I'm just new to electromechanics and would really appreciate comments from more experienced folks.

I also needed: a server with which the switch will be controlled via the Internet, an Arduino Uno with which I programmed the ESP, a router and consumables like wires, terminals, etc., all this can vary from taste and will not affect to the end result.

Prices are taken from Ebay, where I bought them.

And here is what the elements from the table look like:

Now you can draw up a connection diagram:

As you probably noticed, the scheme is very simple. Everything is assembled easily, quickly and without soldering. A kind of working prototype, with which you do not need to mess around for a long time. Everything is connected by wires and terminals. The only negative is that the relay did not fit into the switch socket. Yes, originally I planned to shove all this into the wall behind the switch to look aesthetically pleasing. But to my regret, there was not enough space in the socket and the relay simply simply did not fit either along or across:

Therefore, I temporarily moved the relay out of the socket until I found a suitable switch box with a socket to hide the iron inside. But there is nothing more permanent than temporary, right? So it all looks like this now:

Electrical tape will save you from electric shock ... I hope.

Now let's talk about the software part.

And before proceeding with the analysis of the code and details, I will give general scheme light bulb control implementation.

I hope someday I will rewrite everything and the communication will be based on a faster protocol than HTTP, but for a start it will do. Remotely, the light bulb changes its state in about 1-1.5 seconds, and from the switch instantly, as befits a decent switch.

Programming ESP8266-01

The easiest way to do this is with Arduino. You can download the necessary libraries for the Arduino IDE from GitHub. All installation and setup instructions are there.

Next, we need to connect the ESP to the computer, for this you need either a USB to Serial Adapter (such as FTDi , CH340 , FT232RL) or any Arduino platform (I had an Arduino Uno) with RX and TX outputs.

It is worth noting that the ESP8266-01 is powered by 3.3 Volts, which means that in no case should you connect it to the Arduino power supply, which are (often) powered by 5 Volts, otherwise everything will burn to hell. You can use a voltage reducer, which is shown in the table above.

The connection scheme is simple: we connect TX, RX and GND ESP to RX, TX and GND of the adapter / Arduino, respectively. After that, in fact, the connection is ready for use. The microcontroller can be programmed using the Arduino IDE.

A couple of nuances when using the Arduino Uno:

  • The Uno has a 3.3V output, but it was not enough. When ESP is connected to it, everything seems to work, the indicators are on, but the connection with the COM port is lost. So I used a different 3.3V power supply for the ESP.
  • In addition, UNO did not have any problems communicating with ESP, given that UNO was powered by 5V, and ESP by 3V.
After a few experiments with the ESP8266-01, it turned out that the ESP is sensitive to the voltages connected to GPIO0 and GPIO2. At the time of launch, they should in no case be grounded if you intend to start it normally. Learn more about starting a microcontroller. I did not know this and I had to slightly change the scheme, because. only these 2 pins are present in the ESP-01 version and both are used in my circuit.

And here is the program for ESP itself:

Show Code

#include #include #include #include #include extern "C" ( // this part is required to access the initVariant function #include "user_interface.h" ) const char* ssid = "WIFISSID"; // WiFi name const char* password = "***************"; // WiFi password const String self_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // token for minimal communication security const String serv_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // token for minimal communication security const String name = "IOT_lamp"; // switch name, read light bulbs const String serverIP = "192.168.1.111"; // internal WEB server IP bool lamp_on = false; bool can_toggle = false; int button_state; ESP8266WebServer server(80); // web server HTTPClient http; // web client const int lamp = 2; // Control the relay via GPIO2 const int button = 0; // "Catch" the switch via GPIO0 // function to ping the light bulb void handleRoot() ( server.send(200, "text/plain", "Hello! I am " + name); ) // function to handle invalid requests void handleNotFound ()( String message = "not found"; server.send(404, "text/plain", message); ) // Let there be light void turnOnLamp()( digitalWrite(lamp, LOW); lamp_on = true; ) / / Let there be darkness void turnOffLamp()( digitalWrite(lamp, HIGH); lamp_on = false; ) // Send manual on/off events to the server. void sendServer(bool state)( http.begin("http://"+serverIP+"/iapi/setstate"); String post = "token="+self_token+"&state="+(state?"on":"off "); // Based on the token, the server will determine what kind of device it is http.addHeader("Content-Type", "application/x-www-form-urlencoded"); int httpCode = http.POST(post); http.end (); ) // Change the state of the lamp void toggleLamp()( if(lamp_on == true) ( ​​turnOffLamp(); sendServer(false); ) else ( turnOnLamp(); sendServer(true); ) ) // Receive from the server enable command void handleOn()( String token = server.arg("token"); if(serv_token != token) ( String message = "access denied"; server.send(401, "text/plain", message); return; ) turnOnLamp(); String message = "success"; server.send(200, "text/plain", message); ) // Receive command from server to turn off void handleOff()( String token = server.arg(" token"); if(serv_token != token) ( String message = "access denied"; server.send(401, "text/plain", message); return; ) turnOffLamp(); String message = "success"; server.send(200, "text/plain", message); ) // Set the MAC to give the same IP void initVariant() ( uint8_t mac = (0x00, 0xA3, 0xA0, 0x1C, 0x8C, 0x45); wifi_set_macaddr(STATION_IF, &mac); ) void setup(void)( pinMode(lamp, OUTPUT ); pinMode(button, INPUT_PULLUP); // Important to do INPUT_PULLUP turnOffLamp(); WiFi.hostname(name); WiFi.begin(ssid, password); // Wait until we connect to WiFi while (WiFi.status() ! = WL_CONNECTED) ( delay(500); ) // Assign functions to requests server.on("/", handleRoot); server.on("/on", HTTP_POST, handleOn); server.on("/off", HTTP_POST, handleOff); server.onNotFound(handleNotFound); // Start the server server.begin(); ) void loop(void)( server.handleClient(); // Check if the toggle is pressed button_state = digitalRead(button); if (button_state == HIGH && can_toggle) ( toggleLamp(); can_toggle = false; delay(500); ) else if(button_state == LOW)( can_toggle = true; ) )


A couple of notes on the code:
  • It is very important to declare the GPIO0 pin as pinMode(button, INPUT_PULLUP), because in the circuit, we do not use a resistor for this button. And ESP has its own "wired" for these very purposes.
  • When catching the state of the button, it is desirable to set a delay when reading in order to avoid false positives at the moment of pressing.

Web server programming

Here you can give free rein to your imagination and use any available funds to create a service that will process requests sent by the switch and send requests to turn it on / off.

I used Yii for this purpose. I chose this framework for several reasons, I needed authorization (because the portal is available on the web) and role management (for future experimentation), and I just love it. And now my management portal looks like this:

To control a light bulb in the network reach, the server itself on the ESP would be enough. But I want to have logs, logic and other devices in the future, so it's better to use a separate server for control.

This is all about the portal, I think it makes no sense to write more about it, but if you have any questions, I will be happy to answer them in the comments.

Instead of a conclusion

Thank you if you read the article to the end and, perhaps, found something useful in it. I will be glad to councils and criticism. In general, it still seems to me that the bottleneck in the circuit is the 5V Adapter and I will be glad if you share your experience in solving such problems. As for the ESP8266-01, so far it has not caused me any complaints, except for the special use of GPIO pins. It has been working steadily for the second week. Success in projects.

From the article you will learn why you need a wireless switch, scope and varieties, device and principle of operation, advantages and disadvantages, selection criteria, how to connect with your own hands, circuits.

Wireless network switches fundamentally change the idea of ​​controlling lighting devices, simplify our life and make it more comfortable.

Until recently, such technologies were not available due to the high price and limited production.

At the present stage, there is a tendency to reduce their cost. That is why radio switches and their other analogues are increasingly perceived as an alternative to classic switches.

What is a wireless switch for?

Remote systems that provide remote control of certain devices are becoming more common. The wireless wall switch is no exception.

It was created to increase comfort, and for the elderly and people with disabilities, it is completely necessary.

With the help of such a device, you can easily control the lighting in the house, change the brightness, turn the lamps on and off.

In addition, thanks to the special design, there is no need to damage the walls and make large holes for mounting.

Scope of application

Traditional switches are gradually becoming a thing of the past due to the inconvenience of use, the complexity of connection and installation, as well as a small resource. Wireless analogs have the best qualities.

They are stylish and install in minutes.

The use of such products is relevant in the following cases:

  • When transferring an old switch, when pieces of furniture interfere with its installation. The new device is mounted anywhere in the room - on a wall, mirror, closet or other element of the room.
  • To eliminate electrical errors. When installing wiring, mistakes are often made that affect the comfort of living in an apartment or house. In such cases, it is not necessary to make a strobe or plan an expensive repair - you can install a wireless switch (with or without a remote control).
  • With a lack of space. The classic version - the switch is problematic to install on a cabinet or other piece of furniture due to the complexity of fastening. Wireless analogues are overhead, and their installation is available even for beginners. In addition, during the installation process there is no need to lay a cable and puzzle over its disguise. A radio switch can be placed anywhere, be it Coffee table, bar counter, bedside table or other piece of furniture.
  • in wooden houses. The advantage of buildings made using wooden materials, is indisputable. They are distinguished by durability, the ability to retain heat, as well as a low price. But when there are problems associated with increased security requirements. The best option is to install open wiring, but it spoils appearance interior and is subject to mechanical damage (including from rodents). Make hidden wiring wooden house and it's a problem. The best solution is the installation of wireless light switches that simplify the process of installing hidden wiring and save money.
  • To control lighting from multiple locations. There are situations when turning on the light must be done from 2-3 parts of the room. In order not to pull wires to each switch, it is better to use wireless devices. With their help, lighting control is simplified and time for installation work. If desired, you can put wireless switches with a remote control.
  • If necessary, install additional switches. It happens that after the completion repair work the chosen location does not suit and the installation of an additional device to control the light is required. Installing a wireless switch solves the problem.
  • To turn on / off the light at long distances. How to be in a situation where turning on and off the lamp must be done from another room or even from the street? Pulling wire to install an additional switch is expensive and unsafe, and the capabilities of the new technology avoid such problems. A feature of the radio switches is a large operating range - up to 350 m (depending on the model). Management can be done using a simple remote control, which for convenience is made in the form of a key fob.
  • In order to preserve the design of the room. If mounting the switch in a recess is not possible, you have to install overhead types of products that spoil the appearance of the room and do not look very solid. The solution to the problem is the installation of a wireless device, which is thin and fits perfectly into the interior.
  • As an alternative to conventional devices. With the next repair in an apartment or house, I want to make some innovations in the design, make life more comfortable. One way is to install a wireless remote switch. Such products will cost more, but they are easy to install, have a solid appearance and provide ease of lighting control.

Varieties

Wireless switches do not differ in variety, but there is still a certain choice.

They are classified according to three main features:

  • By type of management;
  • If possible, adjust the level of illumination;
  • By the number of lighting devices they control.

Taking into account the classification mentioned above, the following types of wireless switches can be distinguished:


The device and principle of operation of the main elements of the device

The wireless switch consists of the following elements:


Electrical wiring is required only for the lamp and power supply to the receiver of the product. As noted above, the signal is transmitted using an infrared pulse or radio waves.

The second control option is more preferable, because control is possible at a great distance and even from another room.

Installation of the product is carried out according to a simple scheme, for the implementation of which you do not need to have deep knowledge in the field of electrical engineering.

The old switch can be left as an additional on / off source when the battery in the control panel is low.

Light control is done in the following ways:

  • By touching a special touch panel;
  • By pressing a mechanical button;
  • Sending a signal from the remote control or phone.

With remote control from the remote control, the signal is transmitted at radio frequencies, which eliminates the presence of interference and increases the reliability of the device.

Walls, furniture and other elements of the interior will not interfere with the command to turn on or off the light source.

Using the remote control, you can simultaneously control a group of wireless switches (up to 8 pieces). Thanks to this, you can not walk around the apartment or house to turn off the light somewhere in the toilet or bathroom.

The range of the remote control depends on many factors - the model of the product, the design features of the building, the materials used in the manufacture of partitions.

Most often, the signal is transmitted at a distance of twenty to twenty-five meters. The transmitter is powered by batteries.

The disadvantage of the remote control is that it is constantly lost and the lighting has to be controlled manually.

That is why touch-sensitive wireless switches that respond to a normal touch and are used in Smart Home systems are gaining more and more popularity.

Some radio switches can not only turn the lamp on and off, but also adjust the level of illumination. In this case, the scheme is supplemented with one more element - .

The regulation process is carried out using a wireless switch. To change the light level, press and hold your finger on a button or key.

Advantages and disadvantages of wireless switches

Despite the ease of use, wireless load switches (in our case, lighting) have not only advantages, but also disadvantages. But more about everything.

  • Ease of installation. For installation and connection, it is not required to gouge the walls and lay a separate "branch" of electrical wiring.
  • The ability to control several light sources at once from the remote control or via a smartphone.
  • Large range of action. The control signal in an open area can reach the receiver at a distance of up to 30 meters. At the same time, walls or pieces of furniture are not an obstacle.
  • Safety for adults and children. Even accidental damage to the structure does not pose health risks. The operating current in wireless remote switches is minimal and not hazardous to health.
  • The cost of such products is higher than the classic "wired" switches. Conservatives and conservatives prefer familiar products.
  • Inability to control due to low battery in the remote control or inability to control due to poor Wi-Fi connection.

Features and principle of operation of the remote light switch

Let's take a closer look at the wireless control system. It includes a set of equipment that is used to control the level of illumination in an apartment or house.

Not used for control standard switch, but a special remote control or telephone (this was partially mentioned above).

The control panel (depending on the model) can be designed for a different number of channels. It can act on one or a whole group of lamps (up to several dozen).

In the most advanced systems, switching on is done using a motion sensor that signals the need to turn on the light if a person approaches the controlled area.

If you set up the motion sensor correctly, it will only respond to a person.

The remote switch is based on a radio transmitter. It is he who transmits the on / off signal to the lighting devices.

The range, as noted above, in most devices is up to 30 meters. But on sale you can find models that can transmit a signal at a distance of up to 300 meters.

The radio transmitter receives a signal from the remote control, and then transmits it to the light sources. The remote control, as a rule, has two channels, but there are also eight-channel models.

The control can also be carried out using a switch in which the transmitter is built.

Radar is often included with a wireless remote device. It is used to connect the remote control and sockets. It can be controlled via mobile phone. Such devices are called GSM-switches.

Management can be done in one of the following ways:


Features to look out for when choosing

When buying a wireless remote switch, you should pay attention to the following parameters:

  • The type of light bulbs that the device controls;
  • Material, color and appearance of the case;
  • Working voltage;
  • Number of channels;
  • Radius of action;
  • Dimensions;
  • Rated current;
  • Equipment.

You should also pay attention to the following criteria:

  • Operating frequency range;
  • signal transmission method;
  • The presence of an encoding;
  • Transmitter power type;
  • Estimated battery replacement time;
  • fastening method;
  • Working temperature range;
  • Price.

What does the market offer?

A wide range of wireless remote switches allows you to choose a product based on price, features and appearance.

Below we consider only a few models that the market offers:

  • Fenon TM-75 is a remote-controlled switch made of plastic and rated for 220 V. The features of the device include the presence of two channels, a 30-meter range, a remote control and a delayed turn-on function.
    Each channel can be connected to a group lighting fixtures and manage them. The Fenon TM-75 wireless switch can be used with chandeliers, spotlights, LEDs, and other appliances powered by 220 volts.
  • Inted 220V is a wireless radio switch designed for wall mounting. It has one key and is installed in combination with the receiving unit. The operating voltage of the product is 220 Volts, and the range is 10-50 meters. The wireless light switch is mounted using self-tapping screws or double-sided tape. The body is made of plastic.
  • INTED-1-CH is a light switch with remote control. With this model, you can control the light sources remotely. The power of the lamps can be up to 900 W, and the operating voltage of the product is 220 V. Using the radio switch, you can control the equipment, turn on and off the light or alarm. The product is based on a receiver and a transmitter. The latter has the form of a key fob, which has a small size and transmits a signal at a distance of up to 100 m. The body of the product is not protected from moisture, so additional protection must be provided for outdoor installation.
  • Wireless Sensor switch controlled via remote control. The product is mounted on the wall, differs in small dimensions and is made of tempered glass and PVC. The operating voltage is from 110 to 220V, and the rated power is up to 300W. The package includes a switch, remote control and bolts for attaching the accessory. The average life cycle is 1000 clicks.
  • Inted 220V for 2 receivers - wireless light switch for wall mounting. Management is made by means of two keys. The body is made of plastic. The operating voltage is 220 V. The number of independent channels is 2.
  • BAS-IP SH-74 is a wireless radio switch with two independent channels. Management is done using mobile phone on operating system Android. To work, you need to install the BAS application. Model SH-74 is used to control incandescent lamps with a power of up to 500 W, as well as fluorescent light bulbs (power limit - 200 W).
  • Feron TM72 is a wireless switch that controls lighting at a distance of up to 30 meters. Light sources are combined into a receiving unit, and switching on and off is done using the remote control. The TM72 model has two channels, each of which can be connected to a specific group of devices. The product has a large power reserve per channel (up to 1 kW), which allows you to connect various types of light source. A big plus of the model is the presence of a delay equal to 10 to 60 seconds.
  • The Smartbuy 3-channel 220V wireless switch is designed to connect light sources to three channels with a power limit of up to 280 W. The rated supply voltage is 220 V. The control is carried out from the remote control, which has a range of 30 meters.
  • Z-Wave CH-408 is a wall-mounted radio switch that allows you to program various lighting control scenarios. If necessary, up to eight switches can be connected to it. Of the additional features, it is worth highlighting the management of Z-Wave devices (up to 80) and ease of configuration, regardless of the main controller. The device is powered by two batteries, when they are discharged, a corresponding signal is given. The firmware is updated via the Z-Wave network. The maximum distance to the controller should not exceed 75 meters. Protection class - IP-30.
  • Feron TM-76 is a wireless light switch that is controlled remotely using a radio signal. The receiver is connected to light sources, and the remote control controls the receiving unit at a distance of up to 30 meters. The Feron TM-76 model has three independent channels, to each of which you can connect your own group of lighting fixtures. Management in this case will be carried out separately, using the remote control. The maximum power reserve is up to 1 kW, which allows you to connect lamps various types(including incandescent). The operating voltage is 220 V.

How to connect a DIY wireless remote switch

Consider the procedure for connecting a wireless switch using the Zamel RZB-04 as an example.

The following items are included with the model:

  • 2 channel radio small sizes(type ROP-02);
  • 2-channel 4-mode radio switch (type RNK-04);
  • Fastening for installation of the product (dowels with self-tapping screws, as well as foamed double-sided tape).

The receiver can operate in five different modes:

  • Inclusion. When the key is turned on, one or more lamps are ignited. You can set the inclusion to any of the positions of the keys.
  • Shutdown. The principle is similar to that discussed above. The difference is that when you press the key, the light turns off.
  • Monostable. In this mode, the light will be on only while the button is pressed. When released, the lamp turns off.
  • Bistable. In this case, each press leads to a change in state - switching on and off occurs cyclically.
  • Temporary. Here, after pressing the key, the light will burn for a certain time. This option is useful when installing a wireless switch in an entryway, bedroom, or long hallway. At the entrance, you can turn on the light, walk a certain distance (walk to the bed), after which the light will turn off.

To properly connect the receiver, carefully study the diagram. First, apply voltage (connect phase and zero). Only a phase wire is laid to the switch, without zero, therefore its installation is carried out at the place where the lamp (chandelier) is installed.

The second option is preferred. Before performing this work, it is recommended to turn off the electrical power supply using the machine and check the absence of voltage.

Now you need to make an unbreakable phase, for which the phase is connected to one of the wires heading to the chandelier. To ensure maximum reliability, use VAGO terminal blocks.

When performing work, a wiring diagram for the remote switch should be at hand.

It shows how to connect the device:

  • To contact "L" it is necessary to bring a phase wire. At the same time, it is not necessary to conduct it through the switch - the product operates in a constant mode.
  • Connect the neutral conductor, which is taken from the junction box, to the “N” terminal.
  • A phase is connected to the “OUT1” contact, which goes to a group or one lamp. Here you need a 0th conductor, which can be taken from the junction box or receiver (terminal N).
  • To "OUT2" connect the phase that goes to the second group or one lamp. As in the previous case, zero is taken from the junction box or from the N terminal block of the receiver.
  • Connect an impulse switch to "INT1". The peculiarity is that when pressed, it sends only a short-term signal. After operation, the operating mode of the 1st group of lamps changes. Thanks to this feature, the ROP-02 receiver can be controlled using a remote control or a stationary impulse switch.
  • To "INT2" it is required to connect an impulse switch (one or a group). After clicking on it, the mode of operation of the 2nd group will change. The principle here is the same as described above.

Now you need to combine the remote light switch with the receiving device, connect them to each other and decide on the mode of operation. To do this, you first need to supply electricity.

Now select the appropriate switch mode. Most often, the standard option is suitable - when the switch is moved up, it turns on, and down, it turns off.

To program this mode, do the following:

For ease of use, the double-sided adhesive tape is divided into four small squares, which are glued around the perimeter of the product, you must first remove the protective layer. It remains to put the switch in the chosen place according to the level.

The installation of the wireless remote switch is completed, and you can put a test lamp, and then check the system's performance.

To do this, switch the key up - the light should light up, and down - go out. When the switch is activated, the indicator lights up.

Wireless remote switches until recently belonged to the category of new and inaccessible technologies. With the growth of production and competition, the price decreases, which makes the purchase affordable for everyone.

The main thing is to carefully approach the choice of a product, understand the main parameters and give preference to models from trusted manufacturers.

Hello, dear readers and guests of the Electrician's Notes website.

In my past publications, I introduced you to and touch, controlled both manually and from the control panel.

But today I would like to draw your attention to the relay (switch) Sonoff of the Basic version with the ability to control directly from a mobile phone via a Wi-Fi network or the Internet.

The Sonoff Basic relay is a small device (88x38x23 mm) that can be placed behind the ceiling space, in a building niche, or in the bowl of a chandelier or lamp without any problems.

Its cost at the time of publication of the article is a little less than 300 rubles. As you understand, this is quite acceptable money, moreover, for such a modern device. I bought it on the well-known trading platform Aliexpress (the link will be at the end of the article).

The kit included two protective covers with mounting screws, but, unfortunately, there were no instructions.

Sonoff relay has the following specifications, some of which are displayed directly on its body:

  • maximum controlled load current 10 (A)
  • supply voltage from 90 (V) to 250 (V)
  • wireless standard 802.11 b/g/n
  • security protocol WPA-PSK/WPA2-PSK
  • operating temperature from 0°С to 40°С
  • weight about 50 g

Sonoff Basic Relay Capabilities:

  • load management via Wi-Fi
  • Internet load management
  • load control according to a given timer, both with direct and reverse countdown
  • load management from multiple mobile phones

These are the possibilities the Sonoff relay has. It can be safely used in smart home systems and for various other needs and requirements.

First, I will tell you how to connect Sonoff, and then we will check all its declared control methods in practice.

So let's go.

Installation and connection of the Sonoff relay

For the operation of the Sonoff relay, it needs a supply voltage of 220 (V), which means that it can be installed without problems in a place convenient for you, for example, in a chandelier bowl or directly under stretch ceiling, as well as directly in the junction box, if there is enough space.

The relay has two mounting holes to mount the relay to a surface.

The Sonoff relay wiring diagram is very simple.

On the terminals (L) and (N) from the side (Input-Input), the phase and zero of the supply voltage 220 (V) are connected, respectively. Naturally, when connecting, do not forget about.

Please note that the wires to be connected must have a cross section of no more than 1.5 sq. mm. But I still tried to connect wires with a cross section of 2.5 sq. mm. As a result, a rigid (single-wire) wire can still be connected without problems, but a flexible (stranded) wire is already inserted into the terminal with great difficulty, so it had to be flattened and deformed a little.

For example, I used a power cable of the PVS brand, which just the same has a cross section of 2.5 sq. mm. At the other end of the cable there is a plug, which I will later plug into any outlet with a voltage of 220 (V).

On the terminals (L) and (N) from the side (Output-Output), the phase and zero load are connected, respectively.

For the convenience of connecting the load, I connected a socket to the relay output.

By the way, terminal covers not only have a protective function, but also play the role of clamps for power wires or cables.

This is how it all turns out nice and neat. Sonoff relay connected.

As a load, I connected led lamp, about in one of his articles.

Here is a simple example of a Sonoff relay wiring diagram for a group of luminaires.

By the way, it is not necessary to use only a lamp or a group of lamps as a load. Any other load that does not exceed the rated current 10 (A) can be safely connected to the output terminals. And if you still need to control a load that has a current value above 10 (A), then it can be connected to a contactor, and with the help of a relay you can already control the coil of this contactor.

In this regard, we can add that when using a contactor, you can control at least a single-phase load, at least a three-phase one, at least with alternating current, even with direct current.

It will look something like this.

Thus, the scope of the Sonoff relay is very wide and varied. It can be controlled by at least one light bulb, even a powerful single-phase electric heater, even a three-phase electric motor, etc. It all depends on your needs and requirements.

And now let's look at all the possibilities of controlling the Sonoff relay in more detail.

I will not open the relay and look at its device, there is already enough information on the Internet on this subject - look at the relevant electronics resources. And judging by the reviews, the performance of the relay is quite decent. By the way, who is interested to know, the relay is assembled on the basis of the well-known Chinese microcontroller ESP8266.

Load management via phone via Wi-Fi network

Before I talk about controlling the relay via Wi-Fi, I will say that it can also be controlled manually. To do this, on its body there is a small recessed black button. So, with one short press of it, the relay turns on, and when it is pressed again, accordingly, it turns off. Moreover, for this it is not necessary that the relay be connected to a Wi-Fi network - it will also be controlled in Offline mode.

But in addition to this, the button also carries other functionality, which I will discuss below.

To implement the ability to control the load via Wi-Fi and the Internet, you need to install the eWeLink mobile application on your phone. This app is available for both Android and iOS devices. To facilitate the search for the application, you can use the necessary QR codes on the package.

For Android devices, the eWeLink app can be downloaded for free from Google Play and install it on your phone without any problems. The program interface supports Russian.

For iOS devices, this app is available in App Store. I have not tried to download and install this application on an iPhone or iPad, so if you have tried this application on iOS devices, please write in the comments about the results.

After installing the eWeLink application, you will need to immediately register, indicating the country and your email address. In this case, the phone must be connected to the Internet.

After that, a verification code will be sent to the mail (valid for 30 minutes), which must be entered in the corresponding line "Email code". On the same page, you must enter a password to enter your future account (at least 8 characters).

By the way, letters reach the mail services Mail.ru and Mail.yandex.ru (Yandex-mail) without problems. But as far as I know, letters with a verification code do not always reach the Gmail.ru (Google mail) mail service, so keep this in mind.

Then it is necessary to pair the relay and the router by holding the same button on the switch body for a long time (for 5 seconds), after which the green LED on the relay will blink. Put a tick on the first connection mode and click "Next".

Now you need to select our Wi-Fi network from the list and enter a password from it. In order not to enter a password each time, you can check the "Remember password" box. Click "Next", after which the search for our device and its registration will begin (in time it took me no more than 2-3 minutes).

After successful pairing, the relay automatically transfers data to the Chinese cloud (Amazon AWS or Coolkit), which makes it possible to control it via the Internet. But I will return to this a little later.

As you can see, our relay is now displayed in the list of all devices (so far it is the only one in the list, but others will appear very soon).

When the relay is online (on the network), the green LED on its body is always on. As soon as the LED starts to blink, it means that the connection with the router or the Internet is lost. Just by this indicator, it is convenient to determine whether the relay is in the network (Online) or not (Offline).

While I was testing this device, I did not notice any problems with the loss of the network. The device is always online and responds stably to control commands.

Now you can try to turn on the relay through the phone. To do this, click on "Relay 1". Immediately, a red inscription appeared stating that the eWeLink application needs to be updated, although the update is not displayed on Google Play.

We go into the device settings (three dots in the right corner) and see that the application has the current version 1.5.2, and a newer version 1.5.5 is available. Click on the "Download" icon and the application update begins. After the update, the red inscription disappears, and in the settings we can see the new current version 1.5.5.

Remember!!! The main condition for the operation of the relay is the availability of Internet access.

If Internet access suddenly disappears, then the green LED on the relay case will flash, and the application will display the Offline mode on its tab, i.e. not available for management.

So, to turn on our "Relay 1", you need to enter it and click on the round virtual button in the center of the screen. Moreover, the relay can be controlled from general list all devices by clicking on the corresponding small button (on the left). In general, whoever likes it.

When the relay is in the off position, the button has White color with a gray background around it. When the relay is on, the button changes its color to green, and the background around it turns blue.

In addition to the banal principles of control, you can set the time to turn on or turn off the relay by timer by setting the appropriate date and time for its control.

Moreover, I was surprised that the relay is triggered by a given timer even when it is offline (Offline), which means that all the specified timer programs are stored directly in the relay's memory.

Click on the "Add timer" button and go to the timer settings page. Each timer is configurable to either turn the relay on or off. There are two options for setting the timer:

  • single (single operation on a given date and time)
  • repeated (periodic triggering on a given date and time, including specifying specific days of the week)

In addition to the countdown timer, there is a countdown timer. Very necessary functionality for certain purposes. It is configured similarly to a direct timer, only with the possibility of a single operation.

In addition to the forward and reverse timers, there is a cyclic timer in the "Settings" tab (three dots in the right corner).

In this tab, you can configure various options relay operation cycles. I will not talk about this in detail, because. everything here is simple and intuitive.

The total number of configured timers, including the cyclic timer, can be no more than 8. And be careful, because. if different timers are superimposed on each other, none of them may work!!!

Also in the settings you can specify in which position the relay will remain if the 220 (V) power is suddenly turned off from it. There are three options here. By setting the appropriate checkboxes, you can choose that when the 220 (V) power reappears, the relay can either turn on, or turn off, or remain in its original state.

By the way, this is a very handy feature. Just remember the nuance, which, when the 220 (V) power disappears and reappears, for some reason always turns on, and even when it is in the off state. And imagine that you are not at home, the voltage in the network “blinked” a little and the controller turned on the chandelier on its own. Here such an incident will not occur, because. in this case, everything can be customized to your needs.

In addition to the above, all your connected devices in the eWeLink application can be grouped together and combined in various scenarios.

Is it possible to control the relay from several phones at once?

Can! Naturally, at the same time, the eWeLink application must be installed on each phone.

There are two options here. The first option is to log into the eWeLink application with the same name and password from different phones and control the relay.

True, if you enter the application on one phone, and then at the same time enter the application under the same login and password, but on another phone, then an error will occur on the first phone and the application will automatically exit. At the same time, the second phone remains in the application and can be used to control devices.

At the same time, I would like to note that when the relay is controlled from one phone, its status is displayed almost instantly on all phones that are connected to it.

Internet load management

In addition to controlling the relay via a phone via a Wi-Fi network, it can also be controlled via the Internet from anywhere in your location, i.e. absolutely from anywhere in the world where there is Internet access.

So, to control the switch via the Internet, you need to log in to the same eWeLink application using your username and password that you specified during registration. And then everything by analogy. The same application, the same settings, the same control buttons, etc., the only difference is that you are not at home within the coverage area of ​​your Wi-Fi network, but at a distance of hundreds and thousands of kilometers from home.

A little about the cloud.

But still, you will not be able to control the relay without the Internet, because. control is not through a local network, but through the Internet, i.e. the same Chinese cloud that I mentioned above. And it doesn’t matter if the control is via Wi-Fi or via the Internet, the control always goes through the cloud, and access to the cloud requires Internet access.

In this regard, various craftsmen have already figured out how to untie this device from the Chinese cloud or make it control only through the local home network. For those who are interested, this information can be found on certain resources.

By the way, if you need a similar device, but with additional function radio remote control, you can order the Sonoff relay RF version.

If you want to control the load where there is no Internet at all, then you can use the Sonoff version G1 relay (GSM / GPRS with SIM card support). Also, this manufacturer has available relays with temperature and humidity sensors Sonoff ТН10/ТН16 and two-channel (for controlling two independent loads) Sonoff Dual relays.

In general, the manufacturer Sonoff has a lot various devices, I will tell you about some of the most interesting and significant on the pages of my site, so subscribe to the newsletter so as not to miss interesting releases.

You can buy the Sonoff relay here:

  1. Sonoff Basic: https://goo.gl/jXyNm3
  2. Sonoff RF (with radio control): https://goo.gl/TRPqN6
  3. Sonoff G1(GSM/GPRS with SIM support): https://goo.gl/EkpTdp
  4. Sonoff ТН10/ТН16 (temperature and humidity sensor): https://goo.gl/MWAL5p
  5. Sonoff Dual (dual channel): https://goo.gl/a7rV56

And already by tradition, a video based on the materials of the article, where you can more clearly see the configuration and control of the Sonoff relay:

A "smart" switch is indispensable for people with disabilities, including the elderly. It will also come in handy for those who often remember the lights on on the way out of the house.

The principle of operation of a switch controlled by a smartphone

The device consists of two blocks - a receiver and a transmitter. The function of the receiver is performed by the controller (switch), equipped with a Wi-Fi adapter. By radio signal, it closes or opens the contacts of the power wires.

The role of the transmitter can be played by:

  • Wi-Fi light switch placed on the wall;
  • special keychain;
  • router (it receives signals via the Internet).

Advantages of the wireless switch:

  • no need for cable laying;
  • control of all lighting fixtures from one computer or phone;
  • automatic switching on / off of lighting at a set time according to a given program;
  • having feedback.

The touch switch is convenient to use, and in case of mechanical damage to the case, it is completely safe for humans. Due to the lack of power cables connected to it, electric shock is excluded.

The range of the device is from 30 to 160 meters. This indicator depends on the thickness of the walls. The equipment works reliably with all types of lamps: incandescent, LED, energy-saving.

Order modern "smart" Wi-Fi light switches and make your home more comfortable.

Technological progress has brought new, more advanced ways to control light. Wireless technology has replaced the old-style switches. The most modern way to transmit signals is via Wi-Fi. The technology involves the transmission of digital data over radio channels. A Wi-Fi switch is used to transmit commands.

Advantages and disadvantages

Wi-Fi devices are characterized by the following positive qualities:

  1. There is no need to lay a dedicated branch of electrical wires.
  2. Lighting devices can be controlled centrally - from one command post. Smartphones, computers, tablets or remote controls are used as a control device remote control. Smartphones and other electronic devices require special software, which can be downloaded from the Internet or installed from the installation disk.
  3. Extensive coverage area. The digital radio signal penetrates even through walls.
  4. System security. In case of damage to the structure, a person is not threatened with a strong electric shock. The current strength is too small to harm the human body.

Types of devices and manufacturers

The range of Wi-Fi light switches is not too diverse. However, products are classified according to a number of criteria:

  1. The switch is controlled by mechanical or electronic keys. In the latter case, we are talking about a touch monitor. The keys are located on the remote control.
  2. Switches are available with or without dimmers. This device allows you to adjust the brightness of the light by changing its intensity. The setting is carried out by holding or scrolling the corresponding button.
  3. The switch can provide control over one, two or three groups of lighting fixtures. The prices for equipment capable of managing groups of instruments are disproportionately high.

There are several dominant manufacturers of wireless technology for light control on the market:

  1. Legrand (France). The company's product range includes, in particular, a product line called Celian.
  2. Vitrum (Italy). The Italian company uses Z-Wave technology to automate the processes of controlling light in a smart home.
  3. Delumo. Products from a Russian company that produces switches, dimmers and thermostats.
  4. noolite. Switches of the Belarusian production.
  5. Livolo (China). The Chinese company produces specialized devices for automation, including for "smart home". The range includes products for single and double frames for switches.
  6. Broadlink. The Chinese company manufactures a wide range of lighting control products.
  7. Kopou. Another company from China offers a dimmer in the form of a key fob.

Wiring diagram

Smart light switches are easy to install. If desired, they can be mounted by hand. You just need to strictly follow the requirements of the instructions. Installation will take just a few minutes.

The installation process includes two steps:

  1. Installing a signal receiver.
  2. Installing the control button (that is, the switch itself).

The receiver has two to four wires. To determine which of the wires is the input, you should read the instructions. The other wires are outputs (a dual switch will have a pair of these wires). Installation involves breaking the phase that supplies power to the lighting fixture. Next is the connection to the electrical circuit.

If there is more than one lighting group, the actions are as follows:

  1. We supply neutral wires for lighting.
  2. We branch the phase on Wi-Fi.
  3. We direct the phase separately to each group of fixtures.

The switch is installed by a series of sequential operations. First, drill a hole in the wall. Next, we install a plastic socket in the recess. The installation process here is no different from installation conventional switch Sveta. The only significant difference is that there is no need for wiring. It is enough to fix the button in the box.

Up