6 servos on Arduino Uno

Hi,

I need help on how to connect 6 servos, SG90, to arduino uno.

I have so far, connect them up with pmw pins and the onboard 5v gnd pins but i got a lot of jitter and they didn’t function.

Then tried a BT router plug which has a barrel jack and is 12 volts, the recommended voltage. That had the same issue with the plus pin connected to the VIN to supply the external power.

This didn’t work either, i think i might have blown one servo doing this as it’s not working at all.

I’m using a Elegoo Arduino Uno R3 board.

In addition to this my project needs two ultrasonic sensors the SR04, and 4 ir sensors. I can reduce it to one ultrasonic sensor and 2 IR sensors.

The project is making a football theme game where the servos move the ball which the it sensors active to move them left and right. The ultrasonic sensors will be used to switch between servos, from different levels of hand height detection.

I think the board can’t simultaneously carry out two instructions at the same time so my game needs to be single player i guess. Which case i can get by with 1 us, two IRs and 6 servos.

Please do mention if there’s a better way to do this game, football theme.

Thank you.

You can’t power six servos from the Uno. You can control them, but they will need their own power supply. Don’t forget to connect the grounds.

Do all the pwm provide 5v each, does that mean i can connect 5v components across them? or that i can only get 5volts off one pwm pin.

I have changed my project to a ball maze idea, but i need to connect three servos instead of 6.

I am thinking of using npn transistor to power individual servo when needed instead of having constant power to all of them.

prav234:
I have so far, connect them up with pmw pins and the onboard 5v gnd pins but i got a lot of jitter and they didn’t function.

No need to use PWM pins. Any Uno pin can control a servo, even the analogue pins.
Do not use pin 0, 1 and 13 though.

Servo power is your problem.
It must directly come from an external supply, capability of the stall current of all attached servos combined,
and power can’t go through the Arduino.

An SG-90 is listed as 650mA@5volt stall.
Don’t forget to share servo supply ground and Arduino ground.

Use detach() to disable servos. No need to switch power.
Leo…

it needs to power six servo motors by an extra power source, not from Arduino. It is similar with below image

I can use a 12v 2amp power supply, assuming that i will need to hook up 58ohm resistors to stop the servos from blowing out.

servos use : 5 volts, 120 miliamps

When the servo starts, it will draw 600 ~ 1000 mA, how much voltage will be required to drive 600mA through a 58Ω resistor?
Hint: Volts = current in Amps times resistance in Ohms.

prav234:
servos use : 5 volts, 120 miliamps

That's maybe when they are moving freely (no load).
For a brief moment, when they start moving, or when they keep position, they draw short peak currents of ~650mA. You can only see that with a scope, not measure with a DMM.
The supply must be able to provide those peak currents.
If not, you have the jitter you talk about.

A 12volt supply is a poor starting point for 5volt servos, and you can't reduce voltage with a resistor.
Better get a 5volt supply, with the right current capability.
Leo..

Or, better yet, you can use this servo module that is easier to give more power to [https://www.amazon.com/HiLetgo-PCA9685-Channel-12-Bit-Arduino/dp/B07BRS249H/ref=sr_1_3?dchild=1&keywords=servo+driver&qid=1621530514&sr=8-3]