■ PHOTO 5. Close-up
of resistors on BS2.
■ PHOTO 6. Close-up of keypad with header pins.
module. For outputs marked Vdd, Vss, Vin, RES, P01, P02,
and P03, install the female header pins on the top
(component) side of the PCB. All remaining outputs (P04
through P15) had the female header pins installed on the
underside of the PCB (See Photos 2, 3 and 4.)
At this point it’s a good idea to test out your BS2
module. First download and install the most recent version
of the BASIC Stamp Editor (BSE) from www.parallax.com
• BASIC Stamp 2 OEM module kit ($30.95; Parallax.com,
• Velleman 12-key keypad ( AllElectronics.com part #
KP- 12, or from electronicpartsforless.com or
willyselectronics.com part 12KEY.) NOTE: The keypad
must have separate connectors for each of the 12 keys,
plus a common connector; a 3x4 matrix type keypad is
• ( 14) 10K ohm resistors, 1/4 watt.
• 220 ohm resistor, 1/4 watt.
• 1 µF electrolytic capacitor.
• ( 2) SPST toggle switches.
• Female breakaway headers, 16-pin strip ( Sparkfun.com,
SKU# PRT-00115); (Optional — only needed if using a
project case and mounting keypad on outside.)
• SPST pushbutton switch, N.O. contacts.
• 9V battery clip with leads.
• External 8 ohm speaker with a connection cable, and 1/8
mono jack and plug for connecting with the encoder’s
• Solid hookup wire (and ribbon cable if using to
interconnect keyboard and BS2 module).
• Breadboard (for temporary project mounting if not
installing in a case).
/tabid/441/ Default.aspx. You will need this in order to
transfer programming code from your computer to the BS2
during construction, as well as to download your own
modified code later on. Connect the positive terminal of the
nine-volt battery to the Vin pin, and the negative terminal to
the Vss pin. Connect the BS2 to your PC via either a DB9
serial cable or a supported serial-to-USB adapter. Once the
BSE recognizes your module, you can test it out with a
simple LED flasher circuit.
Connect the anode of an LED to pin 5 and connect the
cathode to the Vss (ground) pin via a 220-ohm resistor.
Then, download and install the LEDTest.bs2 program to the
BS2 module (programs are available for download at
www.nutsvolts.com). The LED should flash approximately
once per second. If it doesn’t, check all connections on the
module, as well as the LED test circuit, and fix any wiring
errors. Once the module tests okay, remove the LED, 220-
ohm resistor, and power connections, and disconnect the
PC interface cable.
Step 2: Add resistors.
Once you have the BS2 module
assembled and tested, solder a 10K
ohm resistor to each of the pins
labeled P1, P2, and P4 through P15
on the underside of the board. As
shown in Photo 5, be sure to keep the
lead from the board side of each
resistor as short as possible. Solder the
loose ends of these 14 resistors
together via a short length of wire,
forming a common connection to the
BS2 module’s grounding pin (Vss).
This is necessary in order for the
microcontroller to function properly,
as any switches connected to its I/O
pins must be pulled low via resistors
so that they are not floating when in
the off (switch open) state.
■ SCHEMATIC 1.
Step 3: Connect the keypad and
Now, connect the 12-key keypad
to the appropriate BS2 module pin
connections (see schematic.) This may
be accomplished via ribbon cable or
other point-to-point wiring. Use
adequate lengths of wire between the