Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [servo]

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

7
votes
1answer
1k 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
75k 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
5answers
7k 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
5answers
6k 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
3k 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
1answer
5k 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
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
508 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
3answers
842 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 ...
4
votes
2answers
146 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 ...
4
votes
1answer
234 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 ...
4
votes
2answers
127 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. ...
4
votes
4answers
170 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 ...
3
votes
1answer
267 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 ...
3
votes
3answers
932 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
3answers
749 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
1answer
105 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() { ...
3
votes
2answers
329 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 ...
3
votes
3answers
1k 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 ...
3
votes
1answer
10k 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
1answer
100 views

Can you tell me if this circuit will work?

Here's an image of my circuit diagram. There are 8 9g servos connected to the arduino gpio pins. The servos have an external power supply of 3 volts (may vary depending on the voltage requirement of ...
3
votes
1answer
55 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 ...
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
2answers
223 views

Hold a random number

I am trying to create a code that has at least 6 servos attached and two buttons for a two player game. I want to be able to roll a random number and have it hold that value then when it is that ...
3
votes
5answers
8k 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
915 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
500 views

Powering Multiple Servos From One Battery- What is my circuit missing?

I'm working on a robotics project right now and my limited DIYer knowledge of electrical circuits is failing me. I need to power 7 Rage Standard Metal Gear Servos (RGRS104-16-6vm) and 4 RadioShack ...
3
votes
0answers
249 views

Servo.attach method causing strange issue [closed]

I am using the L298N motor driver for a robotics project to control 4 motors. 2 motors in each input and output terminal. I have this connected to an Arduino Uno which is powered by about 7-8v from ...
2
votes
3answers
1k 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
2answers
458 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
328 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
15k 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
1answer
1k 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
816 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
2answers
178 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 ...
2
votes
1answer
530 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
654 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
87 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
1k views

Automatic/manual door lock with servo [closed]

I'm building an automatic door lock, which is moved by a servo ( this one ). However, I want to still make it possible to open the lock manually, but it's not possible if the servo is attached to the ...
2
votes
1answer
306 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
207 views

Controlling an analog potentiometer using an Arduino

I want to be able to control an analog potentiometer. I'd like to be able to go from the minimum range to the maximum range possibly using an Arduino and a motor/servo. I want to be able to control ...
2
votes
1answer
243 views

Arduino and big servo

My dad told me, if i can mount some servo (to control 4 way ventil of heating) to his arduino-controlled home. But there is a problem... The servo does not have a normal 3 cables but 6 and I have no ...
2
votes
3answers
543 views

Arduino shuts off and doesn't turn on after couple hours

I use a mega 2560, pir sensor and a SG90 9g Servo motor in my project. Basically while the pir outputs high, the Servo Motor rotates from 0 to 180 degrees. Here is how everything is wired up: PIR ...
2
votes
1answer
281 views

Get servo to travel full length

Recently we purchased servos for use in an Arduino and began testing with servos. It turned out that the uSec for the servos differed from the online documentation and we had to find the min and maxes ...
2
votes
2answers
2k views

Servos and ultrasonic at the same time

So recently I started making a sonar out of ultrasonic HC-SR04 sensor and servo motor. The idea was to slowly rotate servo 180 degrees while measuring distance. Soon after I noticed that regular ...
2
votes
1answer
1k views

Control servo motors with buttons and via web application

I have this assignment and I have been tinkering a long time about it. I need to make a simulation of a parking lot where servos would represent the ramps. I will be using 2 Arduinos running the same ...
2
votes
1answer
164 views

Continuous Servo not setting speed correctly

I have two continuous servos connected to my Uno, and I'm running this code on it: leftServo.write(91); rightServo.write(102); delay(3000); leftServo.write(112); rightServo.write(81); delay(3000); ...
2
votes
2answers
284 views

RFID stops working when I place the servo

I've successfully implemented Door Unlock system described in this tutorial. At first I used Arduino Uno and RFID RC522 Reader and MG90S Micro servo. When I used Arduino Uno with Arduino Pro Micro ...
2
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 ...