■ FIGURE 4. Stripboard layout for a
simple two-key touchpad.
parameters, but I was in too much of
a hurry! When I ran the program
without touching the jumper wire,
the value of variable b1 that was
displayed in the Terminal Window
ranged between 13 and 15; as soon
as I touched the wire (actually, the
insulation – more about that shortly),
the value of b1 jumped to 50 or
more. In fact, if I squeezed the
insulation between two fingers, I
could easily raise the value above
200. However, it’s not the pressure of
the “squeeze” that it being sensed;
it’s the greater surface area of the
two squeezing fingers that come in
close proximity to the wire.
Before you actually begin your
own experiments, I want to mention
an important aspect of using the
touch sensors on the 18M2, or any
of the other M2 processors that will
■ FIGURE 5. The completed two-key
touchpad.
be released in the future. The term
“touch sensor” is actually a bit of a
misnomer, in that the sensor itself (in
this case, the jumper wire) is never
actually touched. In fact, the
documentation in Section 2 of the
manual includes the following,
somewhat ominous warning: “Never
‘directly touch’ a touch sensor (e.g., a
piece of bare wire)! A touch sensor
must be electrically isolated from the
end user.” So, “proximity sensor”
might be a more apt term for what’s
involved, but don’t forget that
PICAXE processors are used
throughout the British public school
system which may explain the choice
of terminology. In any case, it’s easy
to confirm that proximity is what’s
being measured. When my little test
program is running, if I place my
finger close to the insulation on the
jumper wire, I can easily increase the
value of b1 to 30 or more without
actually touching the insulation.
So, as soon as you can get your
hands on an 18M2, set up our little
test circuit on a breadboard. The
circuit is so simple that you don’t
even need a schematic, just use the
photo shown in Figure 3.
Next, use the Programming Editor
(or AXEpad) to type in Touch Test1.bas
and download it to your 18M2
circuit. See how your results compare
with mine, and what other interesting
findings you can discover.
EXPERIMENT 2:
CONSTRUCTING AND
TESTING A “PROPER”
TOUCHPAD
After playing with (oops – I
meant to say
experimenting with)
my jumper wire
sensor, I decided to
construct a simple
touch pad.
Naturally, I used a
small piece of
stripboard, and to
keep things simple I
limited myself to just two “keys” for
my first attempt. The stripboard
layout that I used is presented in
Figure 4. I haven’t included a bottom
view because the only two cuts that
need to be made on the bottom of
the board are clearly visible in Figure
4. (Their function is to simply create a
dead zone between the two keys.)
The two-pin male header at the top
of the stripboard is reverse-mounted
so that the keypad can be directly
inserted into a breadboard,
connecting the two keys to two
adjacent touch inputs on the 18M2.
The two bare wire jumpers on the
bottom of the board each connect
seven adjacent traces to one of the
two header pins. To solder each
jumper to the bottom of the board,
just hold it in place with a small
spring clamp, solder it to three or
four traces, and then remove the
clamp and solder it to each of the
remaining traces spanned by the
jumper.
Figure 5 is a photo of the
completed keypad, and Figure 6
shows it inserted into the same
breadboard circuit we just used for
our jumper wire. The two pins of
the keypad are inserted next to
pins B.1 and B. 2 of the 18M2 —
both of which are touch inputs. I
made the paper label on top of
the keypad by printing out the
stripboard layout in actual size, and
trimming it to fit. Before I taped the
paper label to the top of the
stripboard (using cellophane tape), I
covered the bottom of the board
with a piece of electrical tape to be
sure the board didn’t make electrical
contact with any jumpers that might
be located beneath it on a
breadboard project. The process
was simple, and it makes it clear
that it will also be easy to create
multi-colored graphic labels for a
couple of the larger keypads that I
already have in mind.
In order to test our new
keypad, we only need to make two
minor modifications to the
Touch Test1.bas program that we
just used:
■ FIGURE 6.
Breadboard setup
for Experiment 2.
1) Right after the touch B.1, b1
18
December 2010