Questions tagged [servo]

A servo is a type of motor which uses a feedback mechanism for precise control of speed and position.

Filter by
Sorted by
Tagged with
8
votes
1answer
2k views

How can the Arduino Uno support up to 12 servos if it only has 6 digital PWM pins?

According to this: The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables analogWrite() (PWM) ...
6
votes
7answers
97k views

What is commonly done to stop a servo after reaching desired position?

When I started Arduino, I did not expect that everything must be contained in an infinite loop. I thought I could just write something like: motor start -> motor stop. But in actuality, what I get is ...
6
votes
1answer
6k views

Difference between PWM and regular output port for servos?

I have been controlling my servomotors for a while now only using pin 0. After some research, it has became apparent to me that the ports with ~ are the PWM pins. I thought that all pins sent out ...
5
votes
5answers
7k views

Is Arduino stable enough to use it for a door lock?

I want to replace my door lock with an one made with an Arduino and a servo, but I'm not sure if the platform is stable enough to use it for something like this. If I do everything right (code, ...
5
votes
1answer
5k views

Why can't most servos rotate more than around 180°

I was looking how a servomotor works. I realized that a standard servo can only turn up to 180°, but I didn't understand why. Is it because of the potentiometer?
5
votes
2answers
156 views

How to move my robot in the right direction?

After all there is more question poping up then answers i decide to upload the pdf where is everything writen, like the wire, motor type and what we can and can't use. Here is the link pdf format of ...
5
votes
6answers
9k views

My Servo Won't Sweep Smoothly

So I've tried this a few times and I always get the same issue. When I try to run the sweep example the servo goes round 180 degrees but only in steps. Anyone know a way to fix this? The servo I'm ...
5
votes
2answers
2k views

How do I calibrate an ESC after connecting it to an Arduino?

I'm trying to connect an Arduino to an Electronic Speed Control and failing horribly. I'll explain what I've done so far, and then I'll explain the problem. Before we get there, here's the list of ...
4
votes
2answers
665 views

Is it possible to move a servo without knowing it's current position?

My Servo has already been built into my project, and I can't remove it without damaging many other things. During the process of inserting it, it was turned by hand. So I don't know at what position ...
4
votes
1answer
2k views

Useless box wiring and code

just want to give a back story first. So i saw this video on youtube about the useless box, and i thought that it would make a great gift for my 7 year old. So i went out and bought everything that ...
4
votes
4answers
1k views

How do I make a Servo Stop if it Hits Resistance?

I am trying to make a device which will turn a turn key with a servo. However, I want it to stop turning the turn key if the resistance is too great (meaning it is locked and will not ever turn). ...
4
votes
1answer
3k views

How to run servo 180 degrees and stop?

I'm creating a PIR motion sensor doggy door. The problem I'm having with it is, it runs 3 times, I've figured out how to pause when reaches 180° but not how to stop. I was thinking I could use ...
4
votes
0answers
2k views

Sending data from Arduino UNO as a SOAP request

I have a servo motor on one end which can be turned ON and OFF with web service sending SOAP request. In the other end I have my Arduino UNO with ESP8266. Currently, I am able to send HIGH or LOW ...
3
votes
3answers
6k views

How do I extract code from an arduino? [duplicate]

I updated and uploaded some code on another computer that got wiped and didn't send the new code to my current computer, the updated code is still on the board but I don't have access to it. How do I ...
3
votes
3answers
876 views

Running a servo and tone() won't compile? “multiple definition of `__vector_32'”?

Im using Spark fun pro micro:https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro I am controlling a servo motor which reads its data from a pot connected ...
3
votes
3answers
2k views

Arduino Mega vs servo shield

I am currently designing a hexapod with a total of 18 servos. I come from a computer science background and know little about electronics, so there is one thing which puzzles me. Adafruit is selling ...
3
votes
1answer
15k views

How to make servo rotate for angle bigger than 180°

Connected servo motor (180°) to Arduino Uno R3. Currently I am using a servo motor which have rotation angle specified as 180°, but I have a requirement to rotate to certain angles greater that 180°. ...
3
votes
3answers
1k views

Why does my Arduino freezes when i turn a servo

