Connect with us

Pan DC motor with Arduino and Computer?

Discussion in 'Microcontrollers, Programming and IoT' started by Xeuscryste, Jul 22, 2013.

Scroll to continue with content
  1. Xeuscryste

    Xeuscryste

    52
    0
    Jun 20, 2012
    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.:)
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,305
    2,738
    Jan 21, 2010
    What sort of motor is it?
     
  3. Xeuscryste

    Xeuscryste

    52
    0
    Jun 20, 2012
    Its just a DC motor out of an RC car.
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,305
    2,738
    Jan 21, 2010
    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.
     
  5. Xeuscryste

    Xeuscryste

    52
    0
    Jun 20, 2012
    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?
     
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,305
    2,738
    Jan 21, 2010
    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)
     
  7. BobK

    BobK

    7,674
    1,684
    Jan 5, 2010
    If you need precise control, a stepper motor would be far better. These can be moved in steps of typically 1.8 degrees.

    Bob
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-