REVIVING AN ANDROBOT BOB: Part 4
Schematic of new
footlight driver board.
a sense of direction. In this instance, we’re installing the
Dinsmore compass sensor. The Dinsmore sensors come in a
couple different variants. The 1490 sensor can output eight
digital compass positions (N-NE-E-SE-S-SW-W-NW) while the
1525 sensor is analog based and outputs a continuous
analog sine/cosine signal. This is capable of higher
resolution than the digital sensor. The actual accuracy will
depend upon the resolution of the ADC (analog-to-digital
converter) it is connected to.
In this project, BOB will be using the 1490 digital
version since that is what I had on hand. The placement of
the actual sensor is important since it should not be located
too close to the main drive motors, head motor, or speaker.
Footlight driver board (component side).
Footlight driver board (solder side).
Basically, the sensor should not be near anything that
may generate stray magnetic fields which may affect the
readings of the compass module.
The wiring of the digital compass is straightforward as
it just has four digital outputs; one output each for North,
South, East, and West. Depending upon direction, either
one or two of these will be active. This will give us a total
of eight possible valid combinations. These would normally
just be connected to digital inputs but they’ve already been
used up. No worries though as we can just connect these
four lines to the analog ports instead and treat the values
we see as digital ones.
This may seem odd at first, however, this works just
fine as long as we take the analog reading and treat any low
value (less than 128) as a 0 and
any value over 128 as a 1.
With only eight different
readings, BOB will only get a
general direction of which way
he is facing. There is a way we
can improve the accuracy,
however. For example, say we
want BOB to point as close to
North as possible. If we just go
by watching the North bit to see
when it is the only one on, we’ll
know we’re pointing in that
direction but we could be right
60 SERVO 05.2008