Jump to content

Controlling a Servo with a Raspberry Pi 3

So I have a raspberry pi 3, and a servo (DGServo 8g to be exact) with the normal 3 pins. I have read guides online with people using a breadboard and external battery to control them. However is it possible to allow them to work by plugging them in directly to the GPIO pins rather than buying a breadboard, battery , etc?

Thanks

Link to comment
Share on other sites

Link to post
Share on other sites

If I remember correctly, don't they just need a ground connection, power (+5V) and a PWM input? If so, connect the ground pin to ground, +5V to +5V, and the PWM pin to an output pin that has PWM control. Never worked with a pi, but I would imagine its the same concept as an arduino would have

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, iamdarkyoshi said:

If I remember correctly, don't they just need a ground connection, power (+5V) and a PWM input? If so, connect the ground pin to ground, +5V to +5V, and the PWM pin to an output pin that has PWM control. Never worked with a pi, but I would imagine its the same concept as an arduino would have

Yep. This.

Main Gaming Rig:

Spoiler

Core i7-4770, Cryorig M9i Cooler, ASUS B85M GAMER, 8GB HyperX Fury Red 2x4GB 1866MHz, KFA2 GTX 970 Infin8 Black Edition "4GB", 1TB Seagate SSHD, 256GB Crucial m4 SSD, 60GB Corsair SSD for Kerbal and game servers, Thermaltake Core V21 Case, EVGA SuperNOVA 650W G2.

Secondary PC:

Spoiler

i5-2500k OCed, Raijintek Themis, Intel Z77GA-70K, 8GB HyperX Genesis in grey, GTX 750 Ti, Gamemax Falcon case.

 

Link to comment
Share on other sites

Link to post
Share on other sites

The gpio pins may not supply enough amperage to control a servo. Best way would be to use a dedicated pwm servo/motor controller so you dont run the risk of damaging the rpi by pulling too much current. If i remember correctly, the gpio pins are directly connected to the main ic with little to no safety or short protection. Just something you want to keep in mind. Both arduino's and rpi's are not too great at running motors without a separate circuit dedicated for the motor/servo.

Case: Phanteks Evolve X with ITX mount  cpu: Ryzen 3900X 4.35ghz all cores Motherboard: MSI X570 Unify gpu: EVGA 1070 SC  psu: Phanteks revolt x 1200W Memory: 64GB Kingston Hyper X oc'd to 3600mhz ssd: Sabrent Rocket 4.0 1TB ITX System CPU: 4670k  Motherboard: some cheap asus h87 Ram: 16gb corsair vengeance 1600mhz

                                                                                                                                                                                                                                                          

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

GPIO on the PI runs on 3.3V, servos run TTL or 6V signalling so you would need a level converter or buffer, which also provides protection. Also, don't bother trying to draw power from the GPIO 5V.

The Internet is invented by cats. Why? Why else would it have so much cat videos?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×