Hand Crank controlled PWM

Hey guys,

pretty new to the arduino. looking for a solution in integrating a simple hand crank to the PWM control in order to control the speed of w/e

The main use for this in my mind would be to create a music player where the speed of the song is controlled by how fast or how slow you are spinning the hand crank.

Please get back to me if you have any idea on implementing this. or if it is even possible.

Thanks

Not sure why the Crank would be connected to the pwm control, or what a w/e is, but rotary encoder are probably the way to go.
My guess is that an optical encoder would work best sincenit can spin freely.
Search for rotary encoders on google.

Btw nvm i googled w/e and found it means whatever. IMO using 2 many intern3t slang is annoying, so i would appreciate it if the OP and other ppl would use less things that u need to look up 2 know wut it means.
Lol, but seriously it bugs me when I see some acronym I don't know, and I have to look it up.

One possible way you could implement it would be to backdrive a gearmotor. Setting it up in this manner could lead to some interesting possibilities...

Basically, get a gearmotor that can be backdriven - you would want one with a fairly small gear ratio (you don't want the user to have to use a lot of strength turning it). It will need to use spur gears (can't use a worm drive; those can't be backdriven). Ideally, the motor/gearbox should have ball bearings, instead of sleeve/oilite, for longevity.

Attach a crank to the output shaft of the gearmotor. Hook up a simple bridge rectifier to the output of the motor, plus you will need to add some filter caps. Crank the motor, and measure the output with a voltmeter. Crank it hard, see what the maximum voltage is. You can then set up a voltage divider (with a comfortable margin, in case someone gets carried away) using a couple of resistors, and feed the output into one of the analog inputs on the Arduino.

What this allows is a measure of "feedback" for the crank, which other sensors (like an encoder) might not give you, unless you rigged up a gearbox or something to allow for it. It will give a better "feel" to the end user cranking it, instead of it feeling like a limp noodle.

Once you have that done, you could (in theory anyhow) add a little extra bit - force feedback! You could set things up (with a relay or other means) to allow the Arduino to control the motor somewhat; with an h-bridge in-line, you could have it lighten the load or make it more difficult to turn; you would need to alternate between applying power to the motor and sensing the voltage. You could also (once again, in theory) turn the motor and sense both the current and back-EMF (instead of generated voltage) to sense how much the user is turning with (or resisting against) the force of the motor (use PWM to change the speed, of course) - instead of sensing voltage generated.

That is the basic idea, anyhow - there's a lot more that would need to be done, mainly in back-EMF filtering and such, to keep from frying your Arduino, but it is certainly possible. With such a setup, you could make certain songs hard to play, and others easy. There might even be game possibilities. A similar system could, for instance, be applied to an exercise bike or treadmill to simulate uphill or downhill riding/walking/running...

:slight_smile:

Thanks for all of your replies.

Not sure why the Crank would be connected to the pwm control, or what a w/e is, but rotary encoder are probably the way to go.
My guess is that an optical encoder would work best sincenit can spin freely.
Search for rotary encoders on google.

Btw nvm i googled w/e and found it means whatever. IMO using 2 many intern3t slang is annoying, so i would appreciate it if the OP and other ppl would use less things that u need to look up 2 know wut it means.
Lol, but seriously it bugs me when I see some acronym I don't know, and I have to look it up.

I looked this up, i guess by finding the rate of which the positions cycle through I could conversely figure out a rate in which to play the music at a certain speed.
I will look more into this method

Basically, get a gearmotor that can be backdriven - you would want one with a fairly small gear ratio (you don't want the user to have to use a lot of strength turning it). It will need to use spur gears (can't use a worm drive; those can't be backdriven). Ideally, the motor/gearbox should have ball bearings, instead of sleeve/oilite, for longevity.

Attach a crank to the output shaft of the gearmotor. Hook up a simple bridge rectifier to the output of the motor, plus you will need to add some filter caps. Crank the motor, and measure the output with a voltmeter. Crank it hard, see what the maximum voltage is. You can then set up a voltage divider (with a comfortable margin, in case someone gets carried away) using a couple of resistors, and feed the output into one of the analog inputs on the Arduino.

What this allows is a measure of "feedback" for the crank, which other sensors (like an encoder) might not give you, unless you rigged up a gearbox or something to allow for it. It will give a better "feel" to the end user cranking it, instead of it feeling like a limp noodle.

Once you have that done, you could (in theory anyhow) add a little extra bit - force feedback! You could set things up (with a relay or other means) to allow the Arduino to control the motor somewhat; with an h-bridge in-line, you could have it lighten the load or make it more difficult to turn; you would need to alternate between applying power to the motor and sensing the voltage. You could also (once again, in theory) turn the motor and sense both the current and back-EMF (instead of generated voltage) to sense how much the user is turning with (or resisting against) the force of the motor (use PWM to change the speed, of course) - instead of sensing voltage generated.

That is the basic idea, anyhow - there's a lot more that would need to be done, mainly in back-EMF filtering and such, to keep from frying your Arduino, but it is certainly possible. With such a setup, you could make certain songs hard to play, and others easy. There might even be game possibilities. A similar system could, for instance, be applied to an exercise bike or treadmill to simulate uphill or downhill riding/walking/running...

That makes sense as well, I would probably look into that after I get the optical encoder working or at least make a good attempt into getting it to work.

Question 1: Describe in better detail what you mean by "hand crank". What kind of device is it?
Question 2: Describe how you use PWM to control the playback speed of a song?
Question 3: What does "w/e" mean?

Sorry for the confusion there.
When I say Hand Crank I mean the device you turn with a hand to get a certain result. such as the LED flashlights where you can use the hand crank to power them up.
The more I think of it the more I can see the PWM is not needed as i'm using a different method to control the speed.
And to all sorry about the internet slang as sometimes it just comes naturally.
w/e = whatever

I personally like the optical encoder idea, I can visualize it in my mind on how it may work and I might be able to muster up some code for the arduino to make this work as intended.
Any tips on where to look for Optical Encoders or Rotary Encoders?

Also I do want some feedback when rotating so maybe a low end mechanical encoder would be best but I'm shooting the gun here as I'm not really familiar with these devices at all.

Any more thoughts and advice still appreciated. ;D

So you are best using a rotary encoder:-
http://www.arduino.cc/playground/Main/RotaryEncoders

That will get you a position, then you just need to measure the change in that position over time. To do that simply get the position and say half a second later get the position again and then subtract the two. The result is the current speed.

As you say you don't need PWM, but this is some information about it:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

looking for a solution in integrating a simple hand crank to the PWM control

In maths it is well known that a hand crank does not have an analytical solution and so if you want to integrate it you have to use numerical methods. :wink:

So you are best using a rotary encoder:-
http://www.arduino.cc/playground/Main/RotaryEncoders

That will get you a position, then you just need to measure the change in that position over time. To do that simply get the position and say half a second later get the position again and then subtract the two. The result is the current speed.

As you say you don't need PWM, but this is some information about it:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Hey mike, thanks for the confirmation there, and thanks for the links. I have already played with the PWM control on the arduino, using it to control fan speed mainly, hoping to manufacture a simple laser show with pwm control connected to fans/motors in order to distort the laser off an array of mirrors.
Simple idea, hella cool in the end.