2 ms·
This is exactly (minus the "screen printed" part) how I built this bugger: http://www.youtube.com/watch?v=oIFA7msO_x0 http://www.youtube.com/watch?v=oIFA7msO_x0
by moron4hire 13y ago
This is exactly (minus the "screen printed" part) how I built this bugger: http://www.youtube.com/watch?v=oIFA7msO_x0 http://www.youtube.com/watch?v=oIFA7msO_x0
The key electrical concept is a voltage divider: http://en.wikipedia.org/wiki/Voltage_divider http://en.wikipedia.org/wiki/Voltage_divider
Each row of three buttons is in parallel with each other, each with a different value of resister. When a switch closes, it allows current to flow through that switch's resistor. The final voltage at the end of the row of buttons is directly related to which buttons are pressed. Given the right selection of resistors, you can tell exactly what combination of button presses have occurred.
A diagram I had drawn to explain it to a project mate: https://raw.github.com/capnmidnight/GeblinkenKiosk/master/doc/analog%20button%20encoder.png https://raw.github.com/capnmidnight/GeblinkenKiosk/master/do...
And the (can't remember if it's accurate, but certainly close enough to get the concept) diagram of the full circuit: https://raw.github.com/capnmidnight/GeblinkenKiosk/master/doc/mp3-kiosk.png https://raw.github.com/capnmidnight/GeblinkenKiosk/master/do...
The spreadsheet I wrote to figure out the voltage thresholds for given resister values: https://github.com/capnmidnight/GeblinkenKiosk/blob/master/src/analog%20button%20encoder.xlsx https://github.com/capnmidnight/GeblinkenKiosk/blob/master/s...
And the code that read the analog pins on the Arduino to figure out the state: https://github.com/capnmidnight/GeblinkenKiosk/blob/master/src/GeblinkenKiosk/kiosk.cpp#L49-L92 https://github.com/capnmidnight/GeblinkenKiosk/blob/master/s...