collage

Making of a CuPID : Raspberry Pi, better.

What are we doing?

We’re making a CuPID control unit. A networked monitor, controller, and otherwise omnipotent member of our new IoT. You can read a blog post about it here or here, check out the details here, and some of the software and other hardware.

The parts

Here’s what we need to make our CuPID, numbered in the picture as below. Not pictured are power supply filter capacitor(s), which are typically installed as here.

All the parts necessary for a CuPID board
All the parts necessary for a CuPID board
  1. CuPID control board PCB
  2. Shielded RJ45 jack (3)
  3. DS2483 i2C 1Wire chip
  4. Surface mount fuse and fuse holder
  5. Through-hole PCB Mount Female USB A (2)
  6. SMT USB Micro
  7. 2-pin 3.5mm pitch male/female pair (2)
  8. Extrashort male USB A connector (2)
  9. Extra-extralong Raspberry Pi 2×13 stacking header
  10. WiFi dongle
  11. Short SD Card holder
  12. For SPI indicator board option : box header

The board

Let’s put this guy together. First, we put on the surface mount components and do a short reflow. The DS2483 and USB micro ports are pretty small.

Board with SMD parts. They are, well, not too big. We could probably hand-solder, but it wouldn't be fun.
Board with SMD parts. They are, well, not too big. We could probably hand-solder, but it wouldn’t be fun.

We could probably get away with doing them by hand, but we put on some paste and let another Pi run a reflow on them, as we did previously. These SMD USB micros are a pain to get right, but fortunately we didn’t connect the data lines on the board, so you can add on plenty of paste and not worry about having to go one-to-one, as long as we get our high and low power terminals. Before placing them, you’ll want to flip them over and take a quick blade to the short plastic posts on the underside. When we make a board again, we’ll create recesses for these. On the other hand, we may go with USB mini since we can get a through-hole version and it’s a bit more robust. Although USB micro is the ‘standard of the future’ on the roadmap, USB mini is just as easy to find and is rated for more connections.

Next, place the DS2483 on the board, taking care to orient the chip as shown in the figure, using the plus to indicate the proper direction. After placing,  we run a short reflow and go.

We test afterward with our voltmeter to make sure we got it right.

Next, we put on the surface-mount replaceable fuse. We’ve found these get a bit melty if we’re not super-careful on the reflow profile, so we do them by hand. It’s pretty easy with the large pads as long as we tin both sides.

Mounting of the replaceable fuse. Tin the pads, heat the pad to attach the fuse, and spot reflow if you're picky like me or it's not sitting quite right. I find the back of my tweezers helpful here.
Mounting of the replaceable fuse. Tin the pads, heat the pad to attach the fuse, and spot reflow if you’re picky like me or it’s not sitting quite right. I find the back of my tweezers helpful here.

Next we put in all of our through-hole components. I prefer to mount all of them and do some marathon soldering rather than doing them one by one. The shield/mount posts on the USB connectors need to be flattened prior to insertion:

The pins on these ports need straightening before insertion.
The pins on these USB ports need straightening before insertion.

We place our parts and do our soldering:

Through-hole component soldering. First, we mount them, shown top and bottom here. We do a mess of soldering, and we're ready to go.
Through-hole component soldering. First, we mount them, shown top and bottom here. We do a mess of soldering, and we’re ready to go.

Now that the board is done, it’s time to mount it to a Pi.

Marrying the Pi

Now that we’ve prepared our board, let’s get it ready for mounting on the Pi. We need to connect the USB ports and connect the header. First, we take our super-short USB connectors and solder a couple paired wires. We crimp female pins and mount into connectors:

We use these short USB connectors to pull data to the CuPID USB ports, so we can power them directly from our power supply. It also allows one port to be inside the enclosure and one outside.
We use these short USB connectors to pull data to the CuPID USB ports, so we can power them directly from our power supply. It also allows one port to be inside the enclosure and one outside.

Now we mount our superlong header. This is similar to the ones that Adafruit sell … except it’s much longer. In addition to allowing us to mount a board on top of the Pi, it extends far enough to allow us to attach a ribbon connector on top of that! This is great for anything you want to put on top, like a touch-screen. You can see how much bigger it is here:

