USB Controled AC Plug - No Automation No Application

by pierre.wagner in Circuits > Electronics

598 Views, 1 Favorites, 0 Comments

USB Controled AC Plug - No Automation No Application

IMG_4095.JPG

I'd like to power up my Govee Dreamview T1, as I power up the TV set, using NO automation apps.

Smart LED TV Backlights – Govee

The Govee Dreamview T1, and Govee's products are controllable with Alexa, Homekit, IFTTT or others, the purpose of this instructable is to show a way to automate the Govee Dreamview, only using the power from an USB port of the TV.

You can also automate AC backlights, sidelights or other device.

An other kind of device exists to achive the same result, but monitoring the current pulled by the TV, detecting it's powerup, and switching an AC plug accordingly. One exemple: Tricklestar Power Strip.


I made my project with a single socket plug (a surge suppressor used to protect computers). This is a device I had lying at home. I think using a power strip with many sockets can be used easily, if the strip can be opened! Often I saw strips with no screw.


As usual, as we are working near AC main, be sure to fully understand the danger of AC main !

Supplies

  • 1 device with one male side to the main and a female side for the use. Here a single socket surge protector.
  • 1 static relay, type G3MB-202P (datasheet attached)
  • 1 USB cable (from an old Mouse, Keyboard, phone charger...)
  • few Wires
  • Insulating shrinking tubes
  • Glue
  • A meter to check things

Principle

Most know the principle of relays, using one power to switch another one, isolating the first from the second.

Relay - Wikipedia

These devices are ubiquitous in industrie, car, appliance for years. They used to be bulky, mechanical, but we can find now tiny, lightweigth, static relays.

The plan is to use the 5v from an USB socket on the TV (but you have to check for an USB socket powered only if the TV is ON!) for the "coil" side of the relay. Use an USB gadget for this.

As I used a static relay, there is NO coil, but an opto-isolator: Opto-isolator - Wikipedia to drive the AC output.

The static relay used is a G3MB-202P, with 2A max load, far enough for the application, with high isolation between the 5v side and the AC side. It's a common relay used for AC switching with Microcontroller circuits. In the conclusion, I wrote about NOT using the AC.

Opening the Plug

IMG_4083 - Copie.JPG

One of the caveats is to find a device you can open, with screws. Mine have 2 screews, "security" kind, triwing. I have an applicable triwing screwdriver, but found a small flat one also doing the job!

This surge protector have a ON/OFF rocket switch, so I decided to keep it, so it can still be used with no USB power.

It's important at this point to identify the wires !

Here we have facing-up the female, remote side. The right socket is the "AC Neutral", directly connected to the male "AC neutral" on the rear male side. A wire is used from this neutral to the rocket switch, at the right pin, only for the light indicator in the switch.

The left socket is the "AC Live", switched by the rocket switch. You can see a wire is coming from rear male side, and connected to the left pin of the switch

Then from the middle pin, a wire goes to the female remote socket.

On middle, at left and right, we have the surge protective stuff (the white and the yellow things). We'll not touch/modify this stuff.

Add the USB Cable

IMG_4081.JPG
IMG_4084.JPG

I used the cable from an old dead mouse. Drilling a hole at the bottom, thinking at the final step, having both the USB cable and the power adapter cable, pointing the same side.

On most USB cable, the Black wire is the 5V negative and the Red (orange here) is the 5V positive. You have to check this with a multimeter.

I cut the useless data wires. Again on most USB cable, Data are the White and Green wires, here White and Blue. On this mouse, you can read the color usage etched on the PCB.

I managed to keep the protective part of the mouse cable, and securing it with a ty-rap. When happy with this you can glue it.

The rocket switch was lifted to make room for the work.

Finding a Place for the Relay

IMG_4089.JPG

The relay is really tiny, flat, so no real problem to find a place. You have to try to find the best place, for the USB cable/wires away from AC parts, if possible. Here, the plug is compact, so the AC wires are not far.

On the relay, you have 2 pins at left, with "+" an "-" markings.

Solder the Black USB wire to the "-" and the Red/Orange to the "+".

Remember to put the shrinking tubes before soldering!

Then heat the tubes to shrink.

I've already glued the relay at this step, but can be done lately.

Wiring the AC Side

IMG_4090.JPG
IMG_4092 - Copie.JPG
Schematics.jpg

Solder short AC wires to the 1 and 2 legs, again add shrink tubes and heat them.

Put back the switch in position.

Solder the other sides of the wires to the switch, on the "contact" pins, here middle and left.

I added a 2A micro fuse (the green thing) on one wire.

Usually, we have only these 2 contact pins, but this switch have a light to show the ON position, so a third pin is present for this purpose at the right.

It's very important to identify this third pin, as it carry the AC Neutral! NEVER USE IT FOR THE RELAY!

Double check the wiring for shorts. Use a meter in ohm function.

Close the Plug and Check

IMG_4095.JPG

The soldering part is over, close the plug.

Now, time to check if all is right. If all was checked at the previous step, nothing must go wrong.

But as we use AC, we can take some steps before using the plug for the real purpose.

1 - Test it at daylight time, to avoid a blackout in case of problem

2 - Try to find an AC socket from a breaker with few other equipment - Identify the breaker.

3 - Plug the plug alone, not to the TV USB, no slave device plugged.

4 - Try to plug a simple slave device, as a desk lamp.

5 - For the USB remote control, use an USB charger for the first test.

If all the steps are ok, you can use it for real purpose, connected to the TV !

Conclusion

If you are awkward dealing with AC, and working with a 12v power supply, you can find SSR (solid state relay), still with USB 5V as command but with low voltage for the controlled part.

In this case you have to use male and female DC barrels to cut the output of the power supply. Take care of the power drained by the controlled device, as if 2 Amps in 240V is large, 2 Amps in 12V is not so much !

Example : https://www.amazon.com/Kyoto-Electric-KF0602D-Solid-State/dp/B00B888WVC (Take care of the pins, the numbering is different !)