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
3
votes
2answers
414 views

How to move a servo quickly and without delay function

Im trying to move a servo from one place to another while using the typical for loop you find in the servo's library example. int lightON = 180; int lightOFF = 90; for (pos1 = lightOFF; pos1 <= ...
1
vote
1answer
35 views

How can I program 2 ultrasonic sensor, one on the servo motor and one attached on the front side of the car?

I want to attach two ultrasonic sensors to an obstacle to avoiding the car. One on the front of the car Second on the servo motor on the car It is an obstacle avoidance Project. I am getting the ...
1
vote
2answers
38 views

How to move a servo with a function

Im currently moving a servo from one side to another by using the typical for loop like this: int lightON = 180; int lightOFF = 90; if (buttonState == HIGH) { digitalWrite(LED, HIGH); for (pos1 =...
0
votes
0answers
19 views

Why Micro SD card can't log the data when we connect servo motor?

recently Iam making a project which includes Arduino Nano, MPU6050, BMP280, micro SD card module and a servo motor. Brief explanation of my project is basically I am trying to collect data from the ...
2
votes
1answer
32 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 ...
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; ...
0
votes
1answer
42 views

Need to move a servo for certain periods of time

#include <Servo.h> //declare to insert Servo.h library Servo myservo; //create servo object to control a servo int pos = 0; //variable pos to store position of servo unsigned long time; void ...
0
votes
1answer
34 views

Arduino waits until button release to activate

I'm fairly new to arduino, and on my own I'm trying to move a servo to the left and right using 2 buttons. I've got it working for the most part, however when I hold the button down nothing happens, ...
1
vote
1answer
55 views

Possible to have different torque levels on MG966R servo with Rotary Potentiometer?

I want to apologise first and foremost, and say that I am very new to Arduinos! I wanted to control the torque on a MG966R servo so that I can separate it into 4 different torque levels. I read that ...
1
vote
1answer
20 views

Servos jitter when powered by power module

I need 48 sg90 servos to move to a specific position each minute. Now I am using two arduino mega boards to power everything through 6 bread boards but it seems I need more power because some servos ...
1
vote
0answers
102 views

DHT11 thermometer connected to a LCD and 2 servos connected to joysrick [duplicate]

Im trying to find a way to run two codes from the one arduino me being an absolute begginer doesnt even know where to start the DHT11 thermometer is connected to a LCD showing temperature and humidity ...
2
votes
0answers
57 views

servo acting weirdly

I have bought two original TowerPro MG966R 360 degree continuos rotation Hi-torq digital servos. Expected results : 90 deg -- no rotation 90 - 0 deg -- speeding up to one side 90 - 180 deg -- ...
1
vote
0answers
26 views

How can I power off a servo the best way? Problems with MG90S servo [duplicate]

I have a NodeMCU and im trying to control a servo to move from angle A to B and viceversa. The thing is I want to be able to power off the servo after moving so it could stop getting voltage and ...
1
vote
0answers
73 views

LEDs lighting up when off due to servo motor being on

Within my arduino project I have began to run out of GND ports on my arduino so I am having to resort to using 1 GND port for lots of electric components. I have 2 LEDs that are each connected to a ...
0
votes
1answer
40 views

How might I add a delay, close the servo and go to the start again?

#include <Servo.h> Servo myServo; const int piezo = A0; const int button = 2; const int yellow = 3; const int green = 4; const int red = 5; int knockVal; int buttonVal; const ...
1
vote
0answers
23 views

IR output won't stop

So I basically tried to control a Servo motor with an IR Remote. I'm a complete newbie in arduino programming but I just took some things from other scripts and tried them out until It worked, and it ...
0
votes
1answer
36 views

ESP32 servo runs continuous

I have ESP32 connected to TZT servo SG90. This is the code #include <ESP32Servo.h> #define TURN_TIME 175 Servo myservo; // create servo object to control a servo // 16 servo objects can be ...
1
vote
1answer
40 views

Can I control Arduino functions via PWM?

I want to control small functions from an Arduino, things like moving servos or toggling lights. The purpose of these is to decrease the number of channels on a rover I'm constructing. Using the PWM ...
1
vote
0answers
22 views

How do I reset to servo position everytime I excecute a particular sequence

I'm trying to make a prosthetic hand that can play rock, paper, scissors with a human. It is based on the premise that you push a button and it randomly selects a move to play. After each move, I'd ...
2
votes
1answer
110 views

Switch Control Between Two Different Techniques

I have implemented PID control of a generator governor to maintain a constant RPM using an Arduino Uno. It works pretty well, but there is a tradeoff between stabilty and response time. Using PID ...
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: ...
1
vote
2answers
13k views

Sweeping servo 90 degrees

#include <Servo.h> Servo myservo; // create servo object to control a servo // twelve servo objects can be created on most boards int pos = 0; // variable to store the servo position void ...
1
vote
2answers
66 views

Arduino Vin pin does not work, but Arduino 5v pin power works

I have a very weird problem, at least it seems to me that way. I have connected L298N motor driver, Arduino and a hobby servo with a 6v power supply (tested with both 4xAA and 9v alkaline batteries). ...
-1
votes
1answer
26 views

Servo motor analog vs digital and AC vs DC

I am little confused with servo motor terminology. Q1. AC servo motor requires AC power source ? Q2. DC servo motor requires DC power source ? If answer to above 2 questions are YES then what does ...
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 ...
0
votes
1answer
85 views

servo starts rotating whenever it is plugged

I am making a fish feeder using an Arduino Mega 2560, servo motor SG90 and RTC DS3231. I want to make it rotate twice a day, i.e. morning and 9 o'clock evening. Whenever I plug my Arduino board to ...
0
votes
1answer
75 views

How to rotate servo every 12 hours using RTC module?

I am trying to make a auto fish feeder to feed my fish every 6hours. I want to implement RTC module to my code. So far I've been using only an arduino and a servo using this as a code: #include <...
-2
votes
1answer
68 views

Code for fish auto feeder not working [duplicate]

I've been trying to make this code work, but for some reason, it doesn't work for me, even if I do everything like in the tutorial. So I've tried to do a new code and the outcome was the same. The ...
-4
votes
1answer
59 views

what is wrong with this code? It doesn't work

#include <DS1302.h> #include <Servo.h> Time t; Servo myservo; int Hour; int Min; int Sec; // Init the DS1302 DS1302 rtc(2, 3, 4); void setup() { myservo.attach(9); myservo.write(45); // ...
0
votes
1answer
45 views

PWM using timer3 for servo control won't generate any output

I'm making a program for a small robot arm controlled by four servos. Problem: I need for PWM outputs, timer1 has three so i need to use timer3 for the last one The main program and the timer1 ...
1
vote
0answers
54 views

SG 90 servos randomly spinning

I started one project where i need 4 servos to control 4 grabbers jaws. i use STM32F103C8T6 with arduino IDE for programming it. The motor TZT Micro Servo 9g SG 90. First, I was playing with stepper ...
0
votes
2answers
122 views

Help - Atmega328p, converting a PWM servo code from pin9 to pin6

I found a working code that uses pin9 (PB1) on my Arduino for controlling a Servo, but in my project, an ultrasonic sensor is already using that pin/timer. I want to convert the code to use pin6 (PD6),...
0
votes
2answers
182 views

Programming Servo How To Get -90 Degrees

as the question title states, how will I go about turning the servo opposite of 90 degrees? I have written my code as such; // Turn servo to the right if(x > 520 && y < 510 &&...
1
vote
4answers
56 views

Can we control other servos with common servo code Arduino

I am trying to control MG996R using code for a typical servo (SG90) I used an external power supply, 5V,2A I connected the servo signal line to Arduino slot 7, servo positive to external power supply ...
1
vote
2answers
344 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 ...
1
vote
1answer
2k views

Controlling a servo motor with a touch sensor

I want to modify my code to move a servo motor only for the duration of time that the sensor is touched and stop moving immediately when the sensor is no longer touched. The code I have moves the ...
0
votes
1answer
372 views

Wemos mini pro switch power from servo with mosfet bs170

I got a servo connected to a wemos/arduino with a capacitor(470uf). Before I didn`t use a cap. Now with the cap the device use to much power while sleeping(capacitor on the servo). I want to switch ...
0
votes
1answer
22 views

Pca9685 & WS2818B, 1 Nano

Arduino n00b here. I currently have an Arduino Nano set up to run 6 servos from a PCA9685 board. I'm looking to add 6 switches and 6 LED indicators to switch servo positions. What I'm curious about is ...
0
votes
0answers
22 views

Huzzah feather scl sda

Trying to hook up an hazzah feather to a pca9685 scl sda connection and have a bno055 connected to that.The 5 volts to power the PCA is not taken from feather. I have a GPS module connected to pin 12 ...
0
votes
2answers
4k views

How can I stop my Servo rotating?

I have a continuous servo motor connected to my Arduino UNO. I want it to react to the Hexadecimal code received by an Infrared remote. I want the motor to rotate once in one direction and then rotate ...
0
votes
1answer
32 views

Why delay of more than 64 millisecond stops the servo motor from rotating? I am not using “Servo.h” instead i am just managing the length of pulse

The code I used was this int servo = 5; int angle; void setup() { pinMode(servo, OUTPUT); } void loop() { for (angle = 0;angle<180;angle++){ digitalWrite(servo, HIGH); ...
0
votes
2answers
247 views

Nodemcu v3 - Power supply via VU pin?

I want to control two hitec hs55 micro servos via a Nodemcu v3. These need at least 4.8 V power supply acc to data sheet. Specs: Hs-55 micro servo: Voltage range: 4.8-6 V Current Drain - no-load (4.8V)...
0
votes
0answers
20 views

How to control 2 micro magnetic actuators with esp12e

i want to control two micro magnetic actuators (just two coil where I want to flow current in +to- and-to+ each motor for wifi airplane) with esp12e Do I need an h-bridge like l293d ? Also I will be ...
-1
votes
2answers
1k views

Parallel servo control?

I have an Arduino Nano & am success fully controlling 4 servos from it but it then occurred to me that I am controlling these in a serial manner, ie I set 1 position then the next then the next.......
0
votes
1answer
45 views

Arduino using delay in I2C receiveEvent

I have read before that you can't use delay() inside I2C receiveEvent because it is an ISR. What I want to do is as follows: I have a servo connected to my Arduino Uno and I want to control that using ...
0
votes
1answer
92 views

Arduino stops working when servo makes a few rotations

The sketch rotates servo back and forth with buttons. When I rotate servo MG 995/996R 2-4 times Arduino stops working. Its voltage step-down transformer switches from ~9V to ~3.7V which is not enough ...
0
votes
0answers
47 views

Control Servo motor via Python GUI (PyQt) component “QDial”

I want to control a servomotor via a Python Gui (PyQt) component "QDial". Hopefully the servomotor should rotate "simultaneously" with the Dial in GUI. Below is the related code: ...
0
votes
1answer
55 views

Circuit not working with 9 volt battery [duplicate]

I have made a simple circuit having an IR receiver and a Servo motor. Here is the diagram: Red wire: power Black wire: ground Orange wire: digital signal And here's the code: #include <Servo.h> ...
0
votes
0answers
26 views

Motor noise on my arduino RC?

So I wanted to make a rc car based on two arduino nanos, two nrf24l01 (rx and tx), and a pololu brushed motor driver (this one) and it worked, more or less. Sometimes it worked very well and ...
1
vote
1answer
113 views

Implement two processes at the same time

I am a beginner in arduino and due to the lockdown I have been learning it by implementing it on tinkercad. I have made a simulation where I have attached : Servo Motor Ultrasonic Sensor Led Bulb ...

1
2 3 4 5
10