PRT-12080

VKey Voltage Keypad Hookup Guide
Introduction
If you need to add a keypad to your microcontroller project, but don’t want
to use up a lot of I/O pins to interface with it, the VKey is the solution for
you. It outputs an analog voltage to encode which key has been pressed,
which can in turn be read by an analog to digital converter on a
microcontroller.
VKey Voltage Keypad
Traditional digital keypad interfacing techniques can require a large number
of digital I/O lines. One common arrangement uses N digital outputs and M
digital inputs to interface with an N*M array of keys, as described here. On
a small controller, there may not be many I/O pins left for other tasks.
The VKey board has 12 pushbutton switches and some supporting circuitry.
It outputs an analog voltage that represents which of the keys is being
pressed. This output can be sampled using a single channel of ADC,
allowing 12 keys to be scanned using a single analog input pin.
Covered In This Tutorial
This tutorial will guide you through connecting the VKey to an Arduino, and
it introduces a library that tells the application which key is currently
pressed.
Required Materials
VKey Voltage Keypad
Arduino, RedBoard or any Arduino-compatible board.
Male PTH headers or right angle PTH headers.
Jumper Wires
Page 1 of 8
Suggested Readin
g
Voltage, Current, Resistance, and Ohm’s Law
What is an Arduino?
Switch Basics
How to Solder
Working with Wire
Analog to Digital Conversion
Voltage Dividers
Board Overview
Looking at the front of the board, we see an 3 by 4 array of tactile switches
and three connection pads near the bottom edge of the board.
Front of VKey
The connection pads are as follows.
GND should be connected to the ground of the host circuit.
Vout is the analog output of the keypad, and should be connected to an
analog-to-digital channel (such as A0, A1, etc on an Arduino).
V+ is the power supply, and should be connected to a voltage between
3.3V - 5.5V.
How It Works
Take a look at the back of the VKey.
Back of VKey
Page 2 of 8
The IC is a dual opamp, used as a current source and buffer amplifier. The
current source drives a string of resistors that form a voltage divider, and
the tact switches select voltages at the different taps of the divider.
See the resources section for links to a much more detailed guide to the
internals of the VKey.
Each of the buttons on the VKey produces a unique analog voltage, as
listed below/
Key Number V (5V supply) V (3.3V supply)
None .057 .053
12 .198 .194
11 .396 .388
10 .596 .583
9 .794 .776
8 .992 .970
7 1.190 1.164
6 1.388 1.358
5 1.585 1.551
4 1.781 1.744
3 1.979 1.938
2 2.176 2.131
1 2.372 2.323
As you can see, with a 5V supply, each successive button adds about 200
mV to the output voltage – at 3.3V the voltage per step is slightly less.
One situation to consider is when more than one key is pressed at the
same time. The VKey implements high-key number (or low voltage) priority
– when more than one of the switches is closed at a time, the output will
indicate the higher key number. For instance, if you hold down 5 and 9
together, the output will indicate key 9 is pressed.
Assembly
The VKey comes with the surface mount components assembled, but the
PTH tactile switches are loose, and need to be soldered to the board.
Contents of the VKey package
The first step in hooking up the VKey is to solder in the key switches.
out out
Page 3 of 8

PRT-12080

Mfr. #:
Manufacturer:
SparkFun
Description:
Daughter Cards & OEM Boards Vkey Voltage Keypad Voltage Keypad
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet