Cool project - I think the reed switch approach will work, and hardware-wise it may become the simplest part. Sometimes you'll get a double-count if your magnet isn't the right distance away from the switch (double-count usually means it's too close), but I have used them pretty reliably to measure motor shaft revolutions at about 1750rpm. What do you think the max rpm of your bike tire will be? (Let me see - 26" tire at 100mph would be 1292rpm or 22Hz - it should be o.k. - check my math). You can take a lot of readings and filter/average at a higher level if bounce is a problem, and also do a little bit of debouncing (but not too much if you are having to measure high speeds with a slow timer - typically two identical readings at 4kHz has been enough for me to call a reed switch stable, but I also use a low pass filter on the input of around 10K and 0.01uF). Hamlin is an industry standard for the "pencil" type reed switch and in practice, they almost never fail. Your sourcing signal can be about 500uA at 5V (or less - again you can see my liberal use of 10K resistors), and only active when the magnet is near so power shouldn't be a problem. Still, in a battery application, it's best to make sure those type of current sources are off when the unit is off. To get the best performance/noise immunity, you'ld like to have the switch on half the time and off half the time in a revolution for a nice square wave, but I imagine that's almost impossible in your application. Still, try to maximize the time the magnet is activating the switch by keeping the sensor/magnet near the center of revolution. For example, if your reed switch only sees the magnet through 5 degrees of the rotation of the tire, and you're at 22Hz as above, you're only going to see the signal input for a maximum of 644uS. Nyquist says then that your sample rate should be at least 322uS or 3.1kHz, and if you want to debounce at least 2 in a row, you should be at a sample rate of more like 6.2kHz (or better), which I'm sure you can handle, but it never hurts to have some margin by making that 5 degrees 15 if you can. Good luck and keep designing, Tony solarwind wrote: > I've gotten (more so) into bicycle riding recently and have been > looking for a speedometer. The ones sold at stores are expensive for > such a simple device, so I'm going to make one (which is more fun, > anyway). And now that I know how to build a PCB, this project should > be more interesting. > > The most complex part about this is going to be the detection of RPM. > > One option is to use a reed switch mounted near the spokes and a > magnet mounted on the spoke itself. A few questions about this though: > > * Will a reed switch be fast enough (in terms of switching speed > capability) for this purpose (bicycle tire RPM)? > > * Does a reed switch open and close cleanly or does it generate a lot > of noise? Will denouncing be required? > > * Is a reed switch reliable? Will it fail to switch sometimes even if > the magnet passes by the switch? > > What other options are available to detect RPM? > > Once the RPM is available, some simple math involving angular velocity > and the diameter of the tire and such is enough to calculate the speed > quite accurately. Other components of the project will include: a PIC > microcontroller and an LCD display. > > The whole thing can be powered by batteries, small solar panel, or > even a low power bicycle generator with a good regulator and > capacitors. > > -- [ solarwind ] -- http://solar-blogg.blogspot.com/ > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist