This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Measuring Vehicle Speed using C167 microcontroller

Hi all, need some help here, as i'm new to uc i have a few problems of how to use it properly, i'm capturing speed sensor signal using uc C167, the signal operates between 0 to 135Hz max, how i can set the prescaler of the uc to match the capture signal so that i could take the measurement? the signal is a digital pulse (50-50 duty cycle), and what algorithm i need to convert the measurements to mph??
thanks to all.....

Parents
  • I don't know where you have your sensor, but if it generates one pulse for each wheel revolution, then each pulse represents a traveled distance wich follows from the circumference of the wheel.

    And speed is the amount of traveled distance in a specific time space.

    That means that your speed is a constant multiplied by the number of pulses you get every second. Your initial formula may contain a number of constants - one for wheel diameter or wheel radius or wheel circumference. Another for number of pulses/second. Yet another to convert from speed/second to speed/hour. But all these constants can be combined.

    Your job is to calibrate your system by finding out how the value of that constant. The next step is to express this in a way your processor can handle. It will be trivial if you can afford to use floating point numbers. But it can be solved just as well (or normally better as in smaller and faster) with integer arithmetic.

Reply
  • I don't know where you have your sensor, but if it generates one pulse for each wheel revolution, then each pulse represents a traveled distance wich follows from the circumference of the wheel.

    And speed is the amount of traveled distance in a specific time space.

    That means that your speed is a constant multiplied by the number of pulses you get every second. Your initial formula may contain a number of constants - one for wheel diameter or wheel radius or wheel circumference. Another for number of pulses/second. Yet another to convert from speed/second to speed/hour. But all these constants can be combined.

    Your job is to calibrate your system by finding out how the value of that constant. The next step is to express this in a way your processor can handle. It will be trivial if you can afford to use floating point numbers. But it can be solved just as well (or normally better as in smaller and faster) with integer arithmetic.

Children