# How do I measure the distance that a cord (string) has moved?

For a pet project, I am trying to fly a kite using my computer. I need to measure how far a cord extends from a device. I also need to somehow read out the results on my computer. So I need to connect this to my pc, preferably using something standard like USB.

Since the budget is very small, it would be best if I could get it out of old home appliances or build it myself.

What technology do I need to make this measurement?

Sure, here are a couple of choices for you:

For high end, you can look at a 200 counts per revolution rotary encoder like this one:

You'll need a microcontroller like an Arduino to count the rotations, there's some sample code to play with.

Cheaper, not quite as much community support in comments.

For a little more fun, you can combine the rotary encoder with a gearmotor so you could control the kite string with one piece of equipment.

• Thanks for all the good links and tips. There's a whole world opening up for me here! Mar 18, 2013 at 9:32
• You're welcome. It's a ton of fun! Mar 19, 2013 at 1:13

Maybe you could take one from an old computer mouse, and count the light pulses directly from the mouse board so you could tell the length of the cord.

• Examples: one, two, three
– Ian
Mar 17, 2013 at 20:18
• That is simply brilliant! Not only can I choose from mechanical and optical variants, they also already have a USB-cable attached! I think I will try this first. I love the high DYI part of this! Mar 18, 2013 at 9:46

I like @kramer65's answer but because you indicated you might like to make an encoder, I thought I'd share some information on that.

http://www.societyofrobots.com/sensors_encoder.shtml shows a very common way of making a rotary encoder. You attach a disk with evenly spaced holes or reflective surfaces depending on implementation to your shaft. You align a light sensor with the holes and count the number of holes that pass to determine how much the shaft has turned. This has the disadvantage of not being able to determine direction but there was ways to modify the design to add that feature.