In a previous post I wrote about how you can control the function of the Raspberry Pi’s software through writing scripts, but one of the remarkable things about the Pi is that it is also capable of interacting with the physical world through its GPIO pins.
GPIO stands for ‘General Purpose Input/Output’ and this refers to the 25 pins on the outer edge of the Pi (next to the yellow video out socket) and these pins are the physical interface between the Pi and the outside world. They allow the Pi to send signals to external (or peripheral) devices. These can a wide variety of devices, for example; LED lights, magnetic sensors, PIR sensors and most importantly to this example, Buttons.
The second part of this project was to be able to use the Pi to replace Stockport Museums current ‘Listening Posts’, that is a wall-mounted set of buttons which enables visitors to select individual tracks, be they audio or video.
To do this, I need to be able to get the Pi to register a single from an external button. To do this, I first had to prototype a simple electrical circuit using a ‘Breadboard‘ a solderless circuit prototyping board.
To test if the Pi is registering this as an input, I used a simple script that posts ‘Button Pressed’ in LXTerminal every time the button is pressed.
From this, we can use this same circuit to expand and increase the amount of buttons to essentially as many buttons as we can fit as inputs on the GPIO pins.
For more detail: Research: Raspberry Pi – Pins, Buttons and Circuits