top of page

Adding a Servo Motor

Why Use a Servo Motor:

 

Servo Motors give your robot that extra 'Punch' that may tip the scales in your robots favor.  

Servo motors are able to reproduce any angle of rotation based on a integer number between 0 and 180, and is very simple to implement.  

There are only three wires used to connect the servo...   +5V, Ground, and Signal.  The signal wire receives a varying pulse width square wave who's ON-TIME determines the angle of the servo shaft ( See video below )

Servo.PNG

How to wire up a Servo Motor:

Because of their power, servo's do need the extra current provided by having their RED power lead connected directly to the 4.5V or 6.0V pin of the battery pack, and the black lead connected to any convenient ground.  ( Using the 5V from the PCB directly would be too much for the 78L05 5 volt regulator on that PCB )

The yellow signal wire ( shown connected to PD4 here ) can be connected to any unused pin on your SAMrI

The servo body can be attached to anywhere you wish, but in this case is connected to the back side of the circuit board as shown using a bit of hot glue.

ServoMotor.PNG

Battery Pickoff 6volts

This image ( below ) shows the Red power lead of the servo, picking off the 6V output of the battery pack to power itself.   Be careful not to connect the servo across the full output, or the 9 volt level will damage the servo motor.

WIN_20201022_17_58_27_Pro.jpg

Battery Pickoff 6volts

Program:

#include <Servo.h>             // This header library file add's the necessary instructions to use the servo

Servo samri_servo;             //  This instruction names the servo for convenience

  

void setup() {


samri_servo.attach(PD4);   // attaches the servo named above to output PD4 

 

}

void loop() {
  
    samri_servo.write(0);       // This instructions sets the servo to zero (0) degree's       
    delay(1000);                      //  ... and then pauses for 1000mS ( 1 second ) 
  
 
    samri_servo.write(180);    // This instruction sets the servo to 180 degree's

    delay(1000);                       //... and pauses again. 
  
}

Strategies:

  • Use Servo arm to lower an arm to block opponent robot

  • Lower scoop to surface to get under and lift opponent robot

  • Use servo to release a spring-loaded offensive weapon

  • Use arm to push robot above it's centre of gravity

  • Use are to hold paper to fool opponents proximity sensor

bottom of page