I have Type 2
Diabetes and have to
exercise on a regular
basis to keep my
blood sugar under
One form of low impact
exercise is an exercise
bike, however, as with
any exercise, we are
more likely to do it on a
regular basis if we can
As a software and
hardware developer, I
decided to create an
interface to one of my
exercise bikes. Before I
started, I set out with a
■ The interface had to
work with any bike.
■ The interface had
to work with a
Desktop PC, Laptop,
or Pocket PC.
■ The cost of the
interface had to be
very cheap and use a
minimal amount of
After a bit of experimenting, I
think I have a great start
towards a really cool interface that
will work with any bike.
$25 at Walmart.
I decided to try the serial port route.
I thought to myself: What is the
best way to interface to a PC?
Well, every PC and laptop has
USB. The downside is that the
interface can be expensive
and pocket PCs don’t have a USB
interface that’s accessible.
Printer ports are out because
they are increasingly being
replaced by USB. I could use IRDA,
but again, the interface circuitry
would be too complicated.
What about serial? Most of the
newer laptops don’t have serial
ports anymore. Even the laptop I’m
using to write this article does not
have one. However, you can pick up
a USB-to-Serial converter for under
One of my first questions was
how to detect the peddle movement on the exercise bike. Easy! I
decided to use a Hall-effect sensor.
These can be purchased at several
online stores for a few dollars.
There are several Hall-effect
sensors available. We will be using
a 6853 chip that runs off of 5V and
has a normally low signal on its
output lead (pin 3). When a
magnetic field is detected, it floats
the lead so you can pull it high with
a 1K resistor. Some Hall-effect
sensors will latch and need to be
released. This type will not work for
By connecting the output lead
to the receive pin of a serial interface, the PC will read a 0 each time
the sensor sees a magnetic field. The
neat thing is that the result will
be the same at just about any
baud rate. Why does this work?
The idle state of an RS232
signal is - 12 volts. This is the
low state. When the start bit
occurs, it goes from the low
(idle) state to high. Sound
familiar? This is what happens
when our sensor detects a magnetic field. Well, kind of. In reality, we go from a 0 level to a +5V.
This will work on 90% of the
newer devices as they are very
forgiving. They see anything less
than .5V as a low and above 3V
as a high. I tested it on every
device I had in my lab, which
■ FIGURE 1