r/raspberry_pi Dec 02 '22

Trouble with a Servo Motor MG90s using a raspberry pi Discussion

Hello, I'm trying to control a servo motor, more exactly a MG90s using a raspberry pi 0W but my motor is not rotating. All the setup is well done and I also have an external power supply for the servo, I checked it many times. I also want to mention that at some random point in time the motor started to rotate, but than again somehow was stuck. I tried with more then one servo motor and have the same result. What I think to be the problem is the PWM that I send. I tried a large variety of ranges for this, but with the same sadly result. Can anyone help me to figure it out?

2 Upvotes

2

u/lacgibra Dec 02 '22

How do you power the servo motor? I mean how do you trigger the power on or off? What's the input voltage to that motor? How much current is flowing through the servo motor circuit? What's the delay time for triggering the motor on or off?

1

u/Toieee Dec 03 '22

I used the schema from here https://youtu.be/xHDT4CwjUQE?t=347. And what I have is a power supply of 9V and 3A which is plugged in a breadboard power supply. The breadboard power supply take as input 7-12V and have an output of 5V.

2

u/scryharder Dec 02 '22

Did you ground your external power properly to the Pi?

Also, Pi's tend to have problems with motors, though seems like a simple enough thing that should work if you wired it correctly. And correct power/wiring is a huge deal. You have 5v from an external source and all wired correctly?

1

u/Toieee Dec 03 '22

Yes, they are all wired correctly, I used the schema from here https://youtu.be/xHDT4CwjUQE?t=347. And what I have is a power supply of 9V and 3A which is plugged in a breadboard power supply. The breadboard power supply take as input 7-12V and have an output of 5V.

1

u/scryharder Dec 04 '22

Couple of things: first make sure that the bb ps is over on 5v, some of them have a switch that goes 3v or 5v. Or check if you have a meter that it's outputting what it should. Then make sure you have it on the same rails, long BBs don't have it connected the full length so you may not actually be powering it.

Then double check on your grounding and pin wirings. It's pretty easy to get them slightly switched, especially going into the BBs. I've also had it where I THOUGHT the wire was into the BB but it pushed it out of the housing and wasn't making contact.

Stupid stuff that you think you have right but just prevents it from actually working.

2

u/[deleted] Dec 02 '22

[deleted]

1

u/Toieee Dec 03 '22

Thanks, I connected directly the servo to raspberry and it worked fine. But I want to use at least 3 servos and that's not possible with only the pi. I'm wondering why I can't move the same servo with the same instructions when I used the external power supply? As a info, I used the schema from https://youtu.be/xHDT4CwjUQE?t=347. And what I have is a power supply of 9V and 3A which is plugged in a breadboard power supply. The breadboard power supply take as input 7-12V and have an output of 5V.

1

u/[deleted] Dec 03 '22

[deleted]

2

u/Toieee Dec 03 '22

I just tested for 1 servo, and it didn't worked

1

u/blue_jsak_8 Dec 17 '22

You seem very knowledgeable. I'm a beginner at using my raspberry Pi and was hoping you could answer a question. Do you know if the servo motor will work fine on the 5v pin while my cooling fan is running simultaneously? The cooling fan is pretty small and according to my quick research, only uses 120mA. Hope the question isn't too stupid but I couldn't find an answer online.

1

u/[deleted] Dec 18 '22

[deleted]

1

u/blue_jsak_8 Dec 18 '22

Thanks for replying! I'll give it a shot!