Help please!!! Noob here.... Servo motor controller

Hi! i am currently working on a motor controller project. I am using 2 micro-controllers (Arduino Mega 2560 & Arduino Fio), MPU6050, and servo motors.
The MPU 6050 is connected to the Arduino Fio which sends the output to the Arduino Mega 2560. The Arduino Mega will process the output from Arduino Fio which would be the basis for controlling the Servo motors.
My problem is when i assemble the circuit without the servo motor the circuit runs ok and i could also see the output received by the Arduino Mega 2560. But when i add the servo motors when i connect the Arduino Fio to the Arduino Mega 2560 the Arduino Mega will suddenly shut down. i am confuse why is that happening. Can somebody explain me why is that happening?
I am also using a 6v, 20Ah battery as the supply for the Arduino and external supply of Servo motors.
I appreciate all the help i could get... and Thank you!!!!
i also attach an image of my circuit made using fritzing.
Again Thank you......

Nice looking/well drawn schematic. That said, I think you’ve got a power bus problem.

You can’t drive that many Servos from the Arduino. I run my system off a 12v high amp battery too. I use a DROK variable power converter to step that down to a high amp 5v bus. So I have stuff (like sensors) and the Arduino on the 5v high amp, then other motors and such on 12v.

I think a lot of servos like 6-7vdc. So a 5v bus will work, but not great. So you could split your 12v twice. Step down to 7vdc (Servo bus), and 5v bus(sensor/ Arduino)

But i am already using a high current source (6v, 20A).

FullOfBadIdeas:
Nice looking/well drawn schematic. That said, I think you’ve got a power bus problem.

You can’t drive that many Servos from the Arduino. I run my system off a 12v high amp battery too. I use a DROK variable power converter to step that down to a high amp 5v bus. So I have stuff (like sensors) and the Arduino on the 5v high amp, then other motors and such on 12v.

I think a lot of servos like 6-7vdc. So a 5v bus will work, but not great. So you could split your 12v twice. Step down to 7vdc (Servo bus), and 5v bus(sensor/ Arduino)

i already tried programming some random servo movements and it works. My problem only happens when i add the other arduino with MPU. if the problem is about battery not having enough current to drive the motors programming some random servo movements will not work and the problem will occur.

Post a real picture of the setup, so we can see star grounding and wire size.

Powering 14 servos through a breadboard could dip the power supply to the point that the Mega resets.

Why didn't you use one Arduino and an I2C PCA9685 servo driver breakout board.
Leo..

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Sorry a fritzy picture is not a circuit diagram.

I echo the doubts about using all those servos on a protoboard.
What happens if you disconnect them all except one?
Try it, then add another, etc.

Do you have a DMM?

A picture of your project will help immensely, how have you got the power wires connected for the servos?

Is there a reason you are using 2 controllers, when one will do the job?

Thanks.. Tom.. :slight_smile:

Wawa:
Post a real picture of the setup, so we can see star grounding and wire size.

Powering 14 servos through a breadboard could dip the power supply to the point that the Mega resets.

Why didn't you use one Arduino and an I2C PCA9685 servo driver breakout board.
Leo..

I2C PCA9685 i don't know any store that sells that in my country....

TomGeorge:
Hi,

I echo the doubts about using all those servos on a protoboard.
What happens if you disconnect them all except one?
Try it, then add another, etc.

all right i'll try this to find out... thanks for the suggestion.

TomGeorge:
Do you have a DMM?

what does DMM stands for? sorry i really am just a beginner...

TomGeorge:
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Sorry a fritzy picture is not a circuit diagram.

i'll try to recreate my circuit after doing your other suggestion.

TomGeorge:
Is there a reason you are using 2 controllers, when one will do the job?

Yes, because i want them to perform two things at the same time.... mega will continue provide motor control commands while the fio will continue process live MPU output into fuzzy output at the same time. i tried using one but the delay when processing the MPU provides a lag in the motor control. i need live measurements that's why as a beginner i thought using too would let my job easier.

Hi,
DMM == Digital Multi Meter.
Even a cheap one that can measure volts and ohms will be valuable to you.

In this case you could measure the voltage on the battery as the mega failed, also the voltage on the protoboard that supplies the servos.

Tom... :slight_smile:

Wawa:
Powering 14 servos through a breadboard could dip the power supply to the point that the Mega resets.

i don't think the Mega resets in my case since it never turn's it light on unless i disconnect it.

TomGeorge:
Hi,
DMM == Digital Multi Meter.
Even a cheap one that can measure volts and ohms will be valuable to you.

In this case you could measure the voltage on the battery as the mega failed, also the voltage on the protoboard that supplies the servos.

Tom... :slight_smile:

i see so thats what it was.... i was googling it but can't really find a meaning for it appropriate for this topi...
unfortunately i don't have a digital only analog will that also work?

Run_piggy:
i don't have a digital only analog will that also work?

Of course. I for one love my analog multimeter enough to not want to replace it (they're still being sold).

And I agree with the others: post a picture of your actual project (fritzy images are eyecandy for the uninitiated, an artistic plate of spaghetti to everyone else, are hard to read, and seldom represent reality).
High currents and solderless breadboards don't go together.
High current lines (the return of all those servos) have to be kept separate from the Arduino - the grounds of course you have to connect, but make sure that the main current paths are kept away from the Arduino. Make the connection at the battery.

Another avenue you must explore is the code. As I understand the fio is sending commands to the mega, and upon receiving those commands the mega stops working. So please post the code of both sides, and explain how it's supposed to work.

wvmarle:
Of course. I for one love my analog multimeter enough to not want to replace it (they're still being sold).

And I agree with the others: post a picture of your actual project (fritzy images are eyecandy for the uninitiated, an artistic plate of spaghetti to everyone else, are hard to read, and seldom represent reality).
High currents and solderless breadboards don't go together.
High current lines (the return of all those servos) have to be kept separate from the Arduino - the grounds of course you have to connect, but make sure that the main current paths are kept away from the Arduino. Make the connection at the battery.

Another avenue you must explore is the code. As I understand the fio is sending commands to the mega, and upon receiving those commands the mega stops working. So please post the code of both sides, and explain how it's supposed to work.

it works now. i tried checking using analog multimeter and i found that a single strand of ground wire accidentally touches the 5v input from arduino.. thanks for advice

Run_piggy:
I2C PCA9685 i don't know any store that sells that in my country....

Did you search for "PCA9685" on ebay.
All the boards with the yellow pinheaders (and the ones that look like it) are 16-channel servo drivers.
Only two pins of the Arduino are used for all the servos.
And because it's hardware driven, the Arduino is not used once a (new) servo position is written to the board.
You can daisy-chain in theory up to 60 boards.
Leo..