Making a Poor Man's Powerswitch Tail - Arduino (Logic Level) Controllable Outlets for $6 apiece
(The usual disclaimers apply here. 110v A/C will kill you, and it will hurt the whole time you're dying. Since I did the legwork, you shouldn't have to have these plugged in while you're working in it. Do the soldering and then get them closed up and screwed back together before you plug them in. If you're not 100% sure you're soldering to the right pin, then don't do this. A lot of the pins are 110v A/C. See previous disclaimer. That being said, since you don't have to solder while anything's hot, and I'm outlining exactly what to do, this should be relatively safe.)There are a several projects I've got that need to control 110v A/C. One is that I've got a few routers that get hung up on brownouts every once in a while, and it would be nice to be able to automatically reset them when a ping fails. (They're not critical, so a UPS for each would be more expensive than I care to spend.) In the past, I've cut up extension cords and spliced the hot side through a relay driven by a transistor.While this works, it requires a fair bit of effort, a project box, an AC > DC adapter, and plenty of time. Something like the Powerswitch Tail would be perfect, but at $26, it's still more than I want to spend. I recently bought some RF controlled outlets on amazon that didn't work out for what I needed (They worked great, I just chose a different way to solve the problem.) but figured they could probably be used to control 110v A/C from logic-level controllers, and here's what I found:Step one was checking what VCC was on the little RF RX board attached to the mainboard. Playing with hot 110 is always fun. (Don't be like me, kids.)As it turns out, VCC to GND on the board measures at 5v DC. Awesome! Super common logic-level voltage.I soldered a wire to VCC and started poking around on the back on what looked to be the microcontroller (circled in red)Turns out, 5v to the pin circled in yellow would make the relay engage. Awesome! Since I didn't want to solder to the tiny pin, I found the trace (highlighted in bright green) ran to R6, so I just soldered to the end of the resistor circled in blue. I pulled GND from the last pin running to the daughter RF RX board on the top:And ended up with something like:Note that I switched these guys out later for brown on the left and brown/white on the bottom one. Re-assemble everything, and leave the button cover off (You can still hit the button if you need, you'll just need a paperclip) and it looks like this:Now that's more like it. A commercial plastic housing to keep people from getting shocked/dead, easy soldering, logic level control, and I've tested this as able to be controlled with anything from 5v down to 1.5v, meaning you can throw on an ESP8266 and you now have a Wi-Fi controllable outlet for under $9.In the below video, you can see my phone charging when the outlet is activated. I've got pin 13 on the arduino as well as pin 6 where the outlet is attached set to turn on/off at the same time. Ground that we soldered to the outlet RF daughterboard is attached to the arduino GND.https://www.youtube.com/watch?v=OHiP5yUTB20