Our extra-extralong headers, next to those from Adafruit. They're so long, we can mount the CuPID and still have room on top for.. more stuff.
Our extra-extralong headers, next to those from Adafruit. They’re so long, we can mount the CuPID and still have room on top for.. more stuff.

Before we mount it, we throw a couple pieces of thick double-sided tape to the ethernet and to the audio jack to give the board a bit of stick and cushion. We mount the CuPID board, solder our headers, and plug in our USB connectors:

Mounting the board to the Pi. A couple of pieces of thick double-sided tape give some stick and cushion to the combination. We solder the headers and connect our USB cable, and we're done.
Mounting the board to the Pi. A couple of pieces of thick double-sided tape give some stick and cushion to the combination. We solder the headers and connect our USB cable, and we’re done.

Put it in a box

Now that we’ve got the business end of our CuPID complete, let’s put it in a box to protect it. We really like the line of WC cases from Polycase. They’re water-tight (until we put holes in them), durable, and reasonably priced. They have flanges, panel mounts, and optional back panels. They’re fairly easy to mill, and when your design is complete you can have them CNC machine and label them for you, at pretty decent prices even at rather small quantities. Once we absolutely nail down our openings, we’ll definitely go this route. For the moment, we mill them by hand. For prototyping, we CAD up our openings as best we can estimate them, print them in real size, and compare them with the boards, components, and previously iterated enclosures. When we find one we like, we tape it to the enclosure, run a razor blade over the lines to score the plastic, remove the stencil, and then mill out the openings. We take a first pass with a 1/4″ or 3/8″ bit to remove material, and then go back with something small like a 1/32″ mill to reduce the radius on the corners. We sometimes go back with a file to sharpen them up.

Milling out the enclosure cutouts. For prototypes, patterns are transferred from a stencil using a razor blade, and milled out in two steps: material removal and finishing.
Milling out the enclosure cutouts. For prototypes, patterns are transferred from a stencil using a razor blade, and milled out in two steps: material removal and finishing.

After the cutouts are complete, we install standoffs on both the bottom of the board and also on the bottom of the enclosure. On the bottom of the board, we use male/female 2.5mm threaded 6mm long standoffs, which keep the board at a consistent height and solid footing. These are not in the parts list above, as we recently added them. Their installation with a couple nylon nuts are shown below.

Installation of standoffs on the board to keep the board level.
Installation of standoffs on the board to keep the board level.

To keep the boards in position, in particular to reinforce it against pushes on the inputs when cables and/or power is connected, we put some 2.5mm thread, 8mm length standoffs in the bottom of the enclosure. From the backside, we insert a couple brass 2.5mm screws. We countersink them to keep the bottom flush, and if needed, thin layer of silicone will keep this waterproof.

Installation of standoffs in enclosure to hold board in place.
Installation of standoffs in enclosure to hold board in place.

Once we clean out the enclosure, insert our SD Card in our low-profile connector, and plug in our WiFi, we slip it into the cutouts. Almost done.

Mounting of board into enclosure with standoffs.
Mounting of board into enclosure with standoffs.

Let it be seen!

At this point, we have a couple options for indicators. We can go with an indicator board we made specifically to fit in this enclosure, as we reflowed and demonstrated previously. It mounts to the internal panel mounts with standoffs and connects with an 6-conductor IDC and box connector, and has 4RGBs and 4 single-color (R,G,B,Y) LEDs. Best of all, it uses only one SPI port, employing a couple shift registers.

CuPID with indicator panel, including 4RGB and 4 single-color (R,G,B,Y) programmable indicator LEDs, all on a single SPI output.
CuPID with indicator panel, including 4RGB and 4 single-color (R,G,B,Y) programmable indicator LEDs, all on a single SPI output.

Alternatively, we can throw a nice little touchscreen on top. We’re working on that write-up currently, but the result is here:

CuPID with touchscreen. Runs on SPI outputs and two GPIO.
CuPID with touchscreen. Runs on SPI outputs and two GPIO.

2 thoughts on “Making of a CuPID : Raspberry Pi, better.”

Leave a Reply

Your email address will not be published. Required fields are marked *