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?
Question: How to make a counter/timer using PC mouse input
Feb 27, 2005
6 Replies
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
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
formatting link
formatting link
Chris W
Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
http://thewishzone.com
On Sun, 27 Feb 2005 00:03:39 -0600 in sci.electronics.basics, Randy Day wrote msg :
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.
Al Brennan
http://www.xmission.com/~tiger885/motorbike/NART/nart.html
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%2FQRB1133.pdf
to sense when it went by.
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
formatting link
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required