View Single Post
  #106  
Old March 16th 19, 06:13 AM posted to rec.bicycles.tech
James[_8_]
external usenet poster
 
Posts: 6,153
Default GPS Units = Show road steepness?

On 16/3/19 12:28 am, wrote:
On Thursday, March 14, 2019 at 9:01:22 PM UTC-7, James wrote:
On 15/3/19 1:47 pm, Mike A Schwab wrote:


Well, actually the reed switch is effectively a relay. Takes
1/100 of a second to close in the gap between the sides of the
magnet. Computer could be sampling much more often. And a faster
speed doesn't give the reed switch enough time to close.


Why does it need to be "sampling"?

The switch may be connected to a digital input that generates an
interrupt upon a rising (or falling) edge, for example. The ISR
could then read and reset a timer/counter since the last rising
edge was detected. A counter can keep track of distance
travelled.


At 60 m/s (in excess of 200km/h), with a nominal 2m circumference,
the wheel spins 30 revs per second. A 100 uS timer period would
capture the speed of 1 rev with better than 1% accuracy at this
speed.

So long as it could count to 100,000 (not impossible for a 4 bit
computer to handle roll over), it could also measure speed at
1km/h.

The screen could be updated with the latest distance or filtered
speed every second or when it has changed.

-- JS


James - If, as Frank says, they are using a 4 bit uP, that counter is
a whole lot easier said than done. As I pointed out the counter has
to be at least 20 bits and more likely 24. Small, cheap uP are that
way for a reason - they have very little support circuitry. Dealing
with large numbers is not their strong point.


I've written code for this sort of thing in the past.

--
JS
Ads
 

Home - Home - Home - Home - Home