Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently working on a project where I need some very long wires (about 20 meters, and that is 40 meters both ways), that will be connected to a button which will be used to trigger a pin on the controller (ATmega8).

Due to expected voltage drop problems, I have chosen that I will pull the I/O pin high, and run ground through the button (button pulls I/O pin low and triggers it).

Hence my question: Will there be any problems using such long wires when I run ground through them, instead of Vcc voltage level (5V)?

Does ground suffer from "voltage drop" like problems?

share|improve this question
6  
Why wouldn't you draw an equivalent circuit with a resistor representing your wire? It will clear the thing to you.. – Eugene Sh. Feb 1 at 21:23
1  
Think of it not like a drop, but like a raise – PlasmaHH Feb 1 at 21:24
    
Experimental tip. You can verify whether or not your circuit works in presence of voltage drops. Add resistors in series with the button. The resistors will simulate the voltage drops across the 20m wires. – Nick Alexeev Feb 2 at 4:54
    
Voltage drop may not be your only consideration. Really long wires make great antennas in our RF noisy world. – user957902 Feb 2 at 16:43
    
@user957902 I agree that noise may become a problem, though I am not sure it will. Anyways if it is a problem I better experiment with some rc filters :) – Estin Myrhaug Feb 2 at 21:23
up vote 11 down vote accepted

No, it doesn't (but...)

Ground, by definition, is the zero point in a circuit so it can't experience "drop". Ground wires (e.g. connections to ground) are subject to Ohm's Law like any other wire.

This is your circuit as best I understand from your description:

schematic

simulate this circuit – Schematic created using CircuitLab

From the Arduino's perspective the ground is a large sheet of copper foil buried inside the circuit board. All determinations of voltage (and therefore logic levels: high/low, 0/1, true/false, etc) derive from comparing the signal potential energy to the potential energy of this foil sheet (which is usually connected, ultimately, to a battery/power source's negative terminal).

Long wires are ok in your application because...

In your question you are concerned with the voltage losses in a ground wire (the wire connecting the leg of the switch to ground). This wire can (and will) develop a voltage as current flows through it (Ohm's law) and so "drop" in your understanding, but this drop is not significant enough to cause problems due to the way the switch circuit is designed:

R3 is typically three orders of magnitude greater than the resistance in the wire pathway through the switch. When the switch is open the resistance is almost infinite and the voltage at the Arduino GPIO node is equal to V1. When SW1 is closed, the resistance between the Arduino GPIO node and ground is now the resistance of the two wires to the switch and the switch itself.

24AWG wire (the kind used in network cables and other small wire systems is about 0.085 Ohms/meter). You could go more than a kilometer before you reach 100 Ohms! Even at these great resistive values, the total resistance in the wire path would be less than 250 Ohms and therefore represent only 2.5% of the total voltage (e.g. still almost 0 and certainly low enough to be read by the Arduino as logic 0).

Not all "grounds" are the same...

The concept of ground is defined for the system. If you have multiple systems there can be differences between their respective grounds.

@Techydude points out several interesting examples of this problem:

long wires in the example above, the ground plane(s) of the PCB, the ground pins of chips, the bond wires between the pins & the silicon die, and the silicon pathways themselves.

This relative relationship to ground occurs because voltage itself is relative. Voltage is the difference in potential energy between two points. "Ground" is just the name given to the second point when all voltages in an analysis are sharing this same second point. If they do not, you will experience (and have to account for) drop in your ground connections.

share|improve this answer
    
wrong. "ground" is relative everywhere, because of Ohms Law, whether it's the long wires in the example above, the ground plane(s) of the PCB, the ground pins of chips, the bond wires between the pins & the silicon die, and the silicon pathways themselves. It's a question of whether or not this matters in any given application. For the example above, no. For high-current motor drivers, perhaps. For sensitive current measurements with an ADC input, probably. If there's lots of high-frequency digital switching going on in said same chip - absolutely. – Techydude Feb 1 at 21:37
1  
@Techydude -- I would urge you to reread the answer. You'll see that we are saying the same thing. The drops you are describing are in ground wires or interconnections between systems with different grounds. Ground itself is the zero point. If you deviate from that zero, you are not at ground. – DrFriedParts Feb 1 at 21:43
    
After 4 edits, I would agree with you :) – Techydude Feb 1 at 22:05
1  
Thanks for the detailed explanation and the schematic. It made things a lot clearer :) As a final question: will the gpio pin be pulled low as long as the resistance between ground and gpio pin, is less than the resistance between the gpio and vcc? – Estin Myrhaug Feb 2 at 21:18
1  
@EstinMyrhaug Not always. This is defined by the VIL, (Voltage Input Low) spec. On the ATMega the highest voltage that's guaranteed to be a Low, is 0.2 * VCC. Assuming 5 Volts VCC, that's 1 Volt. The Resistor Divider has to have a ratio of 4 to 1. or lower. For a 10KΩ pull-up, that means anything lower than 2.5KΩ is needed. A 10kΩ pull-up with a 9KΩ lower resistance would make 2.36 Volts at the GPIO, which wouldn't be a Low. – Passerby Feb 2 at 21:44

Well, yes. Ohm's law still applies.

Your long wires have a resistance. If you are passing current through those wires, a voltage will be dropped across the wires: V=I*R.

However, if you have designed your circuit well (and used decent wires), the current is small, and R is small, so the voltage difference isn't too large.

You will have to determine the current yourself; without a schematic we cannot tell if the current will be negligible.

share|improve this answer

Ground, whether on a wire or on a circuit board, suffers voltage drop as does any other connection. However, if you design the circuit right you need so little current to sense a switch closure that voltage drop is the least of your problems. You need to make sure that noise and transients induced onto your 40m of wire do not get into and damage the processor. For this you will need a simple RC low pass filter on the input to the processor

share|improve this answer

This is your circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

So, using a simple voltage divider rule you can find out that the voltage on the pin will be $$V_{cc}\frac{R_{wire}}{R_{wire} + R_{pullup}}$$

share|improve this answer

Yes, the voltage drop will be present, but not because of what you think. Depending on the wire's resistance, the mid point, your input, will see a voltage divider. The upper half will be your pull-up (Say 10kΩ), while lower half will be your cable. It doesn't matter if the Wire is the lower or upper half of the Voltage Divider, all that changes is which side sees the larger effect.

A diagram to demonstrate.

schematic

simulate this circuit – Schematic created using CircuitLab

Assuming Cat5 Ethernet cable, with a nominal resistance of 0.0849Ω per meter, at 20 meters is 1.669Ω. With a 10kΩ pull-up resistor and 5V source, that means we have 10kΩ + 1.669Ω + 1.669Ω = 10,003Ω series resistance. Use Ohm's Law, I = V/R, 5V/10003Ω equals 0.000499 Amps or 0.499 MICROAMPS. Since current is the same in a series circuit, we can find the voltage dropped by the Wire Resistance. V = I*R, or 0.000499A * 1.669Ω = 0.000832 Volts, or 832 MICROVOLTS.

Because your current through these wires is so low, the voltage dropped by them is also low.

share|improve this answer
    
Thanks for the answer with detailed schematics. It will certainly require some time and thinking from my side before I understand all of it, but I am working on it :) – Estin Myrhaug Feb 2 at 21:21

In the midst of all of this Ohm's Law discussion, do not overlook @SteveG's answer. You don't say what value of pull-up resistor you plan to use, but if you're thinking of just using the internal pull-ups in the ATmega8, be aware that they can be as high as 50k Ohms. That's a pretty high impedance to be hanging a 20 meter cable on, and seems like it's just asking for noise problems. You also don't say what type of cable you're using (twisted-pair, shielded, etc.) or what type of environment you expect it to operate in.

I would take his suggestion even further, and not just put an RC filter on it, but if I cared about blowing up my microprocessor (which I usually do care about), I would put an external buffer on it. The ATmega8 GPIO pins do have a few hundred millivolts of hysteresis, but with such a long cable you could still have noise problems even short of damaging anything. An external receiver would also let you tailor the voltage thresholds to get the best noise immunity without being dependent on the input characteristics of the uP.

share|improve this answer

Although you have some misconceptions, I will first address the circuitry.
Using DrFriedParts circuit, the equivalent resistance of each 20 m wire, is about 2 ohms. This means you can safely use a 1k ohm pull up resistor.
I agree with others in that RF noise could be your worst problem. You should use, at least, shielded twisted pair wire, with the shield tied to PCB ground.

In regards to "ground suffering voltage drop effects," you need to differentiate between ground reference and ground wire.
"Ground reference" is usually the most negative point of a circuit.
"Ground wire" is a wire tied to the ground reference.

As can be seen on DrFriedParts circuit, the wire going from the switch to "ground reference" is considered the ground wire, the wire going from the switch to GPIO is considered the high wire. There is no difference between the wires. They are both 20 m long and with about 2 ohms resistance, each. So, if 50 mA current is flowing, there will be 0.1 volt drop on each of the wires. This shows that ground wires "suffer voltage drops", just like any other wire.

When the switch is open, the GPIO will be "high" (higher than 3v), and when the switch is closed, the GPIO will be "low" (less than .2v).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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