Remote-Controlled Relais

Turning Devices On And Off Remotely Using Direct Radio Or WiFi

Most people control devices wirelessly every day without even thinking about it: by using a garage door opener, TV remote control, smartphone apps, etc, you are controlling all kinds of electrical devices. The wireless relais discussed here provide you with a generic way to retrofit remote control capability to any device you want.

Never use AC high voltage in your DIY projects unless you are a qualified electrician or have comparable expertise.

Overview

There are two types of radio signals used for remotely controlling devices:

  • RF Signals: a license-free radio frequency is used to pair a remote control (sender) directly with a device (receiver). This works everywhere and requires no special prerequisite like WiFi coverage or Internet connectivity, but you must be in close proximity (around 10m). Pick the frequency that is legal to use in your region (Europe: 433MHz, US: 315MHz)
  • WiFi: controllable via WiFi signals that are typically sent by a vendor-specific cloud service. You use the vendor-supplied smartphone app to initiate the control signals. This approach requires Internet and works from anywhere in the world.

Both techniques have their own advantages and shortcomings. Which one is preferrable depends entirely on your actual use case.

Using Radio Frequency

RF-controlled relais use direct one-way radio communication that provides autonomy:

  • Simple: no special prerequisites are required. You do need to purchase a compatible RF remote control separately, and pair it with the device.
  • Robust: when your WiFi network fails or your phone company’s network is temporarily down, your RF-Controlled solutions continue to work like a charm.

Here are the disadvantages:

  • Local: The distance you can bridge is limited to around 10m: you need to be close to the device to operate it.
  • No Feedback: the one-way communication cannot send back feedback information. The visual clue you get from i.e. an opening garage door is all you get.
  • Potentially Insecure: since RF is travelling freely through the air, attackers can pick them up, record them, and later play them back to clone your remote control - provided the attacker can get close enough to your remote control when you operate it.

There are solutions to secure RF transmissions, i.e. rolling codes or encryption, however most cheap out-of-the-box solutions do not come with this.

Using WiFi

Sending control messages via WiFi has these benefits:

  • Anywhere: Commands issued by a smartphone app work anywhere and just need Internet Access. Your commands are automatically routed to your home WiFi, and then to the device that you want to control.
  • Feedback: since WiFi uses two-way communications, the controlled device can return feedback, i.e. show its state, or confirm the operation.
  • Secure: WiFi data is encrypted by default. Attackers cannot listen in or use playback attacks.

Here are the disadvantages:

  • Coverage: requires that your WiFi network provides good coverage. This may not be the case in areas like the garden or garage.
  • Internet: requires a specific vendor cloud solution. Devices can be controlled only when connected to the Internet.
  • Privacy: since you do not communicate directly with the device, all messages are routed through the vendor cloud service.

Each vendor uses own cloud services that are incompatible and work only with devices authorized by the vendor. So whichever vendor you may choose: stick to it (i.e. Tuya, EweLink). You cannot mix WiFi-device from different vendors (unless you want to use a number of different smartphone apps to control them all).

Wiring

Most commercial devices (regardless of wireless technology) use screw terminals similar to these:

Terminal Description
Lin, Lout the “live” line, controlled by the relais.
Nin, Nout the neutral AC line. These two terminals are always connected.
S1, S2 when connected, turns relais on (optional, can be dangerous)

S1 and S2 may be exposed to AC! Never ever hook up a low voltage push button to these terminals (see next section).

Hazard

Cheap electronic components - like the ones discussed here - were designed to be installed by professional electricians. They were also specifically designed to be integrated into existing applicances, i.e. light switches.

Before you start using such components for DIY purposes, read and understand this:

  • Hazardous Voltage: these components can only work when they are connected to hazardous AC high voltage (their internal low voltage circuitry is powered by AC voltage).
  • AC Voltage can be deadly. It may not hit you: you may be careful, and you may know the parts that “shouldn’t be touched or pulled on”. It may hit your child or a friend instead, when they trustfully operate one of your DIY devices. This may occur tomorrow. Or in two years time. Do not take this risk if you are not absolutely certain you know what you are doing.

Dangerous Designs

If you do decide to proceed, make sure you fully understand the components you use. Even a simple component like a wireless relais may use unexpected designs and cause deadly misunderstandings.

Here is an example: look at the terminals S1 and S2 found on all of the example devices I examined: according to documentation, they can be connected to control the relais manually.

That is perfectly in-line with the original intention: when retrofitting remote control capabilities to a light switch, a licensed electrician would open the existing light switch, then hook up the wireless relais to the load, and finally hook up the original switch to S1 and S2. This way, the load could now be controlled via the existing switch plus also remotely.

When looking at the traces, dangerous high voltage AC is exposed at many surprising places, including S1 and S2:

S1, Nin and Nout are all connected, and so is the built-in push button. Live AC can be available at all of this places, including S1.

Deadly Misunderstandings

If you just went by the documentation, you might have assumed that S1 and S2 connect a low voltage switch that interacts with the low voltage control logic - and this would have even been a sensible assumption: with a dedicated DIY component, S1 and S2 would probably have been implemented this way - and some WiFi-controlled devices I examined did use this safe design. But not the one I showed above.

Dangerous Consequences

If you had connected a simple 12V switch to S1 and S2, and used switching wires, possibly with a bit of sloppy insulation (assuming this to be part of the 5V circuit), you might have accidentally built a life-threatening DIY execution device.

No Assumptions

When working with voltages above 36V, and certainly when working with dangerous AC voltages, there is no room for assumptions:

  • You must have the required expertise, and you must have solid information that you can rely on. If the documentation is missing or incomplete, you must reverse-engineer the device until you know what it does and what it does not do.
  • You cannot assume that people will handle your device with care, you cannot assume that the five-year old neighbor daughter probably won’t find the device and probably won’t pull at the funny colorful wires that connect it to a push button, and you also cannot assume that a website (including this one) provides correct and complete information.

The above applies solely to working with dangerous voltages. Stick to battery-operated gadgets and DIY project, and generally use voltages below 36V to be always most comfortably on the safe side.

Slow Website?

This website is typically very fast, and pages should appear instantly. If this site is very slow for you, then your routing may be messed up, and this issue does not only affect done.land, but potentially a few other websites and downloads as well. Here are simple steps to speed up your Internet experience and fix issues with slow websites and downloads..

Comments

Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.

Here is how your comments are stored

Whenever you leave a comment, a new github issue is created on your behalf.

  • All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.

  • There is no third-party provider, no disrupting ads, and everything remains transparent inside github.

Github Users Yes, Spammers No

To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant utteranc.es the permission to submit issues on your behalf.

If you don’t have a github account yet, go get yourself one - it’s free and simple.

If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.

Discussions

For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.

  Show on Github    Submit Issue

(content created Apr 29, 2024 - last updated Jul 28, 2024)