ink heater the beginnings of a blog

Pcomp Lab: Servo Motor Control with an Arduino

This lab introduced us to the Servo, a small motor with an output shaft that can be easily used to create and control motion with a microcontroller.  Most servos allow for up to 180 degrees of movement, and can be used in applications involving levers, periodic or reciprocating motions. Servos are commonly used in projects including radio-control airplanes, radio-control cars and robotics, among others.

The goal of the lab was to control the position of the servo using analog sensor values. To set up the breadboard, I connected power and ground on the breadboard to 5V power and ground on the Arduino. I connected an FSR sensor to Analog pin 0 on the Arduino, connected the yellow wire of the servomotor to digital pin 2, the red wire to power, and the black wire to ground.

Part I: Pulsing the servo with a digital pin to set the position of the servo. The first part of the lab involved figuring out the pulse length and position (the easier route would be the Servo library, which we'll see in Part II). I controlled the Servo using an FSR sensor. To ensure that the servo moved through its full range of motion with the FSR, I first determined the range of values of the FSR and used the map(); function to adjust the servo code to fit.

Servo Lab Part I from katherine keane on Vimeo.

Part II: Controlling the servo using the Servo library. Part I was the hard part - because in Part II, we used the Arduino Servo library to take care of all the calculations.

Servo Lab Part II from katherine keane on Vimeo.

Tagged as: , , No Comments
   

my posts

Categories

tag cloud??

android arduino art assistive technology breathing bronx zoo cabinet comics commlab communication computer vision eye tracking forster freshkills FSR games giraffes graphic arts graphics Hospitable Room images interactivity LEDs light midi Mobile Me(dia) museum Nature of Code park PComp physical computing public Rest of You sensor sensors servo spontaneous storytelling stupid sustainability swig & jig tree visitors