Conect 5 Rc servomotors to arduino

Discussion in 'Embedded Systems and Microcontrollers' started by jarohern, Jul 28, 2013.

  1. jarohern

    Thread Starter New Member

    Jul 28, 2013
    1
    0
    i'm a rookie student of electronics,and i'm starting to program in arduino, so i want to control 5 servos for a robotic arm.

    I will only use the arduino for send the pwm signals to the servomotors and for start the sequence with a push button.

    For power the the servomotors, i will use a external power supply.

    But my doubt is how to connect te push button?,in my case that i want to get a logic "1", i know that i have to connect one pin of the push button to ground with a pull down resistor and this is connected to the digital pin of the arduino. The other pin of the push button is connected to Vcc, but, this is where a i have my doubt, the pin of the push button that is connected to vcc, it must be to vcc on the breadboard or to +5V pin of the arduino ??

    This is an image of how i plan to do, so i don't know if this is correct. The vcc of the breadboard(Red) is where is connected the positive terminal of the power supplly and the positive terminals of the servos and the ground of the breadboard is where is connected the all the ground of the circuit( negative terminal of power supply, negative terminal of the servos) and these grounds are connected to ground terminal of the arduino.

    In the image only is 1 servo, put i plan to do the same for the others.

    Excuse me for my inexperience in electronics, i hope to improve my skills in this fascinating area . I will really apreciate your help
     
  2. Shagas

    Active Member

    May 13, 2013
    802
    74
    I have no experience with the arduino but if The board supplies 5 volts then the schematic should be correct.
    You can do it an even simpler way .
    The avr i/0 have pull up resistors .
    If you put a pin as an INPUT in the Data direction registry and in the PORT you give it a logic High then you enable the pullup resistor :
    for example :

    DDRB = 0x00;
    PORB = 1 << PINB0;

    Now if you just pull this pin to the ground then you can activate it. You don't need any external resistor . Just pull this pin to ground with a button switch.

    You can use code:

    if(bit_is_clear(PINB ,0 ) { // code here } to sense if the button has been pressed
     
  3. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    Assuming you are new at the arduino I HIGHLY suggest following through the learning/tutorials
    http://arduino.cc/en/Tutorial/HomePage
    Don't jump ahead.. Start with the basics and move through them till you understand it.. A little extra time spent now can save you hours/days/months in the future.

    All the information you need is very clearly covered there.
    like this http://arduino.cc/en/Tutorial/Button
     
Loading...