USB Controlled Quad Outlet Box

Show off your prints!!!
Post Reply
apk
Posts: 23
Joined: Sat Jan 30, 2016 3:06 am

USB Controlled Quad Outlet Box

Post by apk » Fri Feb 19, 2016 10:46 pm

I used MakerBot True White PLA for this print with the same S3D settings I use for the MakerGear black PLA. Even though I'm not particularly concerned about aesthetics on this print, the box looks really nice. Each outlet is powered through an independent 250V/10A relay, controlled via USB.
Attachments
controller_closed_big.jpg
controller_open_big.jpg

User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

Re: USB Controlled Quad Outlet Box

Post by Jules » Fri Feb 19, 2016 11:21 pm

Very nice! :D

charles.yates
Posts: 59
Joined: Sat Dec 19, 2015 9:12 pm

Re: USB Controlled Quad Outlet Box

Post by charles.yates » Fri Feb 19, 2016 11:24 pm

Looks really nice - needs a European equivalent though :).

charles.yates
Posts: 59
Joined: Sat Dec 19, 2015 9:12 pm

Re: USB Controlled Quad Outlet Box

Post by charles.yates » Mon Feb 22, 2016 1:04 pm

You've inspired me on this one and I'm vaguely looking at setting up something similar here.

I have a 4 port relay, but it's not directly controllable by USB. They are fairly trivial to control by way of an Arduino though and I have a few Nano's here - cheap clones - 5 for 15 euros kinda things - so happy to sacrifice one as it may work out quite well for some lighting in my basement.

Unsure about the control of it though - it would be nice if it were kinda self contained (ie: no requirement to add a fixed computer into the mix), so vaguely considering infrared, bluetooth or network (would prefer one of the latter as it doesn't require line of sight and could be controlled from my tablet/phone). Alternatively, I could probably use a Raspberry Pi (preferably a Zero if I could get hold of one...). Also been toying with the idea of just hacking up a clap clap switch of some sort to do it - having a working prototype of that, but it's not very reliable at the moment.

I didn't find double sockets like you have them though - all rather clumsy single sockets, so I suspect it'll make a larger box to shove it all into :), but I might give it a crack.

The current set up uses Chacon Dio's and while they work OK, I'm constantly searching for the bloody remote :). Controlling it from the phone, tablet or even hacking my media player to incorporate the functionality somehow would be kinda fun at least and it would free up the equipment for another use which I had in mind.

The room in question kinda looks like this:
basement-r2-pro.jpg
and it's the lights (Ikea Dioders) which are obscured by the white paper which I would like to have more control over.

Also need to replace the white paper with some 3D printed thing :) - they're there to keep the light from the shelves bleeding on to the projector screen, but don't do a great job.

apk
Posts: 23
Joined: Sat Jan 30, 2016 3:06 am

Re: USB Controlled Quad Outlet Box

Post by apk » Mon Feb 22, 2016 2:35 pm

I'm also using a commercial product to control lights... the WeMo product line from Belkin has a number of devices that plug into outlets or replace wall mounted light switches and can be controlled by their smartphone app, a number of third-party apps (which run on either a smartphone or computer), or can be controlled with the UPnP standard via HTTP requests. I think they make a European version of their product line (I'm obviously using the US version).

For this application I needed something different though. My house in Southern California is subject to occasional power and/or internet disruptions. Most of the time my router and modem reboot properly and reconnect to the internet, but sometimes one or the other needs to be manually power cycled. Easy enough to do when I'm physically present, not easy to do when I'm away (which is fairly frequently). So what I needed was a number of normally closed relays that could be accessed remotely to power cycle the router, modem, WiFi node (which sometimes crashes and needs to be power cycled too).

I'm a big fan of the Raspberry Pi, and I have a number of them performing multiple duties... I decided not to mount the Pi inside the outlet box so it would be accessible to perform other duties. The relay is a Phidgets 1014_2. I also use a Pi as an answering machine... through the answering machine, I can dial in remotely and enter a code that will power cycle any of the four outlets for a specified number of seconds. I'm also working on a program for the Pi that will check internet connectivity on a regular basis, and if it is down for more than a certain period of time will power cycle the router and modem automatically.

charles.yates
Posts: 59
Joined: Sat Dec 19, 2015 9:12 pm

Re: USB Controlled Quad Outlet Box

Post by charles.yates » Tue Feb 23, 2016 12:09 am

Yeah, can see how the direct USB control of the relay would be better for you. I guess I could just expose a bunch of wires and have them connect to the relay, and plug them into the GPIO of the external Pi... or an Arduino for that matter. 6 pins on the relay, so not entirely unreasonable.

I have a Pi in the room there - it's running openelec/kodi. Makes it's a bit awkward to customise, but there are ways round that I guess.

charles.yates
Posts: 59
Joined: Sat Dec 19, 2015 9:12 pm

Re: USB Controlled Quad Outlet Box

Post by charles.yates » Tue Feb 23, 2016 8:15 am

Looks to me like this should work quite well. I created a small connector for the pins like:
relay-disconnected.jpg
Wired up, it provides a surprisingly robust connection - I can comfortably pick it up by the wires without them falling out or losing connection with the pins:
relay-connected.jpg
Model attached in case anyone is interested.
Attachments
relay-round-6 (repaired).stl
(45.98 KiB) Downloaded 160 times

Dale Reed
Posts: 376
Joined: Thu Apr 10, 2014 1:39 am
Location: Cleveland Heights, Ohio USA

Re: USB Controlled Quad Outlet Box

Post by Dale Reed » Thu Mar 31, 2016 5:45 pm

charles.yates wrote:Unsure about the control of it though - it would be nice if it were kinda self contained (ie: no requirement to add a fixed computer into the mix), so vaguely considering infrared, bluetooth or network (would prefer one of the latter as it doesn't require line of sight and could be controlled from my tablet/phone). Alternatively, I could probably use a Raspberry Pi (preferably a Zero if I could get hold of one...). Also been toying with the idea of just hacking up a clap clap switch of some sort to do it - having a working prototype of that, but it's not very reliable at the moment.
How about using a Photon from http://www.particle.io/ ? For $19 USD, you get a 24-pin DIP micro board with wi-fi, and the cloud service is included. There are about 14 or so of the pins available as GPIO, most can be PWMed. Two pins can be full 12-bit DtoA as well. The online development libraries include calls to publish events to the cloud and receive events from the cloud that trigger function calls. Get the book for it, too -- you'll want that to understand the cloud service and how to leverage sites like IFTTT (if this then that). There's also a smartphone app that lets you peek at pin states and poke pins as well. I had a "recipe" set up on IFTTT which, whenever I received a gmail, sent the subject line to my Photon, which then beeped it in morse code.

Right now, I'm using mine as a "Replay" light switch. Think of a regular wall switch with three positions. In the down position, it turns the light off (and remembers the light is off in a buffer). In the up position, it turns the light on (and remembers it's on). In the middle position, it "replays" the on and off states for the last week. Imagine such switches all over your house. When you are home, use the switches like normal. When you go on vacation, just go around the house and set all the switches to the middle position, and your house lights do what they did for the last week, over and over, looking exactly as they did when you were home.

Dale

Post Reply