Questions tagged [servo]

A servo is a motor, commonly used in robotics projects. This tag is for questions about the servo motor when using it in robotics and other projects.

Filter by
Sorted by
Tagged with
27
votes
9answers
25k views

How can I control an RC servo?

I'd like to control a small RC servo (5 V, 500 mA) from the GPIO pins via Python. Hardware What are the required electrical connections? Can I connect multiple servos to the Raspberry Pi?...
7
votes
2answers
2k views

Use a servo right from the GPIO without a breakout board

I've been researching how to use a servo on my Raspberry Pi but the tutorials concerning this seem very complicated. This surprised me, since the Raspberry Pi has GPIO built right in. Despite the Pi ...
5
votes
1answer
5k views

Controlling Servos with a Raspberry Pi

I am not sure if this will break my Pi, so I decided to double check In this image is a simple servo connection, I am still learning how servos work. I actually have two questions: If I decided to ...
5
votes
1answer
2k views

PWM Control on Raspberry PI

Alright so I understand this question is fairly saturated, but my use in pwm is for two differing pieces of hardware. (Sourced from: https://www.modmypi.com/blog/raspberry-pi-gpio-en-franais) From ...
5
votes
3answers
1k views

How can I get a clock in C accurate enough to control a servo?

I want to write a program that controls a servo motor myself using a pi B+. Controlling the motor involves sending 1.5 millisecond pulses along a GPIO pin every 20 milliseconds. I have tested the ...
5
votes
2answers
4k views

Powering 2 servos with 5v output of L298N dual motor driver

I am using L298n Dual Motor Controller to control two dc motors for my robot. But I want it to power the servos too. I have created this circuit design. can I power the SG90 Servo with L298n? Is ...
5
votes
2answers
541 views

Pin powered Pi crashes when servos move

I have been working on a circuit to power a Raspberry Pi and servo(s) from a single power source. The diagram below shows the basic configuration, although the 'AA battery' is actually two 18650s. ...
5
votes
2answers
2k views

How could I use a RasPi to control keg flow?

I'm in the middle of a basement retrofit and have a refrigerator that I'm hoping to convert to a kegerator. Before I go to town drilling and such, I was wondering if there was a way I could use a ...
4
votes
1answer
7k views

Getting axis values from joystick from jstest into C program

I am wondering if there is a way to get the axis position values from a joystick to feed into a C program. I can run the command jstest /dev/input/js0 and it will display live feedback of current ...
3
votes
1answer
15k views

How to use pigpio to control a servo motor with a keyboard?

My aim is to be able to control a servo motor with my keyboard in a real time fashion using the python module of pigpio. That is, when I press say the 'w' key it rotates clockwise and when I press the ...
3
votes
1answer
9k views

WiringPi + softPwm calculation to determine duty cycle

For my project we got a pre-installed rpi with all the working libraries and an example program to set a servo in middle position. The info: in a period of 20ms (50hz) we need 1,5ms to set it to ...
3
votes
3answers
753 views

What components are required for connecting servo motor to PI?

I'm planning to integrate a servo motor with a raspberry PI to press a switch button and found this post very helpful : PWM Control on Raspberry PI I'm considering this motor VicTsing Mini SG90 9g ...
3
votes
1answer
3k views

Servo jumps on raspberry pi boot

I have just started using a servo to drive the front steering of a remote control car frame which i cannibalised. The steering works fine if i start it up and tune it however when i shut down the ...
3
votes
1answer
295 views

How to power a Raspberry Pi and servo motors with one power supply

I'm building a robot using Raspberry Pi and several servo motors. I'd like to power all components using a single lithium ion battery. I've looked into using a motor driver hat, but it seems the motor ...
3
votes
1answer
273 views

PWM Servo - Check availability

I'm writing a program which requires Servo's basic movement. Here's the code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) pwm = GPIO.PWM(18, 100) pwm.start(5) ...
3
votes
1answer
954 views

How to call ServoBlaster from C#/Mono?

I have successfully installed ServoBlaster, and it runs quite well from the terminal with the command echo p1-22=250 > /dev/servoblaster just like the documentation says. However, when I try ...
3
votes
1answer
3k views

My servo jitters sometimes

I'm trying to build a toy model of self-driving car for my FYP. I have a RPi3 B+ Model with a custom 3D printed chassis which uses a futaba s3003 servo for steering front wheels. Servo is currently ...
3
votes
0answers
96 views

Is it possible to control servos in both directions on the RPi?

I have been working on controlling servos in one direction with PWM control via GPIO ports on my RPi 3. I've worked with motor controllers that use PWM before and it seems that I should be able to ...
2
votes
4answers
3k views

trigger cron job from web application

I would like to improve on my project by using cron jobs. Currently, i have a web application that allows me to control servos. However I would like to add another function on the web application ...
2
votes
3answers
2k views

Connect two devices to the same GPIO pin

Let's say I want to control two servos from my Raspberry PI but I want to give them the exact same movements. Could I connect them to the same GPIO port, so they can use the same signal? If not, what ...
2
votes
3answers
938 views

Programming servo - What to use?

So I just decided to start a small side project using the RPi to control 1 or 2 servos. At first, I thought this would just mean plugging the GPIO pins of the servo to the GPIO pins on the RPi, and ...
2
votes
1answer
338 views

How to make the motion of a servo motor smoother?

I am having some trouble with controlling the motion of the servo motor. When I run my code, the servo motor moves in the specified range but the motion seems a bit erratic. I would be really grateful ...
2
votes
2answers
9k views

Enable i2c on Ubuntu Mate Raspberry Pi 3

I am having trouble utilizing the i2c bus on my raspberry pi. I am attempting to use it through Adafruits python module for their Servo driver board. When I run a method using the i2c I get: ...
2
votes
2answers
7k views

How to run 2 servos with wiringpi2 on Raspberry pi 2

Hello I want to use 2 servo with different gpio pins. But Raspberry has one hardware pwm (GPIO 18). first of all I tried another pin to run servo and my code: wiringpi.pinMode(18,2) wiringpi....
2
votes
1answer
1k views

Is there a way to slow down servo movement speed?

Despite searching I was not able to find an answer to this question. I have a servo attached to a pin that moves an arm back and forth. The problem is that it moves too quickly. Is there a way ...
2
votes
1answer
1k views

Controlling servo with Raspberry Pi but it doesn't stand still

I'm a new entry in the world of Raspberry Pi and Python language. My problem is as follows: I would like to control an micro Servo SG90 (datasheet here) with my Raspberry Pi 3 model B. Looking online ...
2
votes
1answer
8k views

Raspberry pi servo motor angle calculation [closed]

I know servo : 1 ms is 0 degree 1.5 ms is 90 degree 2 ms is 180 degree I also know servo motor has period of 20 ms and PWM from 1-2 ms, but i totally confused how to calculate angle like 30 or 60 ...
2
votes
2answers
523 views

How to get pan-tilt servos quiet forever after first adjustments

I have a camera mounted in an Adafruit pan-tilt mini kit with 2 servos (SG92R). Installed python-smbus and i2c-tools. From raspi-config I enabled 5 Interfacing options P5 I2C. Also installed ...
2
votes
1answer
4k views

RPI B+ with connected servo is twitching

I am looking for some advice on how to properly get my servo working correctly. I have wired it up and it appears to be working correctly. The problem I have is with the signalling causing a twitching....
2
votes
4answers
2k views

Controlling a servo and playing sounds

I've got a serious problem about Pi. It is - I can play sound just fine with a python script either with: import pygame pygame.mixer.init() pygame.mixer.Sound("...").play() or: import os os.system("...
2
votes
1answer
2k views

Using Pan and Tilt servos

I am trying to get pan and tilt camera working with Raspberry Pi. I have successfully gotten one servo to work following this tutorial: I also found this tutorial showing pan and tilt, although it ...
2
votes
1answer
208 views

Trouble getting sg-90 servo to work with R-PI 4

I have read several answers and approaches to controlling an SG-90 servo with a raspberry pi and I have tried the following approaches, with varying but never satisfactory results. Wiring Setup: ...
2
votes
2answers
422 views

set specific angle in pigpio set_PWM_dutycycle

I just updated my code to use pigpio instead of RPi.GPIO, the later is working but my robot is trembling like a chihuahua, so I gave pigpio a try. In this piece of code I'm moving my servo, so to ...
2
votes
2answers
828 views

What servo motors can safely be driven directly from a Raspberry Pi's GPIO header?

A Raspberry Pi's GPIO header includes power pins, and enough I/O pins to drive multiple servo motors. When using this header's 5V supply to power servo motors directly (rather than using external ...
2
votes
1answer
419 views

Why is pigpio library not moving my servo when the same pin number works perfectly with RPi.GPIO?

I am working on a self driving rc car project and I need a servo to steer my car. As I was getting a bit jitter with RPi.GPIO I tried pigpio library. I am using a Raspbery Pi Model B. But it won't ...
2
votes
1answer
467 views

Having issues controlling a servo from pi-blaster

I'm trying to learn more about making electronics making stuff. Right now I'm just trying to get a servo to move so I can go on to bigger things. I have a Pi B+ running Rasbian and an HS-311 servo ...
2
votes
2answers
2k views

Controlling a common RC car

I need to test my computer vision stack written in C++ on a mobile robot and I need to control the robot from a Linux ARM board (which can be a Raspberry Pi). Since the specialized wheeled robot ...
2
votes
1answer
2k views

Controlling servo with pi-blaster works but pi-blaster.js does not

I am able to control a servo with pi-blaster from the command line successfully. However when I try to use pi-blaster.js to do so in Node.js (either at the node command line or from within a Node file)...
2
votes
1answer
10k views

How to use a key listener?

Ok, at the moment I am working on adding motors to a lego tank that I have. I have one servo in the front to steer and another motor in the rear that will make it go forwards and backwards. i have ...
2
votes
0answers
23 views

pwmWrite() dosen't run

else if(strcmp(hyp,"MEDIUM") == 0) { system("espeak 'medium'"); printf("%s\n", hyp); digitalWrite(LIGHT1, HIGH); pwmWrite (PWM_pin1, 524) ; } i try to control ...
2
votes
0answers
349 views

Multiple servo motors with serial commands

I am trying to control multiple servo motors with a Raspberry Pi. I am using a USB to TTL cable for this. I am currently sending following serial commands for the movement. --> gpio -g mode 18 pwm --...
2
votes
0answers
490 views

Servo Not Responding to Input Signal

I have a Raspberry Pi 3 (Model B). I'm trying to drive a servo motor (Tower Pro MG 995). I am using a 6V power supply (4 AA batteries) connected to power and ground of the servo motor. I attach the ...
2
votes
0answers
1k views

Raspberrypi and PCA9685 no bus detected

I'm trying to follow an adafruit servos tutorial to control servo motor from my raspberrypi. My PCA9685 seems on (the green led is power up) and i attached two servos to it. I cabled as in the ...
2
votes
0answers
527 views

How to connect a servo feedback potentiometer?

I've taken apart an old RC car and have been trying to get my Raspberry Pi to run the car. At this point, I'm able to control the rear drive motor. The motor is connected to a L298N H-Bridge module. ...
2
votes
0answers
511 views

Getting current servo angle with GPIO

Without using Occidentalis (which might not even work that way), is there any way to get the current angle of a servo? I know it has a potentiometer, I just have no idea how to go about getting that ...
2
votes
0answers
2k views

Controlling a Servo motor [closed]

I am having trouble running a servo motor with raspberry pi Here is what I have done so far , I have gotten a servo motor (http://goo.gl/67AsF), I have powered it with a 5 volt power source from a ...
1
vote
2answers
2k views

Raspberry pi PWM stability

Is it possible to control 3 servos with a raspberry pi without hardware for it? My firsts tests showed me it was possible, but sadly just ssh connecting to the raspberry pi makes the servo move ...
1
vote
2answers
3k views

Max number of RC motors controlled by Raspberry PI

I have already searched the web, there are posts and articles showing how to control a servo motor or dc motor using raspberry pi. my question is what is maximum number of motors i can control using ...
1
vote
3answers
229 views

Can I reliably control four ESC with a servo driver board?

Im currently looking into building a quadcopter from scratch. The Raspberry Pi only has two PWM pins though, which isn't enough. And software PWM isn't great either, because you can't control a motor ...
1
vote
2answers
655 views

Why does my raspberry pi zero w crashes when controlling a DC motor with an L9232D and a 9g Servo motor?

I use this simple circuit to control a DC motor with an L293D, and a 9g servo motor with a Raspberry PI Zero W: I use the simple following code to test the circuit: from time import sleep import RPi....