Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.

Slides:



Advertisements
Similar presentations
Why won’t my Arduino work???? living with the lab © 2012 David Hall.
Advertisements

temperature system wiring
College of Engineering & Science living with the lab Ohm’s Law © 2012 David Hall 1.5V.
Using the servo library living with the lab Libraries are computer programs written to add functionality to Arduino programs. A library to control hobby.
Conductivity sensor implementation living with the lab © 2011 LWTL faculty team.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Waterproofing a thermistor ENGR 121 living with the lab © 2013 David Hall.
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
User-defined functions in Arduino sketches living with the lab © 2012 David Hall.
Living with the Lab Using servos with an Arduino EAS 199A Fall 2011.
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
Living with the lab Attaching Arduino to Boe-Bot Chassis © 2012 David Hall.
Cascaded switching of a solenoid valve living with the lab transistor relay solenoid valve © 2012 David Hall.
Assembly of conductivity flow loop living with the lab (in preparation for calibrating conductivity sensor)
Switches & whiskers on the Arduino living with the lab lever arm switches mounted to Arduino © 2012 David Hall.
Using fixed-cell references and built-in functions in Excel living with the lab © 2012 David Hall.
220  470  Gnd5V Currents Through Parallel Resistors 1 living with the lab © 2012 David Hall.
Introduction to Microsoft Excel living with the lab © 2012 David Hall.
Voltage Drops Around Closed Loops 470  220  5V   220  living with the lab © 2012 David Hall.
Navigating the engineering disciplines robot challenge living with the lab © 2012 David Hall.
Kirchoff’s Current Law (KCL) living with the lab University of Pennsylvania Library and Wikipedia Gustav Kirchoff (left) and Robert Bunsen (right) Bunsen.
Servos The material presented is taken from a variety of sources including:
Adding a Barrel Jack to a Battery Pack living with the lab © 2012 David Hall.
Using for loops to control LEDs living with the lab 1 1 arduino.cc the for statement allows us to repeat a block of commands a limited number of times.
Limited rotation servo basics David Hall output shaft servo horn red wire = 5V + black wire = Gnd - white wire = control signal standard servo.
Building Circuits.
Pump Fabrication Day Group A will draw their pump
Controlling Servos with the Arduino
Connecting Switches.
Series and Parallel Resistors
Introduction to the Arduino
Troubleshooting Your Multimeter
Using servos.
calibration of conductivity sensors
Servo Library and Functions
What’s in your kit?.
Pump Project Overview.
Robot Assembly.
How to Use Dial Calipers
Controlling a Motor with Cascading Switches
RGB LEDs.
Conservation of Mass Problem
Linkages and Mechanisms
Maxbotix Ultrasonic Distance Sensor
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
Servo Library and Functions
Troubleshooting Your Multimeter
a few of my favorite sensors
using for loops to control LEDs
using the Arduino to make LEDs flash
Acquiring Data from an ADXL335 Accelerometer
Using Photoresistors with an Arduino
Torque and RPM of Gears
analog and digital measurements
Using “if” statements.
Digital Input from Switches
Implementing Switches Using Interrupts
Arduino: For Loops.
Non-Concurrent Force Systems
IR Object Detection IR detector IR LED IR light reflected off object
Radio Frequency Transmitter and Receiver
Interfacing a Rotary Encoder with an Arduino
Conservation of Mass Problem
Non-Concurrent Force Systems
Evaluating Design Alternatives
Counting Servo Gear Teeth (FS90R Servos)
Static Equilibrium Problem
Reservoir Loop.
Freshman Design Expo Presentations
Gearmotor Efficiency W table top gearmotor pulley string.
Presentation transcript:

Using Hobby Servos with the Arduino living with the lab © 2012 David Hall

living with the lab 2 The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University. The author of this information does not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in injury or damage. Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. If you do not agree, then do not view this content. The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed from this presentation. You may modify this work for your own purposes as long as attribution is clearly provided. DISCLAIMER & USAGE

wires to power & control servo 3 living with the lab red = 5V black = Gnd white = signal output shaft

servo components 4 living with the lab 1.small DC motor 2.gearbox with small plastic gears to reduce the RPM and increase output torque 3.special electronics to interpret a pulse signal and deliver power to the motor

types of servos 5 living with the lab continuous rotation pulse tells servo which way to spin & how fast to spin pulse tells servo which position to hold standard can only rotate 180 degrees can rotate all the way around in either direction

Arduino programming 6 living with the lab void loop() { digitalWrite(3, HIGH); delayMicroseconds(1700); // hold pin 3 high for 1700μs or 1.7ms digitalWrite(3, LOW); // hold pin 3 low for 20ms delay(20); } these lines of code make the servo go full speed counter clockwise time (milliseconds) voltage (V) 5V - 0V - 20ms full speed clockwise full speed counter clockwise pulse width varies between 1.3ms and 1.7ms pulse width (μs) servo action 1300full speed CW 1400½ speed CW 1500stopped 1600½ speed CCW 1700full speed CCW speed not linear with pulse duration

wiring servo to breadboard 7 living with the lab Since the servos will likely be hooked up for a while, it is worthwhile to keep the wiring tidy, cutting short jumpers from the power bus. The red wire from the power bus should go back to Vin or 5V, and the black wire should go back to Gnd.

playing around with programing 8 living with the lab “for” loop executes 200 times i = 0, 1, 2, 3, 4, void setup() { pinMode(3, OUTPUT); } void loop() { int i; for (i=0; i<200; i++) { digitalWrite(3, HIGH); delayMicroseconds(1300); digitalWrite(3, LOW); delay(20); } delay(1000); for (i=0; i<400; i++) { digitalWrite(3, HIGH); delayMicroseconds(1700-i); digitalWrite(3, LOW); delay(20); } } this for loop causes the servo to go from full speed CCW (pulse width = 1700  s) to full speed CW (pulse width = 1300  s) create a square wave with a pulse width of 1300  s followed by a 20ms pulse wait one second