Introduction: Safer UK Sonoff Wireless Switch- Home Automation.

I recently bought some Sonoff Wireless switches online and although I was pleased with the operation of these switches, I was not content with the way the wiring of mains voltage to and from these devices is made, not least the exclusion of the Earth wire as the Sonoff units only provide terminals for Live and Neutral.

I was wanting a safer way to wire these units in and was looking at project boxes when I hit on the idea of using a two way trailing socket to house the Sonoff and provide a designed safe enclosure while still allowing the functions of the Sonoff to be accessed.

These sockets allow them to be plugged into existing equipment without cutting into its wiring and can be moved as and when required.

Beware that this project involves wiring of mains voltage which should only be attempted by a suitable competent person and building and using the unit is at your own risk and I take no responsibility for any loss or injury in providing this educational information.

Step 1: Tools and Equipment Required.

  • A trailing socket which may be dismantled- look for screw heads either on the front or rear of the socket. Note that some of these sockets do not have screws, but captive clips which prevent disassembly and these should be avoided.
  • Mains plug and lead.
  • A Sonoff Wireless Switch.
  • Screwdriver to dismantle socket and screwdriver to wire the terminals.
  • Sharp side cutters.
  • Sharp knife
  • Pliers
  • Glue gun and glue

Step 2: Dismantle the Socket

This socket is ideal for the project and cost around £2.50 from national high street home store. Note the screws on the rear of the unit.

Step 3: Socket Connections

This is a typical layout of one of these sockets, with copper strips connecting the terminals to each of the pins. To make room for the Sonoff, the left hand connections and internal mouldings need to be removed.

Step 4: Copper Strips Trimmed to Size and Case Preparation.

I used my side cutters to trim down the copper strips, removed all redundant copper and then used the cutters again to remove the unwanted plastic from the base. The plastic flies off at all angles and at surprising speed, so wear eye protection. Once done, I removed MOST of the plastic material from the top cover, retaining that around one hole where the Sonoff reset switch will engage.

Step 5: Remove the Sonoff PCB From Its Case and Trial Fit in the Case.

The Sonoff case comes apart really easily, exposing the PCB. Place this into the base as shown and carefully fit the top to ensure there is enough room for the PCB, whilst ensuring the reset switch fits into the intended hole.

Step 6: Wire Up the Mains Cable to the Sonoff.

Using a mains cable, I wired this up as shown having confirmed Live and Neutral locations with the Sonoff original casing and ensuring each wire was routed in the safest manner within the socket itself.

Step 7: Reassemble and Test

Once the wiring is complete, refit the cover, ensuring the reset switch engages in its new hole once more and then screw the new Sonoff Socket together.

Plug in and switch on the unit and after a few seconds, its LED will illuminate to show that the project is working.

After unplugging, I filled the unused Earth and Live holes (excluding the reset hole, obviously) with hot melt glue from a glue gun to prevent any attempt to force a plug in there by accident.

It is now complete and ready to use!

Step 8: