arduino & servo + external power - ground to arduino?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
marc_is_curious
 
Posts: 19
Joined: Wed Sep 19, 2012 9:00 am

arduino & servo + external power - ground to arduino?

Post by marc_is_curious »

hope you may have a spare second to send an input
&
looking forward to your reply!

-----------------------------------------------------------------
-----------------------------------------------------------------
arduino, servo + external power, potentiometer, switches
ground to arduino


once i connect the servos' 6V power ground
to arduino's "gnd" pin i get uncontrollable results
with my potentiometer & switch;

if i disconnect the servo's 6V power ground
from arduino "gnd" pin
the potentiometers & switches work as required ...

---->
can i simply NOT connect the servo's battery "Ground" wire
to the arduino ground pin?


-----------------------------------------------------------------
-----------------------------------------------------------------
better power supply

a 9v battery won't last you very long with servos ...

i've heard that one should wire 2 in Parallel
to double the power's runtime …

do i need any additional components for this?

how else may i enhance the battery's (motor's) runtime?
Attachments
arduino, servo + external power, potentiometer, switches<br />ground to arduino
arduino, servo + external power, potentiometer, switches
ground to arduino
servos power ground.jpg (1005.85 KiB) Viewed 432 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: arduino & servo + external power - ground to arduino?

Post by adafruit_support_mike »

marc_is_curious wrote:can i simply NOT connect the servo's battery "Ground" wire
to the arduino ground pin?
Not if you want your servos to work.

GND is the common reference that all parts of the circuit use to measure the voltage at other points. If you don't connect the servo GND to the Arduino GND, the servo has no way of knowing what signals the Arduino is sending.

Another way of saying the same thing is: if you don't have two wires for current to flow through (one out and one back), you don't have a circuit.
marc_is_curious wrote:i've heard that one should wire 2 in Parallel to double the power's runtime …
That is... not correct.

The amount of runtime you get from a battery depends on how much energy is stored in the battery (usually measured in milliamp-hours, symbol: 'mAh') and how much energy the load uses (properly measured in Watts, but can be simplified to Amps).

The basic unit of stuff in electronics is 'charge'.. usually electrons, because they're about 1800 times easier to move than protons.

The unit of charge is the Coulomb, which is roughly 6.25e18 electrons, where the 'e18' means 'put 18 zeros here'. That sounds like a whole lot, but in fact it's about the number of free electrons in a piece of copper the size of a grain of salt. There are *lots* of atoms in even a small piece of matter.

The stuff we call 'current' measures the motion of charge. It's a combined measurement though, including "how many charged particles are moving?" and "how fast are they moving?" If one electron moving at a given speed multiplies out as a current of C, two electrons moving half as fast will also give you a current of C.

The unit of current is the Ampere, which translates to 1 Coulomb of charge passing a fixed point every second. Taking that back to physcial terms, you can think of it as the grain-of-salt sized piece of copper moving its own width every second.. not enormously fast.

The stuff called 'voltage' measures the amount of energy it takes to move a certain amount of charge from one place to another. You can also think of it as "how much the current wants to get where it's going".

A battery has a certain amount of stored energy that it can use to push charge from its positive terminal to its negative terminal (the electrons actually go the other way, but that's a long story that boils down to "Ben Franklin guessed wrong, but was extremely persuasive about it"). The amount of energy each unit of charge will receive in the process is defined as the battery's voltage.

Once you have "amount of energy stored in the battery" and "amount of energy each electron gains as it moves from one battery terminal to the other", you're pretty much stuck on the total number of electrons you can move. The only option you have left is "how many electrons do I want moving at any given time?"

The number of electrons moving at a given time is half of what we call 'current', and if you know the voltage you can calculate the 'how fast' part.

A 9v battery usually has about 500mAh of stored energy, meaning it can deliver 1mA for 500 hours, or it can deliver 500mA for 1 hour. That conversion isn't perfect due to chemical issues in the battery, but the general idea holds.

Your servos/motors require a given amount of current, so that value locks in the amount of time it takes to drain all the stored energy from the battery.

Running another pair of wires will have absolutely no effect on the overall calculation. You'll get a microscopically small amount of extra power to the motors because two wires in parallel have half the resistance of one wire, but we're talking less than a thousandth of an ohm (Ohms give voltage something to push against.. 1 Volt can push 1 Amp of current through a resistance of 1 Ohm).

Bottom line on battery life: if you want more battery life for a fixed load, you need a battery with more stored energy.

User avatar
marc_is_curious
 
Posts: 19
Joined: Wed Sep 19, 2012 9:00 am

Re: arduino & servo + external power - ground to arduino?

Post by marc_is_curious »

-----------------------------------------------------------------
better power supply

Thanks a lot for the very illustrative explaination
of electronic's basic units in a nutshell,
i highly appreciate!

i have never thought/learned about the in-depth
"why's/"how"s" before – helps to understand
the background scenario
&
why a double-battery-parallel circuit
will not meet my servos' needs …!


-----------------------------------------------------------------
… ground to arduino

Just to make sure i understand…

GRND connection
(wired link in between GRND servo circuit / arduino circuit )

- GRND enables a arduino-board-sided feedback
of the servos' temporary position

- without GRND connection (as in my case)
the servos do work, move according to my script
but the servos just receive/execute instructions
via …

arduino circuit anlogRead(A0) pin ---------> servos' circuit signal in: motor A
arduino circuit anlogRead(A1) pin ---------> servos' circuit signal in: motor B


can i improve my
"buttons/pot-values-go-crazy" situation
when GNDs (arduino/servo circuits) connect
if i add a specific capacitor at the GRND line
(i only tried a 1uf cap yet )?

why do i need a feedback on behalf of the servos
(they do work as i want them to)?

User avatar
marc_is_curious
 
Posts: 19
Joined: Wed Sep 19, 2012 9:00 am

Re: arduino & servo + external power - ground to arduino?

Post by marc_is_curious »

...
just a brief update:
- most likely was a mistake within my coding;
i connected the servos' circuit to the arduino's ground
(blue wire) & it worked
(&& fixed the wiring for the voltage regulator within my
previous sketch)
...
Attachments
corr.jpg
corr.jpg (355.27 KiB) Viewed 399 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: arduino & servo + external power - ground to arduino?

Post by adafruit_support_mike »

Looks good.

Glad to hear it's working for you!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”