Previous articles in
Nuts & Volts
Mentor’s Friend retro
computer, its Color
system,” and some
simple interfaces that
you and a young
protégé can use to
sense and control the
world outside the
Amigo circuit board
from inside Color
BASIC. This article will
discuss how you can
with your Amigo
using a simple RC
decay circuit and
capability won’t be
too precise, but it will
be good enough to
add an important tool
to your Amigo “sense
and control” toolkit.
Measuring Resistance with the Mentor’s Friend To get started, let’s review the Amigo “out-of-the-box” capability. As discussed in previous articles, Color BASIC has only two commands to sense or control the state of a Propeller I/O pin: INA[x] and OUTA[x]. INA[x] presents a high impedance at I/O pin x; it returns a logical 1 for
voltages above about 1.6 VDC, and a logical 0 for voltages below about 1.3 VDC.
OUTA[x] does the reverse, placing 3. 3 VDC on pin x when set to 1, and 0 VDC
on pin x when set to 0. So, INA[x] and OUTA[x] give us some “on or off” capability
to sense and control voltages in circuits external to the Amigo.
Many simple and fun Amigo projects require Color BASIC to read the value of
an external resistance, like on potentiometers, photocells, and a host of Forrest
Mims’ home-built sensors. What’s a mentor to do?
It’s fairly simple to use INA[x] to detect when a resistive sensor crosses a
specific threshold value. As shown in Figure 1, the INA[x] ability to sense a voltage
level (and thus to detect a resistance) is limited to three bands: 1.6 to 3. 3 VDC
(logic 1); 0 to 1.3 VDC (logic 0); and 1.3 to 1.6 VDC (indeterminate). This is not
sufficient to give us a continuous resistance measurement capability, but we can
use it to create “threshold detect” circuits that indicate when a resistive sensor
passes a certain threshold.
We can do this by placing our sensor in series with a variable resistance, setting
the sensor environment to the desired threshold level, then adjusting the variable
January 2018 41
FIGURE 1: The Color BASIC command INA[x] only detects three bands of voltage levels.
By Dane Weston