How To Control A Standard Servo With Raspberry Pi

preview_player
Показать описание
Demonstrated here is the fast way to control either small 9-gram servos or a much more powerful 15KG servo using a GPIO Pin on a Raspberry Pi.

Related Information

Servos are an immensely useful way to turn electrical energy into a rotational or linear motion with high efficiency and with great precision. The ones in this guide are all Standard Rotary Actuator Servos that can rotate 180 degrees or 270 degrees. Precise control over the narrow range (degrees of movement) is achieved through position. Information on the desired position is sent through via a PWM (pulse-width modulation) signal. Each servo has unique specifications which you can find in the datasheet and often at the bottom of our product pages. The code wants the values in seconds and datasheets usually provide data in microseconds so you will need to divide those numbers by 100000. Bigger servos need more current than a GPIO Pin can send out so I demonstrate how to power it if that situation arises. Shown here are servos commonly seen by makers but there are exotic types of servos that can rotated 300 degrees and even have internal clutches built in. The code used here allows you to control the angle at which a servo will orientate too maximising your control over the system.

Core Electronics is located in the heart of Newcastle, Australia. We're powered by makers, for makers. Drop by if you are looking for:

0:00 Intro and Schematic
0:10 Overview
1:20 Small Servo What You Will Need
1:47 Schematic and Build
2:23 Coding the Raspberry Pi
2:42 Its Working!
2:47 Explaining the Code
3:05 Pulse Width Modulation Explained
3:45 *Data Shown is for Large Servo*
3:50 End Explaining code
4:15 Large Servo What You Will Need
4:50 Schematic and Build 2
5:40 Coding the Raspberry Pi 2
5:58 Large Servo is Working!
6:10 Explaining the Code 2
6:47 How to use only one Power Supply
7:08 Outro
Рекомендации по теме
Комментарии
Автор

More tutorials need to be like this, short and straight to the point, too many channels add a bunch of unnecessary info

ingu_bingoo
Автор

This helped me finish a project I had been working with for a while. Just wanted to say, Thank you!

ydocld
Автор

Great video, I especially liked the code walkthrough.

SirTrollingham
Автор

Cool video ! Straight to the point, Clearly explained and easy to understand - I like that !

ianbertenshaw
Автор

Your Explanation is very very nice.Thank you so so much sir.

mithunchandra
Автор

Long time Subscribed, bell icon clicked but this video does not appear at all in my feed ! Thanks YouTube!!!

A good, easy to understand guide !

Keeping_IT_Simple
Автор

nice short totorial. Is there also a way to adjust how fast the servo spins?

tischregal
Автор

Where do I get the library for the code?

GavinMiller
Автор

Do you need a special servo to make this a closed loop?

TheVBounce
Автор

Cool Video, really helps me! But which DC power jack did you use?

_nick.
Автор

Thank you for this very helpful walkthrough with servo motors, I have a question if it is necessary to add the gpio.cleanup for this kind of coding.

rml
Автор

Can you tell me if I can connect directly Emax ES08MA II to raspberry pi zero? Ty

antitialaman
Автор

what would interest me is how do i get rotary movement slower say from 90 to -90 in 1 min . Great video :)

dprintsiebarth
Автор

If the servo I want to use requires higher voltage to operate and I need to power it via a 8.4V power supply, is it safe to connect it's ground to the Pi? or is it going to fry it?

serceband
Автор

Hello! I tried your code with a MG90S but my servo isn't moving. Any clue?

andreinarita
Автор

Great video! I was just wondering, would it be possible to use a 5V DC 3A power supply instead of 4A? I'm struggling to find one in any European shops.

actuallyganta
Автор

5V and GND at the Pinout can handle currents of 1000mA?

bransen
Автор

thanks a lot for the explanation. how can we control also the speed of the servo?

oktayakdede
Автор

Hello! I am getting this error when doing the large servo
"PWMSoftwareFallback: To reduce servo jitter, use pigpio pin factory." with a link to the gpiozero docs is there a fix? thanks!

kuross
Автор

Hi love your videos, if you don't mind, which program are you using for your schematic circuit??

khaledkamelbouabdallah