Maker Pro
Maker Pro

Pan DC motor with Arduino and Computer?

I haven't been mucking around with electronics since mid last year, and I realize this may be common sense but I need some help.

I have a simple dc motor firmly joined on to my webcam, and I want to pan it left and right but in stages (little movements at a time)

I have a motor controller chip and a breadboard but I don't think ill need that chip..

So id really appreciate some help telling me the code and the wiring diagram.

Thankyou.:)
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
OK then, I presume you have it geared down massively so that it can provide enough torque to turn the camera, and also so that it turns quite slowly.

The answer to your problem is "an H-Bridge".

These are available in chips, or you can make them yourself from discrete components. The advantage of getting an integrated one is that you're less likely to be able to short the power supply out, and it will probably work even if your motor supply voltage is different to your Arduino supply voltage.

Your program needs to tun the motor on for a brief time to move the camera. You'll turn it on in the reverse direction to move it back.

Beware that you need to either ensure that nothing bad happens if you leave the motor running, OR that you have limit switches to prevent the motor from driving the camera too far in either direction.
 
OK then, I presume you have it geared down massively so that it can provide enough torque to turn the camera, and also so that it turns quite slowly.

The answer to your problem is "an H-Bridge".

These are available in chips, or you can make them yourself from discrete components. The advantage of getting an integrated one is that you're less likely to be able to short the power supply out, and it will probably work even if your motor supply voltage is different to your Arduino supply voltage.

Your program needs to tun the motor on for a brief time to move the camera. You'll turn it on in the reverse direction to move it back.

Beware that you need to either ensure that nothing bad happens if you leave the motor running, OR that you have limit switches to prevent the motor from driving the camera too far in either direction.

The Motor definitely has enough power to turn the camera, however, I haven't got it geared to turn very slowly, I was wondering if the arduino chip could control the speed, if not, is there anything I can place between the power and the motor to decrease the power so It wont turn as fast?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
You can use PWM to make it turn slower, but if the motor isn't geared, you won't reduce the speed to a really low value without major obstacles.

You'll still need the H-Bridge to be able to reverse direction, and limit switches to stop the camera spinning like a top if your code misbehaves (or to allow you to return it to a known position)
 
If you need precise control, a stepper motor would be far better. These can be moved in steps of typically 1.8 degrees.

Bob
 
Top