He picked up a sturdy metal power strip from a local hardware store along with some Sharp S201S06V relays he ordered online. After test fitting his relays inside the power strip’s chassis, he wired up 5 of the 6 outlets through them to allow for switching via a microcontroller. He configured the 6th outlet to be live at all times, providing a power source for the control system he planned on using to switch the other receptacles.

[Teknynja] pulled the connector from an old PS/2 mouse for use as a control wire, connecting one wire to each of the relays. He says that the strip is working quite well, and after a few months of use it is holding up nicely.

Post navigation

22 thoughts on “DIY microcontroller-switched power strip”

I’ve been looking to do something similar. It looks like the S201S06V relay can only handle a 3A load. So, this obviously doesn’t work as a general purpose switched outlet :( Any good suggestions for a replacement that could handle the full 15-20A the wall provides and will still fit in the power strip?

Just type in “5v Relay” and start filtering down from there. You might need a relay driver (which could be as easy as a NPN BJT & diode) or a full on driver chip with flyback diodes built in (recommended). Depends on how much space you have.

stab-lock you mean backstabbers as I’ve heard more than one electrician refer to them as, but yeah do everyone a favor and don’t use them. As for the little bits of exposed wire he has the hot side bundled up tight, everything you see exposed is already tied to the enclosure, ground and neutral should be bonded at the panel.

backstabbers aside my only other concern is the wire gauge on the hot side bus. Maybe feed the ps/2 tail + heat shrink strain relief through before soldering so you don’t end up with that giant hole in the side, very well executed build otherwise.

I found out that you can buy an 8-channel relay board for $12 (hint: sku121337)
thats ordinary relay with small preamp circuit for each, and some indicator lights, screw terminals etc.
how can it possibly be that cheap?
how can you possibly resist automating every socket you own?

This is excellent work. There is a large powestrip slash box enclosure commonly available from Stanley (I think that’s the brand) that has a heavy case, a long cord and a lot of internal space. Its an excellent base to build a multi-outlet load sensor on, and I suspect you could use these SS relays in that case as well.

I have a number of large 24 outlet power strips that do power control and limited load measurement, but they were fairly expensive and sometimes blow up if a phase drops, so I suspect that using solid state relays will work well.

I have a couple of ancient APC rack-mount PDUs that no longer power up at all. I’ve been wanting to rip them apart and replace their internal boards with something else (possibly Arduino-based, or maybe Raspberry Pi-based if I can get my hands on one, so I can build a nice web interface for each of them.)

Going to bookmark that relay technodream mentioned, as that looks perfect, but I really should finish up some of my other projects before starting anything new.

personally i would have mounted the resistors inside the case tho… in case it gets plugged into a PS/2 mouse port… or a…

or a detachable cord with the resistors inline(inside). that way a different cord is for different applications (voltages).
that way the cord is male-male(two mice-tails end2end) and the unit would cant be plugged into a computer PS/2 port

Thanks for all the feedback guys!
As for the current being drawn through each SSR, I knew that I was gonna be pulling less than 1 amp per socket, so for this project it wasn’t a problem. I just needed a quick (and compact) way to control the AC power.
The only reason I used the stab locks on the outlets is because that’s all that was on there! I too would have preferred to use screw connections (I do on all my home wiring) if they were there, but I didn’t want to spend more time and money replacing the outlets in the strip. There probably isn’t a good shot of it, but the mouse cable **does** have a plastic strain-relief on it, as I definitely didn’t want it getting yanked on or dragging against the metal edge of the hole.
As to the resistors, I too think I probably should have included them inside in retrospect, but I also have another set of LEDs on the controller board in series with the SSR inputs, so the resistors would have been too small for normal use anyway. Next time, I’d put the resisters in the strip and drive the on-board LEDs in parallel.
Hopefully this hack sparks (no pun intended) some ideas for other people, and they take the time to look over these comments for improvements on the design.

This is a really nice project but I wonder if it is safe? Looking at the photos I can not see any insulation between the metal tab of the S201S06V and the metal back of the power board. Looking at the data sheet for S201S06V it clearly states that the metal back is connected to pin 1. Any ideas?

I didn’t notice in the data sheet the part about the metal back, but the actual parts have epoxy on the back, with no exposed conductive areas. There **are** some small metal contacts on the top side of the case but they would not come into contact with the screw at the front or the back mounting surface. If there was any exposed metal, I would have definitely had to re-think the mounting.

Perhaps those notes on the datasheet are just standard “boiler-plate” for their SSRs? I’ve ordered more of the S201S06Vs and they also have epoxy backs, but just in case anyone trying this should double check just to be sure.

Pretty slick. I’ve been looking to do something like this forever, in an attempt to build a home automation system. What relay would be the right thing to use with a higher load? Would more robust heatsinks be needed?

I am absolutely terrible with soldering and electronics, being more of a programmer so I like the apparent simplicity of this build!

My plan was to use cat5e for the low voltage control wiring. Should work, right?

If pin 1 is the heatsink tab and you are bringing the hot line into pin 2, the metal case will be alive when you switch on any line. Which should short to ground on the case. If not then you have a bad ground wire. Also if one SSR triggers all the outlets will go on. Because, the AC will leak through the live case to pin 1 on the other SSRs and out the outlets. This is the exact reason I could not share a heatsink when I built 320 SSRs for my Christmas display.

It seems the actual devices have epoxy backs and mounting holes. I think the data sheet might refer to using a clip-on heat sink designed for that case, which would come in contact with some small metal tabs on the sides. I’ve used large TO-220 heat sinks with these as well and had no problems with high voltage leaking to them.

You are right, I did not provide any earthing for the back other than relying on the screws – hopefully this hack doesn’t spend much time in the “open” state!

Perhaps im wrong, but its just dawned on me you cannot get a metal cased power strip in the UK, only plastic, i presume something to do with the double insulation standards. irrelevent to the project i guess but just realised, as i would like to build similar!

Also i cannot see an earth lead earthing the rear of the case where those SSR’s are mounted, fair enough(ish) relying on the mounting screws when the case is closed but what about when the case is open during fault finding, could get nasty! very well thought out wire managment though