ESP8266 DIY Smart Socket – HARDWARE (2/3)

Making things makes me happy. Not isolating the PCBs correctly can be shocking!

I had very little use for a yet another charger in my household. I reviewed it on my website, and I think I reached the tipping point for the chargers. The AUKEY charger presented some unique opportunities which I’m going to take advantage of in this build. If you have not seen the showcase – check it out first to see what is the DIY Smart Socket capable of. And before you ask, why don’t I just use sonoff switch, let’s just say, we are here to make, learn things, and have some fun.

Warning
This tutorial involves 220V/110V voltage which is dangerous! It’s intended for educational purposes. Tampering with any devices increases the chances of device failure and creates additional hazards.

With that scary warning aside, we going to hack the AUKEY charger and ESP8266 into a DIY Smart Socket.

DIY Smart Socket – Tutorial

The British plug design comes with high safety at the cost of size. You could fit an elephant inside. And that elephant is going to be an ESP8266 or the circuit as I decided to keep the ESP8266 outside for the entertainment purposes. (and because it was easier this way).

For this tutorial I’m going to use the following items:

  • AUKEY pass-through UK charger with 4 USB (AmazonUK/AmazonUS)
  • ESP8266-01 x1 (AliExpress/BangGood)
  • 5V to 3.3V step-down module  (AliExpress)
  • Solid state 2A relay (AliExpress)
  • a refurbished socket (female) – broken international adapter
  • thin telephone wires, and electrical cord strand for high voltage
  • a female header for pins 2×4
Support NotEnoughTech

AUKEY charger design

To understand this hack, we have to understand how the charger works. The charger is a single PCB design that contains a voltage converter/charger that supplies 6A of current across 4 USB-A ports. The charger is powered up constantly.

The plug is linked directly inside to the socket. This means when a plug is plugged in, it touches the contacts that are connected to mains. I have separate the circuit to introduce the relay.

There is enough space inside to make it happen, plus the plug design inside makes it fairly safe to do so. We can also draw 5V from the USB to power up our ESP8266.

The DIY Smart Socket circuit

I kept the design circuit to the absolute minimum. We have a limited space to work with. The design is simple but functional. The solid state relay allows us to switch up to 2A current, which equals to about 400W.

Fortunately, the relay can be driven directly from the ESP8266, even though 5V is advised.  It worked flawlessly in my testing stage. It’s worth noting that this relay uses AC current to disengage. It’s not designed to switch the DC (it’s latching).

Here is the sketch:

DIY Smart Socket – hacks inside

Warning
Before you open the charger, disconnect it from power. Connect something to USB ports to discharge stored current. Even disconnected, the charger will hold the charge in the capacitors.

It’s a bit fiddly to play inside the socket, as the mains wires are short. Feel free to desolder the wires if this makes it easier for you. The first thing to do on the agenda is to remove the pieces of metal which hold a plug which would be plugged into the charger. I need a safe space between a live wire and the relay driven side.

The new U-bed goes inside and it is separated from the old connector with an electrical tape folded multiple times
I needed to create a gap between the prong from the AUKEY charger and the actual socket

I repurposed an old travel converter, took it apart and bent the piece of steel to a correct size and length then a soldered an extension (thick) wire which can handle 2A current at 220V. Next, I slotted that into the socket. I folded some electrical tape multiple times and pushed it in between the original prong and the new U shaped piece of metal.

Next up, is the solid state relay, I need two thin wires for connection to ESP8266 and two thicker wires that will connect to 220V and the newly created U bend.

I cut a small hole in the case, so I could fit the 2×4 female headers. I will be able to remove the ESP8266 at any time. I soldered the thin telephone wires into the socket, then wired it to the 5V to3.3.V module. Lastly, I liked it all with the solid state relay.

Pins 1 and 4 were GND and 5V (from left to right) – GND is common, you can see the pattern repeating for each USB socket on the PCB

After few minutes of probing with a multimeter, I found out where are the 5V pins the AUKEY charger’s PCB, and that all GDN pins are connected together. I have added 2 thin cables to draw the power directly from the pins and separated the cables and PCB with a piece of electrical tape for extra safety.

I have tested the socket with the multimeter to make sure I have no shorts, then I wrapped the voltage converter in some more tapes for safety. I have tried to keep new wires as isolated as possible to prevent possible shorts. It’s a prototype, I’d like to put the boost converter and socket onto a small custom PCB later on, but for now – that will do!

The enclosure was glued up together, but I knew I have to take things apart later to take the pictures for this tutorial I used some rubber bands to keep things together until pictures are taken. I will seal this with glue later.

DIY Smart Socket  and Software

Take a look at the ESP8266 adapter I made, it makes the programming ESP-01s much easier and quicker! In the last part, I will focus on the software and setting the ESP8266 DIY Smart Socket with Tasker, schedules and smart speakers like Alexa or Google Home.

Support NotEnoughTech
A lot of time and effort goes into keeping NotEnoughTech alive! If my work helped you out, consider buying me a coffee or check out exclusive rewards available to Patreon supporters.
SHARE