Shop OBEX P1 Docs P2 Docs Learn Events
Measuring Bicycle Speed — Parallax Forums

Measuring Bicycle Speed

ArchiverArchiver Posts: 46,084
edited 2000-10-23 18:26 in General Discussion
Why not try an rc circuit to ADC and use pulse from magnet to read voltage
then discharge capacitor.

Murray

Original Message
From: <jimsp@y...>
To: <basicstamps@egroups.com>
Sent: Friday, May 26, 2000 7:36 AM
Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


> I'm trying to use the BS2 to measure and periodically log the speed
> of a bicycle. The wheels would be turning in the 60 to 600rpm range
> which is too slow to use the pulsin. I could use multiple magnets on
> the wheel but I would really like to avoid that. I thought I could
> use the LM2907(freq to voltage converter) followed by an ADC but I
> found the low frequency produced too much ripple. Based on time I
> would need about a .001sec resolution. The easy to use clock chips
> seem to have only 1sec resolution. Any suggestions on how I could
> solve this problem?
>
>
>
>

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 13:36
    I'm trying to use the BS2 to measure and periodically log the speed
    of a bicycle. The wheels would be turning in the 60 to 600rpm range
    which is too slow to use the pulsin. I could use multiple magnets on
    the wheel but I would really like to avoid that. I thought I could
    use the LM2907(freq to voltage converter) followed by an ADC but I
    found the low frequency produced too much ripple. Based on time I
    would need about a .001sec resolution. The easy to use clock chips
    seem to have only 1sec resolution. Any suggestions on how I could
    solve this problem?
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 15:22
    I know its a little extreme, but you could also attach an OEM GPS receiver
    engine to the bike and read the velocity output from the serial output of
    the GPS receiver, thus not having to worry about pulse measurement. It
    depends on your budget. also, don't forget the Stamp has little memory so to
    log speed would require that the data is dumped to another device to ensure
    data is not lost.

    Good luck!


    Original Message
    From: Murray Snowden [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Na7Myy062COjc_4l1y5-_pJ1u2xnP330xnf49olRS7EXMJ6aldJc639tpgEqxhohi4guHjgdrTY8uoZK]mursnow@m...[/url
    Sent: Friday, May 26, 2000 8:21 AM
    To: basicstamps@egroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    Why not try an rc circuit to ADC and use pulse from magnet to read voltage
    then discharge capacitor.

    Murray

    Original Message
    From: <jimsp@y...>
    To: <basicstamps@egroups.com>
    Sent: Friday, May 26, 2000 7:36 AM
    Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 15:28
    How about 2 magnets "closely" spaced?
    Only update/refresh the mph display when there is a valid number(not 0)
    returned.
    Haven't done the math on this.....but if the two magnets are very close this
    will give you a faster response. Of course you would have to have some
    electronics with this prior to the stamp......flip-flop?


    Original Message
    From: <jimsp@y...>
    To: <basicstamps@egroups.com>
    Sent: Friday, May 26, 2000 5:36 AM
    Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 15:46
    I like the closely spaced magnet idea.

    Another thought: You might be able to press a PAK-VII into service. With the
    prescaler you can measure some long pulses at lower resolution or short
    pulses at higher resolutions. http://www.al-williams.com/awce/pak7.htm.

    Regards,

    Al Williams
    AWC
    *New: 8 channel pulse output for servos, PWM, etc.
    http://www.al-williams.com/awce/pak8.htm


    >
    Original Message
    > From: jimsp@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ONC3YW99jmnSchDm8C4WZsaOdycwb_TUyZTv7nKiJJmtfc_0ssv0lvxSyVrk4gQjdcD4UdGJQSw33w]jimsp@y...[/url
    > Sent: Friday, May 26, 2000 7:36 AM
    > To: basicstamps@egroups.com
    > Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed
    >
    >
    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 17:01
    Or mabey...

    Use one of those generators used for head lights on bicycles. Measure the
    dc output, a little calibration and you got it. As a bonus the generator
    could power the BS2 or at least recharge battery.


    Mike.



    Original Message
    From: jimsp@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9cKO6OKzkLOoWdeC2b9P9NufbbqJ2W7sgIX-118NA8nUZc5GVGg3czSsQU-GvU3oxZ8AtqI]jimsp@y...[/url
    Sent: Friday, May 26, 2000 5:36 AM
    To: basicstamps@egroups.com
    Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    I'm trying to use the BS2 to measure and periodically log the speed
    of a bicycle. The wheels would be turning in the 60 to 600rpm range
    which is too slow to use the pulsin. I could use multiple magnets on
    the wheel but I would really like to avoid that. I thought I could
    use the LM2907(freq to voltage converter) followed by an ADC but I
    found the low frequency produced too much ripple. Based on time I
    would need about a .001sec resolution. The easy to use clock chips
    seem to have only 1sec resolution. Any suggestions on how I could
    solve this problem?
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 17:15
    (snip)
    > ....................I could use multiple magnets on
    > the wheel but I would really like to avoid that.
    (snip)

    What is your objection to magnets? Balance?
    I don't think small magnets, spaced evenly would
    cause a problem at the speed you mention, but as
    an alternative, how about optical sensing of white/
    black stripes painted on the rim? This shouldn't
    cause any balance problem, but may not work if
    you're a mudder.
    --Stu
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 17:27
    >The wheels would be turning in the 60 to 600rpm range
    >which is too slow to use the pulsin...... Based on time I
    >would need about a .001sec resolution. The easy to use clock chips
    >seem to have only 1sec resolution. Any suggestions on how I could
    >solve this problem?

    A programmed timer loop?

    x var word
    input 1 ' active low, capacitor debounced
    top: x=0
    wait: if in1 then wait ' await switch closed
    time0: x=x+1: branch in1,[noparse][[/noparse]time0] ' count & await switch open
    time1: x=x+1: if in1 then time1 ' count await switch closed
    other:
    ' calculate and log--
    here: branch in1,[noparse][[/noparse]here,top] ' await switch open


    The resolution will be on the order of one millisecond. Once calibrated, it
    should be well within your accuracy requirements.

    Other timer chips you may not have considered are described at:
    Steve Parkis' site
    http://home.earthlink.net/~parkiss/tm1summ.txt
    Peter Anderson's site
    http://www.phanderson.com/timer_1_2.html

    I hope that helps
    -- Tracy Allen
    Electronically Monitored Ecosystems
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 17:37
    I know much of the fun is the challenge, but you can buy a nice bike
    computer for $20-$30. Gives you speed, distance, avg. speed, max speed.
    etc. Check out www.nashbar.com.

    Stew Benedict

    On Fri, 26 May 2000, Witherspoon, Michael J wrote:

    > Or mabey...
    >
    > Use one of those generators used for head lights on bicycles. Measure the
    > dc output, a little calibration and you got it. As a bonus the generator
    > could power the BS2 or at least recharge battery.
    >
    >
    > Mike.
    >
    >
    >
    >
    Original Message
    > From: jimsp@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ujYEke0QTZkww_h9B_9T7ajFX_Mj23ZancR5934HxXrQFRr0XvH6047M73s_D-_GeBot4RJKIw]jimsp@y...[/url
    > Sent: Friday, May 26, 2000 5:36 AM
    > To: basicstamps@egroups.com
    > Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed
    >
    >
    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
    >
    >
    >
    >
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 17:45
    use the count command

    jimsp@y... wrote:
    >
    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 18:05
    I have done this with a stamp.

    connect 1 magnet to a wheel with a hall effect sensor.

    Connect an oscillator to a binary counter (couple hundred Hz) and the hall
    effect sensor to the stamp.

    When the wheel goes around it will pulse the stamp which will read the
    counter then reset it. The longer it takes the wheel to go around the
    higher the counter gets. Some simple math after that.

    The smack shack rare earth magnets work with a jameco hall effect sensor.

    This worked until I got pics :-)

    Mike
    Original Message
    From: <jimsp@y...>
    To: <basicstamps@egroups.com>
    Sent: Friday, May 26, 2000 8:36 AM
    Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 18:05
    I wonder if a proximity sensor could see a spoke there are some that
    have a switching speed of 800 hz

    LarryGaminde wrote:
    >
    > use the count command
    >
    > jimsp@y... wrote:
    > >
    > > I'm trying to use the BS2 to measure and periodically log the speed
    > > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > > which is too slow to use the pulsin. I could use multiple magnets on
    > > the wheel but I would really like to avoid that. I thought I could
    > > use the LM2907(freq to voltage converter) followed by an ADC but I
    > > found the low frequency produced too much ripple. Based on time I
    > > would need about a .001sec resolution. The easy to use clock chips
    > > seem to have only 1sec resolution. Any suggestions on how I could
    > > solve this problem?
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 18:26
    Bravo Mike! That will work perfectly.
    I am now educated.
    SmD

    Original Message
    From: Michael Licitra [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=DazM5dom8m6RLZsuHlObSsnHq7gBs1JNwnbim69ru7_2AebdIGbbPgcAOf1o5jXh1MDjzW9o_Ao]mikel2@b...[/url
    Sent: Friday, May 26, 2000 1:06 PM
    To: basicstamps@egroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    I have done this with a stamp.

    connect 1 magnet to a wheel with a hall effect sensor.

    Connect an oscillator to a binary counter (couple hundred Hz) and the hall
    effect sensor to the stamp.

    When the wheel goes around it will pulse the stamp which will read the
    counter then reset it. The longer it takes the wheel to go around the
    higher the counter gets. Some simple math after that.

    The smack shack rare earth magnets work with a jameco hall effect sensor.

    This worked until I got pics :-)

    Mike
    Original Message
    From: <jimsp@y...>
    To: <basicstamps@egroups.com>
    Sent: Friday, May 26, 2000 8:36 AM
    Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 19:35
    In prehistoric days, (before Stamps), I made a speedo/odo using an old relay
    coil biased by a Radio Shack toroid-shaped permanent magnet. It was mounted
    in a plastic box and clamped to the fork. Every passing spoke produced a
    pulse, so the resolution was very good. The output pulses were ~100-200mv
    and needed some squaring up. A crystal oscillator (tv color burst xtal &
    IC) was counted down to provide a counter gate, which translated to MPH.
    Distance was measured by total count.

    Nowadays we use one of the $30 units Stew referred to. It uses one wheel
    magnet, and doesn't have the resolution of my old one, but it sure is much
    smaller, and good enough.

    Ray McArthur


    > I'm trying to use the BS2 to measure and periodically log the speed
    > of a bicycle. The wheels would be turning in the 60 to 600rpm range
    > which is too slow to use the pulsin. I could use multiple magnets on
    > the wheel but I would really like to avoid that. I thought I could
    > use the LM2907(freq to voltage converter) followed by an ADC but I
    > found the low frequency produced too much ripple. Based on time I
    > would need about a .001sec resolution. The easy to use clock chips
    > seem to have only 1sec resolution. Any suggestions on how I could
    > solve this problem?
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-27 11:12
    >How about 2 magnets "closely" spaced?


    Another 'spin' on the two magnets setup: the bike will travel some (small)
    distance as the magnets pass by. Figure how far and measure the time it
    took to go that distance.

    >
    Original Message
    >From: <jimsp@y...>
    >To: <basicstamps@egroups.com>
    >Sent: Friday, May 26, 2000 5:36 AM
    >Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed
    >
    >
    >> I'm trying to use the BS2 to measure and periodically log the speed
    >> of a bicycle. The wheels would be turning in the 60 to 600rpm range
    >> which is too slow to use the pulsin. I could use multiple magnets on
    <SNIP>
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-27 20:39
    >>>
    Date: Fri, 26 May 2000 12:36:06 -0000
    From: jimsp@y...

    I'm trying to use the BS2 to measure and periodically log the speed
    of a bicycle. The wheels would be turning in the 60 to 600rpm range
    which is too slow to use the pulsin. I could use multiple magnets on
    the wheel but I would really like to avoid that.
    <<<

    I have a circuit somewhere that multiplied x 100 - a simple
    low frequency phase lock loop - was made for getting higher
    resolution from frequency counters looking at low frequency
    signals without "period" function. I think the capture
    range was about 1000 x variation in signal frequency range
    if I remember rightly - let me know if you want me to try
    dig this up [noparse][[/noparse]I think it used a CMOS 4046].

    Another possibility is using the spokes interrupting a magnetic
    path - that would give you x 32 or 36 usually! The spoke
    nuts are brass but the spokes are steel - probably even the
    stainless spokes are magnetic stainless for strength.

    There are integrated permanent magnet biased inductive pickups
    which put out a signal when a piece of magnetic material goes
    by [noparse][[/noparse]I've seen these in disk drives to pick up the rotational
    speed]. You'd have to filter out vibration caused signal with
    this method. Optical interruption could also be used.

    Just yesterday I saw an LED strobe on a bike that was energized
    by a spoke fastened magnet. I've often considered using rim
    magnets for power generation but my rims seldom stay very true
    for long...

    Personally I'd stay with several magnets as they are light and
    simple.

    Good luck with it... ride on!
    > __o __ o
    > _ \<,_ _ \<,_
    > (_)/ (_) (_)/ (_)
    > __o __ o
    > _ \<,_ _ \<,_
    > (_)/ (_) (_)/ (_)
    >
    > __o __ o
    > _ \<,_ _ \<,_
    > (_)/ (_) (_)/ (_)
    >
    > __o __ o
    > _ \<,_ _ \<,_
    > (_)/ (_) (_)/ (_)



    ________________________________________________________________
    YOU'RE PAYING TOO MUCH FOR THE INTERNET!
    Juno now offers FREE Internet Access!
    Try it today - there's no risk! For your FREE software, visit:
    http://dl.www.juno.com/get/tagj.
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-31 23:23
    I want to thank you for all the responses I got to this posting.
    What I tried was Tracy Allen's suggestion of a programmed timer loop.
    This is simply counting the number of loops the program goes though
    between turns of the wheel. In my case I counted for 4 revolutions
    and wrote to an eeprom during the fifth revolution. This gives me a
    reading about every 36ft. It was a bit surprising how well this
    worked. At 35mph(a speed that I only achieve on down hills) the count
    was about 500 which gave me the .1rpm resolution I was looking for.

    If the number of loops was directly related to time you would
    expect an inverse relation of loops to speed of loops*speed
    =constant. As you might have guessed there is a fixed time
    associated with counting like this so I found when I calibrated it
    against my bike computer the relation was more like
    (loops+X)*speed=constant.

    In addition I plan to try the timers made by Peter Anderson
    (http://www.phanderson.com/timer_1_2.html) which was also suggested
    by Tracy. These timers are 8pin PIC12C508's programmed to work as
    an event timer. The one style has a resolution of .001sec which
    should work well in this application.

    I just tried my speed logger on a 21mile ride(8k eeprom is good for
    about 27miles)and it worked very well. The total distance came out
    to within a few hundreds of a mile of what the bike computer
    measured. I captured the file on my PC and used Excel to do the
    calculations and plot the data.
  • ArchiverArchiver Posts: 46,084
    edited 2000-10-23 17:33
    At 12:26 PM 10/23/00 -0500, someone wrote:

    >If your spoke nuts (if that's what they call the
    >part nearest the rim???) are ferrous, this should work just fine. If not,
    >you'll need a more expensive sensor....

    Um, I think you mean nipples 8^]. Sorry, couldn't resist...

    Duncan
  • ArchiverArchiver Posts: 46,084
    edited 2000-10-23 18:26
    I remember counting small gear teeth at similar speeds a few years ago. A
    very inexpensive ($10)inductive sensor gave a pulse for each tooth that was
    easy to amplify and shape. If your spoke nuts (if that's what they call the
    part nearest the rim???) are ferrous, this should work just fine. If not,
    you'll need a more expensive sensor....

    Original Message
    From: jimsp@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=RoQpKxX39FST3o3XSrx3GhrR1n3CFKwdFepN0pwJ_divk33eJbbIDFZZY7LC1SwlVd7VibjptKm3SQ]jimsp@y...[/url
    Sent: Friday, May 26, 2000 7:36 AM
    To: basicstamps@egroups.com
    Subject: [noparse][[/noparse]basicstamps] Measuring Bicycle Speed


    I'm trying to use the BS2 to measure and periodically log the speed
    of a bicycle. The wheels would be turning in the 60 to 600rpm range
    which is too slow to use the pulsin. I could use multiple magnets on
    the wheel but I would really like to avoid that. I thought I could
    use the LM2907(freq to voltage converter) followed by an ADC but I
    found the low frequency produced too much ripple. Based on time I
    would need about a .001sec resolution. The easy to use clock chips
    seem to have only 1sec resolution. Any suggestions on how I could
    solve this problem?
Sign In or Register to comment.