Problem with Servo when wworking with dc motors

Hello!
I connected my arduino with a single channel relay driving two 12V DC Motors. Each motor draws about 3 Amps. I have also a small SG90s servo motor connected to my arduino.
When I turn on the motors they work fine but the servo starts shaking like crazy and rotates unexpectedly in different angles (The Servo works fine when the motors are turned OFF).

What could be the problem here?
And how to fix it?

Please post a schematic. Hand drawn, photographed and posted is fine. Include all components, their part numbers and/or values and all power supplies.

Post the specifications of the power supplies (rated voltage, current capability).

Power issue is 1st suspect. Motor and Arduino need separate power supplies with a shared ground.

I cannot post the schematic at this time as I am not home. If I control the 12 V circuit with the relay and power the Servo from arduino, does it mean that grounds of the 12 power supply and arduino should be connected?

The Uno is not a power supply. The servo needs its own supply capable of supplying the right voltage and current. The ground of the servo power supply must connect to the servo ground and the Uno ground. Many servo problems can be traced to insufficient power. What is the stall current of the servo?

If the 12V supply is supplying the motors through relays, the 12V supply ground would not connect to Uno ground. The parts powered through the relays would be isolated by the relays. But to be certain, we need to see that detailed schematic.

How are the relay coils powered? What is the voltage of the relay coils?

And in particular, you cannot power it from 12 V to "Vin" or the "barrel jack" if you propose to connect anything else to the "5V" pin. Except perhaps a couple of indicator LEDs.

A little ditty I posted a few days ago about SG90 servos:
A typical SG90
Specs from that page:

  • Electrical Specification (Function of the Performance): Operating speed (at no load): 0.09±0.01 sec/60°(4.8V ) 0.08±0.01 sec/60°(6V)
  • Running current (at no load): 400±30mA (4.8V ) 500±30mA(6V)
  • Stall torque (at locked): 2.0±0.20kg·cm (4.8V ) 2.2±0.20kg·cm(6V)
  • Stall current (at locked): 1300±40mA (4.8V ) 1600±50mA(6v)
  • Idle current (at stopped): 6±1mA (4.8V ) 6±1mA(6v)
  • Running life(at no load): >350000 Turns(4.8V ) >320000 Turns(4.8V )
    Consider the implications of the Running current and Stall current; conservatively, remember that the Starting current approximates the Stall current, until the arm begins to move. Finally, look carefully at your application, to ensure that at the ends of motion, you're not going into stall by demanding a position the servo doesn't quite get to.

Moral of the story? Find the specs for the servo you're actually using. I haven't seen one yet I would/could power from the Arduino's built-in 5V regulator, considering the conditions above, because sooner or later, your current demand will exceed it's ability to survive.
C

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.