CuPID Power Output : Control power where you need it

Why

Most control applications require powering things. Refrigerators, heaters, LEDs, thermoelectrics, motors, and solenoids are all examples of things that require power that the Raspberry Pi cannot (or should not) supply.

Now, our philosophy with the CuPID is that it is a lightweight IO board. It’s not loaded with every power output, switch relay, and sensor that you could need. We wanted to keep it small and cheap, so we only added what we thought was really necessary. We may change our mind and isolate the GPIO with mosfets at some point, but the point is still the same: a flexible device that you add IO to as you need it. The other advantage to this approach is that you put power and sensors where you need them, not in the box with the Pi. Run Cat5 wherever you want (and over RF soon enough), and expand wherever you want, leaving your Pi in place. IO are daisy-chainable, so one run of cable can connect multiple devices in the same place!

What

What we’re building here is the basic powered control output. With a Cat5 cable from the CuPID, it can supply AC (wall power), DC (by swapping out the relay), or anything that will operate on 5V or less. It also accepts an auxiliary control voltage, so you can switch pretty much anything you want. It performs the switching with a 2n7000 mosfet, so whatever you’re switching won’t fry your Pi if it fails. It’s got two COM ports on it, so you can daisy chain several of these guys. Here is the EAGLE layout.

EagleCAD layout file of the output board.
EagleCAD layout file of the output board.

First, let’s start with the input. We’ll go ahead and reprint the CuPID IO here. COM2 and COM3 each have four GPIO on them. An internal DIP switch on the output board will allow you to select one of the GPIO to use. Alternatively, if you need to control multiple devices with one GPIO, just make the same DIP selection on each.

CuPID IO listing for RJ45 ports. COM2 and COM3 each have four GPIO. The output unit has an internal DIP selector to choose which to use for control.
CuPID IO listing for RJ45 ports. COM2 and COM3 each have four GPIO. The output unit has an internal DIP selector to choose which to use for control.

The board

Shown are the ingredients. If you’re going to use the 5V on the com cable to do your switching, you will only need one screw terminal. If you are using a SSR as we are here, then the only reason you really need a current-limiting resistor is to diminish the fail if you manage to short the coil. Remember that a CuPID has an isolated 5V on the COM cable, so you won’t worry about frying your Pi.

Ingredients for a CuPID output.
Ingredients for a CuPID output.
  1. IO Board
  2. 2 x 8P8C Jacks
  3. 4 position DIP switch
  4. 2 x 3.5mm pitch screw terminals
  5. 2 x 2.54mm (0.1″) two-position jumpers
  6. Current-limiting resistor (47ohms here)
  7. 2N7000 NPN mosfet
  8. Pull-down resistor (10kohm here)

We’re not ones for glorifying soldering in pictorial fashion, so here’s what you get when you’re all done:

All soldered and ready.
All soldered and ready.

The box

Alright. So now we need to get it into a box. What box you use of course depends on what you need to put into it. For this project, we’re going to use a pretty standard solid-state relay (SSR) to switch AC power. This works for a refrigerator, a heater, anything that you can power with single-phase power. Our relay is rated for 25A, but our cable is only 16awg, so you want to keep it under 13A to be safe. This is in line with most household circuits. Our relay and our board fit quite well into the case we use for the CuPID, so we use one of those. It’s a polycase WC23F, which we’ve raved about before. The top is clear, so we can see the nice little LED on the top of our relay. So we head over to the mill and put a couple holes in this thing and see how our board fits.

Our standard ‘cutting holes in the box’ picture with our handy mill. This is one of the easier jobs.

Even before filing out the cutouts a bit, the fit is pretty good.

 

Even before filing out our ethernet cutouts, the fit is pretty good. The holes in our board allow mounting to the existing panel mounts.
Even before filing out our ethernet cutouts, the fit is pretty good. The holes in our board allow mounting to the existing panel mounts.

Since we’ve got a good fit, now we’ll mount the relay to the bottom of the box. We want to attach this and get our cable entries in place before we mount the board, as it’s a bit of a pain to work around the board and connect to the screw terminals once it’s installed. In the picture below you can see our relay, and following that a multiframe of our cord grip installation process.

Our solid-state relay and attachment hardware, two 6-32 socket cap screws and locknuts.
Our solid-state relay and attachment hardware, two 6-32 socket cap screws and locknuts. If we want DC output, we just have to replace our relay.

For those unfamiliar with cord grips (also cable glands, cable entries, strain relief, and a few more), they are watertight entry points that cinch down on a range of cable sizes. They resist pulling through, so even if you don’t need the weather-resistance, they’re great for keeping everything stationary and exactly where you put it. They’re offered in a variety of sizes and are <$1 for anything but very large sizes. Installation is easy. There are two parts (sometimes with a rubber washer), and you simply need a hole in the surface you are passing through. Check the spec sheet or take a measurement with some calipers of the threads, and put a hole in your surface with a spade bit. All done. The entry holes need not be perfect (and they won’t be with a spade bit and soft plastic), but you should take a quick round file to the edges to at least makes sure that burrs on the surface won’t prevent the flat side of the cord grip from pressing completely against the surface. This will diminish their security and weather resistance. After you have your holes, simple insert them and tighten them up. All done. Here we first drill and countersink two holes from the underside and insert a couple flathead screws, leaving a flush bottom for mounting. After, we slip our power cables through each side. We attach our hot side (we’re using AC here) to the relay contact, connect ground to ground and neutral to neutral with some solderless connectors, and secure the relay with a couple locknuts.

Installation of cord grips for power entry, mounting of the relay to the bottom of the enclosure, and connection of our power wiring.
Installation of cord grips for power entry, mounting of the relay to the bottom of the enclosure, and connection of our power wiring.

All we have left is to install our board and connect our control wiring to the coil of the relay. Piece of cake. We just connect our load high and low to our control board and to the relay, and reinstall our mounting screws. Short 4-40 screws self-tap into the PCB mounts quite nicely, and we’re done!

Our output unit, complete without top. All we need to do is set the DIP switch to our GPIO of choice and we're ready to power whatever we like.
Our output unit, complete without top. All we need to do is set the DIP switch to our GPIO of choice and we’re ready to power whatever we like.

And here is what we like like all-together with our top on. We’ll show you some simple applications with this that we have around the house in just a bit.

Completed powered io, from the top.
Completed powered output, from the top.
Completed powered IO unit, from the side.
Completed powered output, from the side.