-
Notifications
You must be signed in to change notification settings - Fork 8
USB Port as GPIO
One of the limitations of the Bifferboard case is that it has few exits. One of these is the USB port. While playing around with some stripboard I noticed that even though the USB connector contacts are not exactly 0.1 inch pitch you can easily align stripboard such that it connects to them.
Similar, but not exactly the same as some low profile USB storage sticks. The trouble is, I have many simple projects needing GPIO, but don't always want to go via a USB->GPIO converter. There's no point in having the extra cost or complexity. One example is a doorbell that generates a UDP packet. You could use a USB->Serial converter and sample one of the modem control lines to pick up a contact closing, but it just adds work both in the wiring and the software.
So I took a look at where the USB data lines go, and it seems they go from the IO board direct to the CPU board, and no other components are involved on the IO board. If the pins on the CPU board are cut, the USB connector is then free to be used for two digital IO lines to exit the enclosure.
One of the lines can be connected to the push-switch IO pin. This is what I decided to use for my doorbell because it means pushing the button has the same effect as ringing the bell.
After this mod, it's simply a matter of cutting and then carefully filing down some stripboard so it sits in the right place. There are different thicknesses of stripboard, the 1.6mm stuff works very well, but if you have thinner stripboard, you can bend the two lower springs on the USB socket shell up so the board is a tighter fit and that also seems to hold reasonably firmly.
Of course, if you do have practically any broken USB device with an 'A' connector and a lead on it you could hack it off and use that instead, when I did this project there was nothing to hand because I'd recently had a clear-out of broken stuff (the recycling collectors now take home electronics). The two yellow wires go direct to my doorbell.
The full rootfs (which can easily be placed on a 1MB flash device if you have one) can be found here..
The main daemon script will send UDP packets at 10mS intervals so long as the button is pressed, and will sample the button at 1mS intervals to make sure it catches the press.