I am fairly new to this exciting arduino community and have a big question for you all. (I posted a similiar question on the processing forum and was recommended to also post here.) So here it is:
I am creating a digital mutoscope for three small stop motion animation videos. I want to use a hand crank to control the direction (forward or reversal) and the speed of the video playback. I would like with each click of the handcrank to forward one frame and one total revolution to be about 24 frames.
I am desperately seeking help on how to get the hand crank to communicate with the arduino and how ideas on how to control the direction and speed of playback of the video. It is important to me that the viewer be able to use the crank to control how the video is played. Currently the videos play at 24 frames per second but that is not fixed.
Thank you kindly in advance for any leads or advice that would help me out on this project.
Look for a rotary encoder. I have one that is for a high RPM motor. It's a quadrature encoder and it is highly precise. The one I have runs from +5 to +24 and outputs a clean square wave. It lists for over $500 but I got it on ebay for $35 new in packaging. You would power it with +5v. The mechanical ones might work but I don't know the precision you need.
You should check out http://www.processing.org it can process video and should be able to hook into a movie player to do single frames or play them itself.
I'm not very familiar with processing. This may point to more
If you are on Mac OS X then I can recommend Quartz Composer for controlling the video playback. It's a free Visual Programming Environment that comes with Apple's Developer Tools and can talk to various serial devices including Arduino boards. (Bit easier than Processin, QC is just noodling Patches together unless you get into the patch coding side of it)
The software side of it would be trivially easy in QC. Depending on what numbers the Arduino pushes to QC you do it various ways. You could count click's forwards and backwards and transpose that number to the patch time of the movie (patch time = total clicks divided by movie frames per second you want playback to notionally 'be')
eg
Patch Time = clicks (frames) รท 24 (frames/second)
Patch Time = clicks/24 (seconds)
Alternatively you could have it so cranking the shaft generates momentum and it runs under it's own steam at a governed fps for a bit. All just simple maths logic to construct, whatever software environment you do it in. Sorry if you already know that!
i once did sth. similiar with a griffin powermate - no arduino needed. did the programming in maxmsp, but sure QC, Processing, vvvv... are also options. quite simple with this usb-device (works very well with the drivers), and i think might be even cheaper in this case...
is there anything special I should know about it such as a brand, or type
Many encoders (especially the kind used to replace volume controls and other pots) have detents that make them move in tangible steps. They often have a switch you can close by pushing the shaft inward. The type used for motor speed/direction detection don't. I think the Griffin gadget uses the latter. With a fat, heavy knob, you can start it spinning, and let it continue for multiple complete turns. The free-spinning type will usually have more output pulses per turn.
The electronic interface is similar/identical, but the "feel" is different. Which kind you want will depend on your application.
I picked up a new 1024 count rotory encoder off ebay that's meant for industrial applications. It's meant to work from +5 to +24 volts. I've tested it at +5 with a scope and it works. I hooked it up to an industrial controller and tested it at +12 and +24 and it is exceptionally precise. I've not had time to hook it up to the arduino yet. It's massive.
These are industry standard devices.
This is +5V , 4096 pulse per revolution and is more accurate than the one I have. It's 25. Much better for displays people will be messing with.