Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Monitor multiple buttons with only one Raspberry Pi input

Monitor multiple buttons with only one Raspberry Pi input

Reading the status of more than one digital input such as a button with only one input pin is a common method of minimising I/O usage and is accomplished with a resistor network and a single analogue-to-digital pin. However as the Raspberry Pi doesn’t have an ADC, another method is required. 

One example of this has bee demonstrated by Instructables member JRV31 whose solution still uses a resistor network, but instead uses the resulting voltage to charge a capacitor at a varying rate depending on which button has been pressed. The Pi then monitors the duration between state changes of the digital pin connected to the circuit – and then with the timing knowledge can determine which button has been pressed. 

An ingenious solution to a common problem, of which you can learn more about from the Instructable page. And for more, we’re on facebookGoogle+, and twitter – so follow us for news and product updates as well.

Another neat way to interface your Raspberry Pi with external hardware is to use an Arduino-compatible board – and one neat example is the Freetronics PiLeven board:

The PiLeven is an Arduino-compatible board based on the Arduino Uno, but with a few changes. Obviously it’s a bit of a strange shape! The PiLeven fits right on top of a Raspberry Pi (either model B or B+) using the Raspberry Pi expansion headers.

The PiLeven also has a high-current switchmode power supply, so you can plug in anything from 7V to 18Vdc using the standard 2.1mm jack. The PiLeven can power the Raspberry Pi, so you don’t need a regulated 5V USB connection anymore.

Serial communications on the PiLeven is linked through to the Raspberry Pi, so your Pi can upload new sketches straight to the PiLeven or send/receive data and commands. We’ve included level shifters so the 3.3V Pi can talk safely to the 5V PiLeven. And you can plug standard Arduino shields right into the PiLeven, giving your Raspberry Pi access to the huge range of shields already available. For more information about the PiLeven, including our tutorials – and to order yours today, visit the PiLeven webpage.

Read more Here







 

More Articles to Read

Serial seven segment LED display shield
Serial seven segment LED display shield
G-code controlled drawing plotter
G-code controlled drawing plotter
An Arduino round word clock
An Arduino round word clock
The Sandwich-o-Matic will make your lunch automatically
The Sandwich-o-Matic will make your lunch automatically
Scalar Network Analyser Jr
Scalar Network Analyser Jr
An Arduino-controlled automated whiskey distillery
An Arduino-controlled automated whiskey distillery
The Rex800 looks like a dinosaur Terminator
The Rex800 looks like a dinosaur Terminator
Home Environment Monitor
Home Environment Monitor
Understanding the Operation of the Frequency Synthesizer in Maxim’s RF Transceivers
Understanding the Operation of the Frequency Synthesizer in Maxim’s RF Transceivers
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
Noisy ESP8266
Noisy ESP8266
App note: Noise analysis for high-speed op amps
App note: Noise analysis for high-speed op amps
Skill Sunday: Arrays
Skill Sunday: Arrays
App note: Infrared remote control implementation with MSP430FR4xx
App note: Infrared remote control implementation with MSP430FR4xx
Gesture Controlled Smart Home
Gesture Controlled Smart Home
Design for a Wideband, Differential Transimpedance DAC Output
Design for a Wideband, Differential Transimpedance DAC Output
Wrist thrusters let you fly through the water effortlessly
Wrist thrusters let you fly through the water effortlessly
Bertan/Spellman 225-20R HV power supply teardown
Bertan/Spellman 225-20R HV power supply teardown
Blinking Christmas Lights
Blinking Christmas Lights
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display

Top


Shares