A wifi-controlled extension cord

A wifi-controlled extension cord

Recently at Yoctopuce, we started to build, for internal use, many small boxes that some wouldn't hesitate to call "Smart Extension Cords", but which are in fact a simple application of the Yoctopuce technology: Wifi controlled extension cords. We thought that you might be interested in knowing how we build them.




The whole adventure started when we discovered in the neighborhood DIY store junction boxes with a socket on the side. They are just big enough to contain all the required Yoctopuce electronics to commute by Wifi the mains current.

The boxes which started it all
The boxes which started it all


The principle

The main idea is very simple: commuting the socket in the box with a relay driven by a YoctoHub-Wireless and powering everything directly from the mains thanks to an AC/DC converter. Here is a small diagram:

The system diagram
The system diagram


The is a small subtlety: rather than connecting the 5V converter output on the hub, we decided to go through a Mini-Battery-Supervisor, and this has two advantages:

  • We have a USB socket that we can easily mount on the side of the box and which allows us to configure the hub without disassembling everything every time.
  • When they are disconnected from the mains, most AC/DC converters don't shut down their output properly: because of the large capacitors they contain, voltage goes down slowly, sometimes for several seconds, which is never good to power digital electronics. The supervisor will perform a clean shutdown if the voltage becomes too low.

Necessary parts

To build this Wifi extension cord, we used:

All the parts
All the parts


Building

We started by cleaning the bottom of the box with a small sander to make it fully flat.

Cleaning the bottom of the box
Cleaning the bottom of the box


We then installed the 1.27-1.27-11 cable on the configuration socket of the YoctoHub-Wireless-SR. We soldered the Board2Board-127 headers on the hub and the relay. For safety's sake, we protected all the contacts close to the relay connector with electric insulant. Hot glue would probably have done the job as well. When the insulant was dry, we mounted the relay on the hub with the Fix-2.5mm.


Protecting the relay contacts    Protecting the hub contacts

Protecting the contacts and fixing the relay on the hub

Protecting the contacts and fixing the relay on the hub


We then installed the hub at the bottom of the box with Fix-3x8mm spacers. One can use the hub as a template to drill holes at the bottom of the box, but its easier with a FixPlate-X2.

Installing the hub at the bottom of the box
Installing the hub at the bottom of the box


We then drilled openings for the cable gland and the Mini-Battery-Supervisor, which we mounted.


Drilling the openings    Mounting the cable gland and the Mini-Battery-Supervisor


Note, as the converter provides exactly 5V, we must configure the Mini-Battery-Supervisor to re-arm itself below this voltage, otherwise the system won't start. The only available setting corresponding to this criteria is a 3.6V shutdown voltage.

Don't forget to configure the shutdown voltage of the Mini-Battery-Supervisor
Don't forget to configure the shutdown voltage of the Mini-Battery-Supervisor


Finally, we set the converter in the box, it just fits, and we wire everything. Note, from a purely functional standpoint, we can use the relay to cut any of the two power wires, but for safety's sake, it is better to cut the phase. In Europe, it's the brown wire. We must also remember to take care of the ground wire.

Wiring
Wiring


About safety, the box is certified for 3680W, the electric wire is certified for 2500W, and the relay can commute up to 1250W. To keep some margin, we think that we should limit the use of this box to devices consuming less than 1000W, which is quite honorable.

It's done

Here is it, we now have a box enabling us to remotely turn on or off devices powered by the mains.

It's done and it works
It's done and it works


You might wonder why we went to so much trouble to build such a device when one can find many similar products on Amazon, smaller and most of all cheaper. The difference is that ours doesn't need a third party server to work and we have all the power of the Yoctopuce API to make it do everything that we want. We'll have a chance to talk about it again.

Add a comment No comment yet Back to blog












Yoctopuce, get your stuff connected.