Hacker News new | ask | show | jobs
by makomk 3992 days ago
It's less trivial than you might think, because the Pi GPIO connector is unkeyed and someone will inevitably plug it in backwards (or worse, one row of pins over in some direction).
1 comments

It's trivial enough in my usage, which involves a breadboard and a Pi that are dedicated to one another and never disconnected. I'm not sure why that isn't a feasible option for educational use; instead of issuing a naked Pi, or a Pi and an Arduino, just issue a Pi+breadboard pair, already connected together.

If you're especially worried about mishaps, and don't mind modifying hardware in ways that aren't easily reversible, you could even use adhesive to permanently fix the IDC connectors in place.

If, conversely, you don't want to permanently connect all the parts to one another, you could also clip J8 pins 2 and 4 (5VDC) and 39 (one of several ground pins), and key the Pi-side IDC connector by stuffing the matching holes with a dab of quick-set epoxy. That by itself will suffice to protect against inadvertent 5V -> GPIO shorts; if you further use a breakout cable with keyed IDC connectors (e.g. [1]), and a breadboard breakout with a shrouded, keyed header (like an old-style IDE connector), then you end up with an entirely safe system.

And, taking that last idea further, you can get the same safety benefits at minimum hardware modifications (and no irreversible mods to the Pi) if you use:

- a ribbon with keyed connectors;

- a breakout with a keyed, shrouded header, and pins 2 and 4 removed;

- and a keyed shroud, such as [2] with the shipped pins removed, press-fitted to the Pi's J8 header.

On the one hand, the keyed shrouds prevent fumble fingers from inadvertently misplugging the IDC connectors on either side; on the other, the absence of pins 2 and 4 on the breakout prevents inadvertent overvolting of GPIO pins.

(And all you need is a bit of protoboard and some solder to make the breakout, using the pins removed from [2] as the breadboard-side pins of the breakout. In fact, if you have students old enough to be trusted with soldering irons, this is not only parsimonious of materials but an excellent teaching opportunity in its own right!)

Granted, none of these solutions is entirely ideal. The point isn't to provide a one-size-fits-all; instead, I'm trying to demonstrate that there are plenty of ways to solve this problem, many of which are less expensive and more user-transparent than pairing an Arduino with each Pi.

[1] http://amzn.to/1foCXLy [2] http://www.mouser.com/ProductDetail/TE-Connectivity-AMP/5103...