HOW TO MAKE AN EXISTING SWITCH SMART

HOW TO MAKE AN ORDINARY SWITCH SMART

NPROnline:

Read our book:

Welcome to the NPR Online Technologies Home Automation course. In this lesson we will address the concepts involved in converting an ordinary switch into a smart switch. For this purpose, we will use the Sonoff Mini and in particular we will use the R2 version.

Let’s start this lesson by briefly summarizing the operating principle of a switch. So let’s start with a light bulb powered with the neutral and live conductors of the electrical system.

We saw in the theoretical lesson of our course on electrical systems that it is possible to control the state of the light bulb by means of a switch. In particular, when the switch is closed, electrical continuity is established between the live conductor and the light bulb terminal and therefore the light bulb turns on.

On the contrary, when the switch is open, the electrical continuity of the live conductor is interrupted and therefore the light bulb is off.

We are speaking generically of a switch, but to be more precise we should speak of a “single-pole, single-throw” switch although it is good to keep in mind that it is not uncommon to refer to this particular electrical component by simply speaking of a switch.

As anticipated, the goal of this lesson is to transform the single-pole single-throw switch into a smart switch, that is, into a programmable switch that can be controlled by a smartphone using a simple Wi-Fi connection.

For this purpose, we will use a Sonoff Mini device and in particular the R2 version.

We note that this device is equipped with a button that can be used for the Wi-Fi pairing of the device. As we will see later, this button can also be used to switch the status of the Sonoff.

The Sonoff Mini is also equipped with six screw terminals

We have two screw terminals marked with the letter «N» which indicates the term “Neutral”.

Then we have two screw terminals marked with the letter «L» which indicates the term “Live”

And finally we have two screw terminals marked with the letter “S” which indicates the term “Switch”.

NPROnline:

Let’s now see how to make the connections with the switch-bulb circuit that we can find in an ordinary electrical system. First of all it is necessary to supply power to the Sonoff Mini and therefore we must wire a branch circuit composed of a pair of neutral and live conductors of the electrical system in order to connect them to the “N In” and “L In” terminals of the Sonoff Mini. We note that we have two “N In” inputs and in this regard we observe that these two inputs are internally connected between them, this means that we can connect the neutral of the electrical system indifferently to one of the two “N In” inputs. As regards the live conductor we note instead that the Sonoff Mini is equipped with only one “L In” terminal and therefore the live of the electrical system must necessarily be connected to this terminal. Connecting the live to another terminal can lead to temporary malfunctions or even irreversible damage to the Sonoff Mini.

Let’s now proceed by connecting the bulb to the Sonoff Mini. We know that the bulb must be powered with neutral and live conductors and therefore we make the connections to the “N In” and “L Out” terminals. In this way the bulb will be permanently connected to the neutral while the connection to the live will take place only when the Sonoff Mini switches to the ON state.

Let’s clarify this point better by observing that in the ON state the “L In” terminal is connected internally to the “L Out” terminal and therefore there is electrical continuity between the live and the relevant bulb terminal. Since the other terminal of the light bulb is permanently connected to neutral, the light bulb will turn on.

When the Sonoff Mini switches to the OFF state, the neutral conductor will continue to be connected to the bulb, while as regards the live conductor this will be interrupted internally in the Sonoff and therefore there will be no electrical continuity between the “L In” and “L Out“ terminals. It follows that the bulb will not be powered and therefore will be off. We have three ways to switch the Sonoff Mini between ON and OFF states.

The first way is to press the button at the top right of the plastic box of the Sonoff Mini. We recommend that you use a plastic or wooden stick to easily push this button. It is clear that this button is useful for a preliminary test of the circuit but it is certainly not the one that will be used by users once the circuit is operational in the electrical system also because the Sonoff Mini will be inserted in a junction or switch box and therefore will not be accessible except for maintenance.

The second way to switch the Sonoff Mini is to control it via a Wi-Fi connection using, for example, a smartphone on which we have pre-installed the eWeLink app. This mode is the main one for which the Sonoff or in general a smart switch is used, since it allows you to control the Sonoff even at very long distances through the use of an Internet connection. Please note that the use and configuration of the eWeLink app are not part of this lesson, we have prepared a lesson dedicated to this topic in order to deepen all its details and potential.