I have a Servo Motor and an Arduino Uno. I used the Arduino to run a servo motor. The code was very simple. It was to just Turn it 90 Deg Anti-Clockwise when a switch is pressed and Turn back to its ...
3
votes
2answers
266 views

A question about Continuous Rotation Servo and Arduino

We have this project that uses a Continuous Rotation Servo and we have a slight problem controlling it. We're planning to attach a Rack Gear to the Servo to slide a stainless steel to the right, and ...
3
votes
2answers
162 views

Servo Driven Through Custom Library Not working Properly

I'm a little new to Arduino, but not to programming or electronics in general. I'm working on a library that will be more fleshed out later, but I'm having issues getting the basics working properly. ...
3
votes
1answer
296 views

Change Servo Speed With RedBearLabs BLE Shield

I recently got the RedBearLabs BLE shield to use it to control two high spped continuous rotation servos. I have the BLE example sketch loaded and the ios controller app works. The problem is that the ...
3
votes
2answers
2k views

Servo Keeps Trying to Turn

I currently have a servo wired to my Arduino and have imported the Servo.h. Here is my sketch: #include <Servo.h> Servo s1; Servo s2; void setup() { Serial.begin(9600); s1.attach(8); ...
3
votes
1answer
86 views

When I verify the sketch I get several errors

I am extremely new to Arduino coding and have downloaded a sketch for the PCA9685 to use with model railroading and turnout control. When I verify the sketch I get several errors ... I don't even ...
3
votes
5answers
11k views

Controlling Servo Motors with push button. Problem though

I have this setup where I have and Arduino Uno, a mini servo motor, and a pushbutton. I use a single pushbutton to control the servo motor to go to one position, then push it again to go back. It ...
3
votes
1answer
988 views

Need help converting a processing sketch for a robot arm with servo shield

I'm currently building a robotic arm. I'm using an Adafruit servo shield, 7 servos, Arduino uno, and a 5V 10A power supply. I found a program that controls the arm with mouse movement using a ...
3
votes
1answer
1k views

Controlling Dynamixel MX24T, MX64T servo wirelessly using Arduino Mega?

I am planning to control multiple Dynamixel servos (MX28T or MX-64T) wirelessly using an Arduino Mega. Since this servo uses serial communication, I need an additional serial port to interface with ...
2
votes
3answers
2k views

Arduino starter kit servo is shaking

In the example of the arduino starter kit the point is to use a potenciometer to control a servo. The code is angle = map(potVal, 0, 1023, 0, 179); The output in the serial potVal: 1023, angle: ...
2
votes
3answers
846 views

How long does it take for a servo to change rotation?

I have an Arduino Uno and a Micro Servo 9g A0090 servo. Given that Servo.read() simply returns the last value written to the servo I guess there is no way to query a servo's actual position. If I ...
2
votes
2answers
603 views

Arduino: Reading DS18B20 interferes with servo

I have an Arduino with a servo, INA219 (current and voltage sensor) and 2 DS18B20 connected to it. DS18B20 are connected in full-power mode with 5k resistor connected between DATA line and +5V. I ...
2
votes
3answers
18k views

Do I need the Motor Shield to drive servo motors?

I was perusing Arduino's list of official shields and noticed the Motor Shield that can be used to drive up to 2 servo motors. Being brand new to Arduino/robotics, I am wondering: do I really need ...
2
votes
3answers
365 views

Using Servo on Timer3 on a Leonardo

