SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By banshee1a
#192426
I made a radio controlled truck pulling sled and to measure the distance traveled we have to measure it with a tape measure. To up the cool factor I'd like to find a way to measure the distance electronically and output it to an LED display mounted on the sled. The weight box is chain driven so I was thinking that maybe I could use something like a contact roller on an encoder connected to one of the sled axles or something and use an Arduino (or something similar) to measure the pulses to calculate the distance, but I'm not sure this is the best/ easiest way to go or if it would even work.

Ideally I'd like to hide everything out of sight to keep it clean, but depending on what I need to make this work I can add a fake drivers box and hide the components in there if needed. I'll try to update this with a picture of the sled with a few dimensions to give you the rough size when I get home.

I'd really like to have the accuracy within a 1/4" which keeps me away from the ultrasonic units. I need to measure from 0 up to 30' which rules out all of the ultrasonic units I found on Sparkfun. I'd like to keep the budget under $50 ideally, but I can probably swing $100. I already have an UNO in an r/c chassis dyno, but I'd like to use something smaller that I can leave in it. I plan to use a small 2cell lipo battery to power the electronics and LED on the sled.

After the long description, am I going about this the right way or is there a better approach? I'm not 100% sure my method is even doable.

Thanks.
By lyndon
#192436
The easiest way is exactly what you said: use an encoder, but on a non-driven wheel (less likely to slip). Alternately, I've had good luck with the LIDAR Lite sensor, but it's a bit above your budget.
By banshee1a
#192437
lyndon, I'll look into the Lidar lite sensors. I can expand budget if it'll give me better results and reduces space.

Last night I had another idea of attaching a spring loaded drum to an encoder and attach a piece of string to the weight box and use that to rotate the encoder. Will this work any better? Would I have to prevent the string from coiling up on itself because the ratio will change as the string is pulled off the drum? It would basically be a string potentiometer (which I can find but they are quite big and would be difficult to hide).

Do you have any experience connecting this encoder to an Arduino UNO? Is there another controller I can use that's cheaper than an UNO? I have mine used on another project and I really don't want to have to keep uploading sketches and moving it around when I want to use it.

Thanks.