Boat Speedometer
chuckl
Posts: 3
I'm using a Basic Stamp·to determine the speed of a boat.· The input is a pulse from a turbine - 4.8 Hz for every mph of speed.· Due to the low frequency, especially at slow speeds, the pulsein command (counts the number of 2us increments between each pulse) will generate a value greater than the limit of 65535 allowed.· Also, after such a value is acquired, I need to divide 500,000 by that value to determine the frequency which is then converted to mph by a simple multiplication.· Basically, this is a problem where large numbers need to be dealt with and I'm sure that it's not a new problem, but I can't find anything on the forum that is helpful other than the possibility of using the function, COUNT, instead, which counts pulses over a specified period.· It's really a simple tachometer problem, but I'm struggling with working around the 16-bit limit and integer-only math on the Stamp.· Any help would be greatly appreciated.
Comments
Analog devices has them....Not sure what the working frequency ranges are.
How fast would the boat go? In otherwords, what would the highest freq. be?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
In the end we have ordered an LM2917 (Frequency to voltage convertor)
Its a linear IC and gives a voltage out, proportional to frequency, where Vout=Vcc*R1*C1*Fin
So, you configure it so so Vout=Vcc at 40MPH (192Hz)
Next im using a 8bit ADC convertor, so you should get quite a nice speed resolution if you use one of them. Should be just some simple math inside the Stamp to convert it to mph (I havent got that far yet [noparse]:D[/noparse])
Let me know how you get on.
Chuck