I would like to use the Radiohead library and control a servo from the same Leonardo board. Now the Radiohead library occupies timer1 and therefore cant be used together with the servo library. (It ...
2
votes
1answer
180 views

unexpected primary-expression before ';' token

I'm new to the Arduino world and am working on a sketch to run a servo up and down with a spdt switch. My code is : include #include<Servo.h> int pos = 0; Servo myservo; void setup() { ...
2
votes
1answer
298 views

How to execute commands on Arduino (via PC) without touching the current sketch?

I am working on my first Arduino project. It's a Reverse Geocache. Basically, it's a puzzle where a battery-powered Arduino is mounted inside a locked box, and is able to unlock the box if the user ...
2
votes
1answer
2k views

Converting Arduino UNO's analog pins to digital I/O

I am working on an Arduino UNO Project and running out of digital pins. Can I convert the six analog pins to digital I/O and use them to drive servos? Please suggest me a method
2
votes
2answers
979 views

Arduino Packet for Bluetooth

I'm having trouble figuring out how to start my project. The objective is to control a robot with four servo motors and six DC motors through bluetooth. I have a bluetooth shield from Adafruit and I'm ...
2
votes
1answer
24 views

Servo doesn't move if I detach it AFER the write?

So this is a bit weird, and I don't understand anything. Basically, I'm just playing with my servo. I wrote a small program, which can be found at this link: https://pastebin.pl/view/8e9c9573 (Note: ...
2
votes
2answers
1k views

Problem with tachometer using attachInterrupt and servo

So I am creating a tachometer using black/white detector sensor. Here's the code. unsigned long WaktuOLD; unsigned long WaktuNOW; int Detection = HIGH; int Counter = HIGH; float HitungWaktu; float ...
2
votes
3answers
2k views

Arduino Project Power Consumption Calculations

I have built an automated window blind controller that will adjust the angle of a servo based on the value received via a light dependent resistor. Once every 10 minutes the MCU wakes up, gets the ...
2
votes
2answers
496 views

code to force a gentle servo power up

So I am new to the board and looking for a source to answer an Arduino servo project's rough power up. The project uses a pair of servos operating together to swing a small door. I have been working ...
2
votes
1answer
803 views

Why does timer1 not generate correct period on CTC mode with a resolution of 5us?

I have defined my code to generate an interrupt over each 5μs on CTC mode using timer1 but the output shows a time of ~15μs. Following the equation to set the counting number to achieve the ...
2
votes
1answer
764 views

Is there some sample code for operating a servo with an Adafruit Motor Shield?

I have an Adaruit Motor Shield v2, and a Tower Pro SG92R micro servo. I've got it setup so the shield works with my Arduino Uno, and I've successfully tested using other types of motors on the shield. ...
2
votes
1answer
50 views

Servo motor troubles

The image is as clear as I can make it. Here are the basics of my problem. My program is meant to make 6 red LED lights in sequence fade in and out, toggle 5 white LED's on and off with a button, and ...
2
votes
2answers
185 views

How to determine minimum and maximum angle for cheap servos?

I have some cheap KY66 (seems to be SG90 clone) servos. When I turn them to 0°, the servo tries moving and moving, without actually getting to 0°. I read that they are reaching the endpoint but the ...
2
votes
1answer
2k views

Controlling motors and servo with L298N

I'm using an L298N to control the two motors of a robot car, and I also have a servo controlling the HC-SR04. The motors and sensor work fine together, and the servo and sensor work fine together. But ...
2
votes
1answer
218 views

Servos not working properly with joystick

So, I was working with a project in which I used a joystick module to control two servos at the same time. The joystick controls the servos in a way that when the joystick is moved along x-axis, both ...
2
votes
1answer
388 views

How can I swap a servo with a stepper motor?

I'm looking for a way to swap servo 1 with a stepper motor to achieve a single direction circular motion with stops and delay. Instead, now I have the servo going back and forth to repeat the action. ...
2
votes
1answer
57 views

The Mysterious Case of the Mostly-Vegetable Servo

Story: I was playing around with my Uno along with a servo. To my stupidity (or more appropriately: ignorance), I set the voltage to my servo with analogWrite(), rather than servo.write(). It worked ...
2
votes
1answer
11k views

Why does it say “Servo” does not name a type

#define pingTrig 6 #define pingEcho 7 #include Servo myservo; void setup() { pinMode(pingTrig, OUTPUT); pinMode(pingEcho, INPUT); myservo.attach(9); } void loop() { long duration, inches, cm; ...
2
votes
2answers
347 views

Servo library unable to control more than 11 servos

I am working on assembling the ROFI robot from Project Biped (http://www.projectbiped.com/prototypes/rofi) and I have not been able to run any arduino program as they will not function correctly. To ...
2
votes
1answer
31 views

Movement and storage of servo positions via bluetooth

I am trying to program a 4DOF robotic arm (using 4 servo motors). I would like to move the servos using an Android app, by means of bluetooth (HC-05). I developed the app, in whose interface there are ...

1
2 3 4 5
10