Maker Pro
Maker Pro

Question: How to make a counter/timer using PC mouse input

I would like to count the number of wheel revolutions of my indoor bike
during training indoors, and don't know anything about electronics.
I've taken apart an old, $2.99 mouse from an older PC and was able to
"read" when the mouse buttons were clicked using javascript. I'd like
to use that concept to make a bicycle wheel counter and write a
javascript to keep track of speed. Any suggestions on how I'd do it?
 
R

Randy Day

Jan 1, 1970
0
I would like to count the number of wheel revolutions of my indoor bike
during training indoors, and don't know anything about electronics.
I've taken apart an old, $2.99 mouse from an older PC and was able to
"read" when the mouse buttons were clicked using javascript. I'd like
to use that concept to make a bicycle wheel counter and write a
javascript to keep track of speed. Any suggestions on how I'd do it?

If the bike wheel has spokes, mount a
lever-action microswitch on the fork so
that it depresses when a spoke goes
by. Wire the switch in parallel with
your mouse button.

HTH
 
P

paul

Jan 1, 1970
0
Randy Day said:
If the bike wheel has spokes, mount a
lever-action microswitch on the fork so
that it depresses when a spoke goes
by. Wire the switch in parallel with
your mouse button.

HTH

I was going to suggest the same but use a reed switch and magnet
 
C

Chris W

Jan 1, 1970
0
I would like to count the number of wheel revolutions of my indoor bike
during training indoors, and don't know anything about electronics.
I've taken apart an old, $2.99 mouse from an older PC and was able to
"read" when the mouse buttons were clicked using javascript. I'd like
to use that concept to make a bicycle wheel counter and write a
javascript to keep track of speed. Any suggestions on how I'd do it?
Best of luck on what sounds like a fun project, but if all you want to
do is know how fast the wheel is spinning, there are numerous bicycle
speedometers that work by mounting a small magnet to the wheel and read
the signal of the magnet going buy a sensor of some kind. You can enter
the rolling circumference of your wheel into them and they will track
speed, distance and a number of other things. They range in price form
$20 to a few hundred. They call them Cyclocomputers. I'm sure your
local bike shop will have them, or you can order them on line. My to
favorite bicycle mail order companies are listed below

http://www.performancebike.com
http://www.nashbar.com

--
Chris W

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
http://thewishzone.com
 
K

Kitchen Man

Jan 1, 1970
0
If the bike wheel has spokes, mount a
lever-action microswitch on the fork so
that it depresses when a spoke goes
by. Wire the switch in parallel with
your mouse button.

That's going to be a tremendous amount of wear on the switch, there will
be dozens of mechanical actions for each revolution. This type of
operation would be implemented much more reliably with a magnet on the
rim and a stationary hall-effect sensor. There are already many such
devices available on the marketplace (bikenashbar.com for one), and the
inputs from the device could be wired in parallel to the mouse input, as
well as the original equipment. That would give a double-check that the
numbers are accurate.
 
J

John Fields

Jan 1, 1970
0
I would like to count the number of wheel revolutions of my indoor bike
during training indoors, and don't know anything about electronics.
I've taken apart an old, $2.99 mouse from an older PC and was able to
"read" when the mouse buttons were clicked using javascript. I'd like
to use that concept to make a bicycle wheel counter and write a
javascript to keep track of speed. Any suggestions on how I'd do it?

---
I'd paint a small section (maybe 1") of the rim flat black and then
use a reflective opto like:

http://www.fairchildsemi.com/ds/QR/QRB1133.pdf

to sense when it went by.
 
B

Bob Masta

Jan 1, 1970
0
I would like to count the number of wheel revolutions of my indoor bike
during training indoors, and don't know anything about electronics.
I've taken apart an old, $2.99 mouse from an older PC and was able to
"read" when the mouse buttons were clicked using javascript. I'd like
to use that concept to make a bicycle wheel counter and write a
javascript to keep track of speed. Any suggestions on how I'd do it?

Hmmm, instead of clicks, how about the position info?
The cheapie mouse probably uses an optical encoder
that looks at a slotted or lined wheel via an LED and
phototransistor. You'd need to count the pulses per
second. I suspect you could rig the LED and phototransistor
to look at your spokes. I have no experience with
Javascript, so I don't know what access you have to the
mouse position info. The routine you'd need might
require reading the mouse position at a known rate,
then repositioning to the center of the screen so the
coordinates don't run off-scale. Getting a "known rate"
from Windows may be a problem, depending on how
accurate you want this, so you might want some external
circuitry to help out here.

Best regards,


Bob Masta
dqatechATdaqartaDOTcom

D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
 
R

Rich Grise

Jan 1, 1970
0
Yeah, I missed the "indoor" part. 40 lashes with a wet noodle? ;-)

Sorry.
Rich
 
Top