- Published: Friday, 23 December 2016
- Written by Jon Chandler
- Hits: 1441
For development and testing of the fault monitor I'm working on, I need to simulate 8 0v/5v signals. I used the PICkit 2 logic tool for some simple testing and I could have used jumpers to kludge something together but there will be a lot of testing as I get all the features together, so something a little more user friendly and robust was in order. One way I could have done this was to use a 8 bit DIP switch, but fiddling around with the tiny levers is kind of a pain in the butt.
I decided the best solution was to build a switchbox with toggle switches that can quickly be set to desired patterns. I had a handful of mini toggle switches purchased long ago on ebay that are of a quality such that I don't want to use them anyplace where I'm depending on the switch to work, so that was a starting point. My data lines are pulled high by 10k resistors, so I could just use a SPST toggle switch to short each data line to ground. Nothing too complex to hand wire.
Close at hand was an enclosure I had ordered from iTead for $5. This stylish box was overkill for this project but it worked well. I have some measurements for a circuit board which I'll include at the end of the article.
Eight switches fit nicely on across the box with 15mm spacing. I actually drilled holes with a 3mm hand bit while sitting at my desk and reamed them up to ~¼" to fit the switches. The soft ABS (I believe) is easy to machine. I'm going to hide my solder skills (I actually didn't think to take pictures) and not show the inside of the box.
I cut a slot in the rear panel for a 0.1" pitch female header to make connections between the switch box and circuit board I'm developing. I used Bondic UV-curable adhesive to secure the header section to the enclosure. The stuff is kind of expensive, but it's a pleasure to work with. I put a bead of adhesive on the bottom of the enclosure, slid the header section into the exact right location, and used the included UV LED to cure the adhesive in 4 seconds! I then built up a few layers around the sides and top of the connector and filled in the gaps around the edges of the slot I cut and was quickly done. Connector in place and cured, no glue any place but where it was supposed to be.
I soldered a common wire to one side of the swithes (the ground connection) and jumped it to the first position on the header strip with a lap solder joint. Tin the end of the wire and the header pin, overlap them and apply heat to join them. Then jumpers between the other terminal of each switch and its header pin in the same way.
The enclosure is held together with 3mm screws, and there are bosses to apply mounting feet over the screws. Neither the screws nor the feet with supplied with the enclosure but I happened to have both on hand. The bottom of this nice enclosure also has keyhole slots if you want to wall mount it.
To make connections to the swithcbox, a section of long header pins is inserted into the header section and Dupont cables are used to connect it to the board under test.
Not bad for about an hour's worth of effort, and it's vastly sped up my programming!
Just in case you don't know about one of the handiest things on ebay, the picture below shows a ribbon cable with single female Dupont header connectors on each eand. Thes cost a few bucks a piece but make it a snap to connect rows of header pins. Just peel off as many conductors as you need and make your connections. They hold tight to header pins.
Here are some detals about the enclosure. The dark strip you see in the pictures about is a light pipe designed for 4 3mm LEDs. The sides have slots to support a printed circuit board, however the enclosure is actually designed to support a circuit board on the posts that hold the box together. That's what the drawing below is sized for.