3

We're complete beginners with Arduino and we're working on a project that moves a pointer based on a color sensor reading.

We used two servo motors each: one performs a specific task, the small servo works pretty fine. The problem is with the larger one.

We used this servo motor model: (towardpro MG996R), Arduino Uno and a color sensor. Because the motor is large we connect it to a 9 V power supply.

But when we run the code it just vibrates in place and the arm won't move :(

Is there anything else we need to add to the circuit like a resistor or some thing?

#include <Servo.h>
Servo largeServo;

void setup() {
  largeServo.attach(6);
  largeServo.write(0); 
}

void loop() {
  largeServo.write(0);
  delay (2000);
  largeServo.write(30);
  delay (2000);
  largeServo.write(60);
  delay (2000);
  largeServo.write(90);
  delay (2000);
}
10
  • Does the small servo perform well with the very same code on the same pin? If so, chances are there is something wrong with the large servo, or with its power supply. Commented Apr 28, 2017 at 15:55
  • yes, the code is perfectly fine with the smaller one ,
    – user33243
    Commented Apr 28, 2017 at 15:58
  • but if the problem with the battery how would i know ?
    – user33243
    Commented Apr 28, 2017 at 16:01
  • "9V power supply" as in 9V PP3 battery...?
    – Majenko
    Commented Apr 28, 2017 at 16:06
  • 1
    No, not more voltage. You need something capable of delivering more current. A 9V battery is not suitable for driving motors. They belong in smoke detectors and maybe a transistor radio. Get 3 or 4 AA or AAA batteries and things will go much better.
    – Delta_G
    Commented Jun 3, 2017 at 3:02

3 Answers 3

3

According to (MG996R)'s datasheet You must connect a 6 volts - 2.5 amps power supply for it's best performance (max. Torque) Maximum voltage of this servomotor is 6 volts And be careful, exceeding that voltage can be cause of some damage to it's control board Try 6 volts 2.5 amps power supply and if doesn't work maybe your servomotor's control-board is damaged by over-voltage.

2

As already suggested in the comments you need a more powerful current source than your battery.

No device work purely on Voltage, they all operate on Power (watts) or, if you prefer, on a combination of Voltage and Current (ampere).

You are feeding 9V into your beefy motor, but the amount of current your battery can provide is pretty limited due to the battery internal resistance and limited capacity.

Replace the battery with a proper power source capable to deliver 10W or more (1+ ampere at 9 volts equals 9+ watts) and your motor will start to operate and it will also get warm while operating.

4
  • Please mind that theoretically putting a higher voltage will give more power. But that soms component can not resist higher voltages. The way to go is to take a supply with a voltage within the voltage range of the device. And to make sure it can supply more current as neccesary. (Not the other way around)
    – aaa
    Commented Jun 3, 2017 at 9:18
  • 1
    When applied to motors the voltage reflects on speed and current on torque, but if the motor jitters it's because it doesn't get enough current to overcome the windings inductance. So, while it's true higher voltage means more power, that's not going to solve the issue in this case. Commented Jun 4, 2017 at 11:16
  • Hmm interesting 10v 1a or 20v 0,5a is the same "power". But the first example has more torque and the second one more speed? My conclusion is still true, don't overvolt and be able to supply enough current.
    – aaa
    Commented Jun 4, 2017 at 22:09
  • That's correct Paul: higher voltage means you can change the magnetic field in the coils more quickly while higher amperage means you can create stronger magnetic fields. You don't have to exceed in voltage because the the internal windings have a resistance: provide too much voltage and you burn the windings. Commented Jun 6, 2017 at 12:20
1

To complement the other answers, also make sure that the Arduino itself is being powered properly!

I was attaching Arduino Uno to a nearly out of battery laptop via USB cable, resulting in a jittering servo. As soon as I've put the laptop on charge, the servo started working smoothly!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.