Membrane Keypad Interface

Suppose you've built a project; some sort of device that, from time to time, needs to have some data or commands entered into it.  The first thing that comes to mind is to connect that device to the serial port of your PC but what if you don't wish to do that for some reason.  You could use a keypad.  If you only needed to input some numbers it wouldn't be too much of a problem to connect a 3x4 keypad.  But if you need to be able to input the whole alphabet then it is more difficult.

This page describes an interface from a 40 keyswitch membrane keypad to a serial line.



Here is the schematic of the interface board.  There are photos of as assembled board below.

If you connect the board to your own host or to a PC via a USB you will have power.  Otherwise you must supply +5 Volts;  header H1 is a good place.  Be very careful of polarity.

The program is in assembly.  It's already assembled; all you need to do is load the Keypad.s19 file but the source is there.  Feel free to study and change to suit your needs.


Here is the software for the MC9S08SV16 MPU. 

The keypad has ten function keys.  Each will print to the serial port a string that is user programmable.  To access the operating system mode put a shorting jumper on JP5 and power-up.  You should get a screen like to the left.  Now, from your PC you can edit any of the ten messages that the function keys will send out when pressed.
Click for larger view Click for larger view Here the keypad interface board is connected to a RS-232 to TTL board from Sparkfun (PRT-00133).

Note that the keypad is attached upside down.  Although the circuit is correct and the software works I seem to have been a little dyslexic when I laid out the pc board.  The header for the keypad is reversed right-to-left from what it should be.  So you have to use it with the board upside down.  The same applies to the JP4 header.  The photo to the left with the Bluetooth module was just for the photo;  it should be upside too.

Click for larger view
Click for larger view

Parts Source

The 40 key 5x8 membrane keypad.

You can get a blank printed circuit board from Batch PCB

To interface with a PC you will need a RS-232 to TTL or a
USB to TTL adaptor.  Here is a list I made of some sources.


For BDM's

  Lowest cost.

The 9S08 family is programmed using a Background Debug Module.


Roger's Embedded Microcontrollers Home Page     

This page written by Roger Schaefer. Last updated  May 12, 2012