La terza modalità che rappresenta quella su cui ci concentreremo in questa lezione consiste nel collegare un interruttore ai morsetti del Sonoff Mini contrassegnati con le sigle «S1» ed «S2». Ricordiamo che la lettera «S» indica il termine inglese «Switch» mentre i numeri 1 e 2 servono semplicemente per numerare i due morsetti. Possiamo dunque collegare a questi morsetti l’interruttore tradizionale presente nell’impianto elettrico. Facciamo notare che non c’è alcun verso per il collegamento dei due terminali dell’interruttore ai morsetti S1 ed S2 del Sonoff. Per questo collegamento possiamo usare cavi di colore differente in modo da agevolare l’identificazione dei vari cavi e collegamenti quando ci troveremo ad operare in condizioni reali. Nello specifico abbiamo impiegato il colore grigio.

The third mode which is the one we will focus on in this lesson is to connect a switch to the Sonoff Mini terminals marked with “S1” and “S2“ labels. Remember that the letter “S” indicates the term “Switch” while the numbers 1 and 2 are simply used to number the two terminals. We can therefore connect the ordinary switch to these terminals. For this connection we can use wires of different colors in order to facilitate the identification of the various wires and connections when we find ourselves operating in real conditions. Specifically, we used the gray color.

By means of this circuit, we will therefore be able to turn the light bulb on and off with the switch.

We therefore observe that by means of the Sonoff Mini connected as shown in the figure, we are able to maintain the functionality of the ordinary electrical system unchanged, but at the same time we have added the smart functionality that allows us to switch the light bulb on and off even from very long distances. As already mentioned, we will not go into the details of configuring the Sonoff settings but we will remain focused on the connections to be made to make the circuit operational.

Before proceeding with the practical realization of the circuit just analyzed, we point out that it is possible to have a small variant of the illustrated connections.

In this regard, we remind you that the two “N In” terminals of the Sonoff Mini are equipotential, i.e. they are permanently connected to each other. This implies that the connection of the neutral to the bulb can take place without involving the Sonoff Mini,

as shown in this figure. This connection scheme continues to be valid and in particular circumstances may be preferred over the previous version. We note two important aspects:

First of all we note that the second terminal of the Sonoff Mini is not used. An even more important aspect is that the neutral conductor is in any case connected to the Sonoff Mini. In fact, in order to function correctly, the Sonoff Mini needs to be powered with both neutral and live conductors otherwise the electronic board inside it would not work.

Read our book:

Therefore a solution where both “N In” terminals are disconnected is not a valid solution.

Let’s now concentrate on a practical realization of the analyzed circuits. For this purpose, let’s analyze a typical installation. We have in particular a room with a switch that controls a light bulb. In the room or in the immediate vicinity we also have a junction box that allows to access to live and neutral conductors in order to power the our circuit.

The connections are made by means of electric cables that run along electrical conduits generally embedded in the walls and floors. In the figure we are representing a typical conduit distribution that we will call “Configuration #1” in the course of this lesson.

Let’s concentrate on the connections made in this circuit configuration. We observe that the neutral and live conductors are accessed from the junction box. The neutral conductor is directly connected to the light bulb, while the live conductor reaches one of the two terminals of the switch. A wire is then connected to the other terminal of the switch and reaches the free terminal of the bulb.

Another typical conduit configuration is shown in this figure and we will call it “Configuration #2” during this lesson. We note that the light bulb is reached by a conduit that starts from the junction box and not from the switch box as it happens in Configuration #1.

Again, it is instructive to analyze the connections that this configuration requires. In particular, we note that the live and neutral conductors follow a different path, while in Configuration #1 the two conductors follow the same path. In particular in Configuration #2 we note the presence of the a neutral conductor which directly reaches the bulb, while the live conductor follows a longer path since it must reach the switch starting from the junction box, then it returns to the junction box and finally goes towards the light bulb. Both configurations analyzed so far are valid from the point of view of the operation of the switch-bulb circuit. The choice of one or the other depends on the positions of the bulb, switch and junction box which can lead to a preference for one of the two configurations. For example, one of the two could lead to a reduction in the length of the cables to be used or even greater convenience in cutting chases. Let’s now check if from the point of view of the Sonoff Mini installation there are advantages or differences between the two configurations just presented.

To this end, we aim to make both configurations analyzed so far smart. Let’s start from Configuration 1# and let’s make the connections with the Sonoff Mini.

The first step is to disconnect the single-pole single-throw switch.

It is then necessary to cut the neutral conductor placed in the switch box in order to allow us to power the Sonoff Mini correctly.

At this point, all the elements to make the connections with the Sonoff Mini are available as explained in the initial part of this lesson.

We especially recommend paying attention to the live conductor. Specifically, the live conductor coming from the junction box must be connected to the “L In” terminal of the Sonoff Mini, while the live conductor that goes towards the bulb must be connected to the “L Out” terminal. Regarding the two neutral conductors there are no particular recommendations and they can be connected indifferently to the two “N In” terminals of the Sonoff Mini. The same applies to the two terminals S1 and S2 which must be connected to the single-pole single-throw switch without any need to comply with a specific rule.

Once the connections have been completed, both the single-pole single-throw switch and the Sonoff Mini can be inserted into the switch box. In fact, the small size of the latter makes it suitable for being housed in the common switch boxes used in home electrical systems. However it is important to note that the installation of the Sonoff is not recommended in the case of metal boxes.

The final appearance of the circuit will therefore be identical to the ordinary one but now we will have made it smart thanks to the presence of the Sonoff Mini.

Let’s now move on to Configuration #2 for which we first proceed by disconnecting the single-pole single-throw switch.

We note, however, that the neutral conductor is missing in the switch, but we know that this conductor is essential to power the Sonoff correctly. It is therefore necessary to take steps to bring this conductor into the switch box,

starting from the junction box.

Once the neutral conductor is also available in the switch box, we can proceed to make the connections to the Sonoff Mini. We note in particular that we have left the second terminal “N In” disconnected since the bulb is directly connected to the neutral conductor coming from the junction box. We have already seen that this type of connection is allowed and therefore the circuit will work correctly.

We are therefore ready to insert the Sonoff Mini and the single-pole single-throw switch inside the switch box

and also in this case we will have a final appearance of the circuit unchanged but with the advantage of having made it “smart”. We have seen that Configuration #2 requires to bring the neutral conductor into the switch  box. As a result, this additional operation would leads to a preference for Configuration #1 for connecting the Sonoff Mini over Configuration #2 which requires this additional operation as well as extra cable to use. This is true if we want to install the Sonoff Mini in such a box.

The situation changes instead if we have enough space to install the Sonoff Mini in a plastic junction box. In this case, it is easy to realize that all the conductors necessary to make the connections with the Sonoff Mini are available and therefore we will not need further operations.

For this purpose, let’s cut the two conductors directed towards the single-pole single-throw switch.

We then prepare a neutral conductor that we will be used to power the Sonoff Mini. We then reach a situation where we have all the five wires needed to make the connections to the five terminals of the Sonoff Mini,

as shown in this figure. As always, we recommend maximum attention to the connection of the live conductor to the “L In” terminal while the live conductor directed towards the bulb must be connected to the “L Out” terminal of the Sonoff Mini.

Let’s make a zoom in of the figure to better highlight the connections in question. We also note that also in this implementation the second terminal “N In” is not used since we have made a direct connection of the neutral to the bulb.

Once the junction and switch boxes are closed, the appearance of the circuit will be identical to that of the ordinary system.

Let’s remember that this time the Sonoff Mini is housed in the junction box and not in the switch box.

Well, we’ve come to the end of this lesson. If you have followed our instructions carefully, you will end up with your switches converted into smart switches. For those wishing to learn more about these issues, we suggest accessing our playlists and our website npronline.tech/en.To help grow our initiatives, you can help us with a like, by subscribing to our channel or even by sending us comments and sharing this content with your friends. Thanks for your attention and … see you next time!

Read our book:

NPROnline:

GO TO MAIN PAGE OF THE COURSE…

NPROnline:
NPROnline:

Inviaci un tuo commento, grazie! Ti segnaliamo che il contest di matematica è terminato il 10 maggio