# Compensating for lead resistance.

E.g. I have a DHT11 sensor which I would like to extend. At the moment I have only a short 10cm long data cable and it works fine, but what if I wanted it longer. Or if I wanted to power a 5v relay over a distance of say 5m

My question is: If I know the resistance of the long wire, how can I compensate for the resistance to supply the original/intended voltage/current.

V=IR so an increase in resistance means increase in voltage, but the arduino pins only supply 5v? Still trying to wrap my head around it.

I thought of a voltage divider but apparantly its not that simple. The ratio of current through each path of the divider is equal to the ratio of resistances correct?

You can use heavier guage wire so there is less resistance drop. Relay coils can often be driven from 5V, typically needing just 4.5V.

Another option is to use a higher voltage at the source and then regulate it at the remote end. Yes, V=IR. As V drops, so does I. Voltage divider suffers the opposite - as I changes across the load R, so will the voltage. Thats why voltage divider is not used as a current source.

syphex:
V=IR so an increase in resistance means increase in voltage,

So I can get real high voltage if I put a 10 megohm resistor in my normally 5V line? ]

No, you can only get 5V - but at real low current flow. 5/10,000,000 = .5uA.

If I=V/R, then an increase in resistance will lower the current (maybe too low to the relay). What are the arduino uno's max current through the pins and how much current do I actually need for my 5v-240v relay?

Also, can nothing affect the voltage output of the pins (apart from code)?

Honest, I was just making a joke about what I saw as a ridiculous statement. I do know that resistance does not cause voltage to increase.

GoForSmoke: Honest, I was just making a joke about what I saw as a ridiculous statement. I do know that resistance does not cause voltage to increase.

I don't see it as ridiculous. It doesn't take long to figure out that an unregulated power supply's output voltage increases as the current decreases. Oh, and the output voltage decreases with a current increase. Isn't that weird?

That doesn't apply in a general way and I can't get magnitudes of voltage increase by adding magnitudes of resistance.

The wire resistance can be calculated from this information

http://wiki.xtronics.com/index.php/Wire-Gauge_Ampacity

22 gauge wire can carry 5 amps and it has 16 ohms per 1000 feet

Calculate wire length for 1.2 ohms

1000 * 1.2/16 = 75 feet of wire

If your relay needs 100mA to switch then the voltage lost in 75 feet is

v = ir = 0.1Amp * 1.2 ohms - 0.12 volts lost from 5 volts

5.0 - 0.12 = 4.88 volts delivered to the relay 75 feet away.

syphex: E.g. I have a DHT11 sensor which I would like to extend. At the moment I have only a short 10cm long data cable and it works fine, but what if I wanted it longer. Or if I wanted to power a 5v relay over a distance of say 5m

5m is a fairly modest distance and I'm not sure how much I'd worry about it. Given Ambilobe's example, I'm sure the relay would operate reliably with 75 feet of wire. If I wanted to be extra safe I might go to 18 gauge. But remember that with 75 feet of wire for example, the relay would only be 37.5 feet away.

For a sensor, I'd be even less worried about voltage drop as the current would be probably an order of magnitude less. For long runs, I'd worry about EMI first.

syphex: V=IR so an increase in resistance means increase in voltage, but the arduino pins only supply 5v? Still trying to wrap my head around it.

driving DC relays using a transistor connected to an Arduino pin. http://playground.arduino.cc/uploads/Main/relays.pdf, the transistor being used to increase the voltage to more then 5V

Ok so by the sounds of it I don't have much to worry about, this is more for interest/educational sake now.

AmbiLobe: The wire resistance can be calculated from this information

http://wiki.xtronics.com/index.php/Wire-Gauge_Ampacity

22 gauge wire can carry 5 amps and it has 16 ohms per 1000 feet

Calculate wire length for 1.2 ohms

1000 * 1.2/16 = 75 feet of wire

If your relay needs 100mA to switch then the voltage lost in 75 feet is

v = ir = 0.1Amp * 1.2 ohms - 0.12 volts lost from 5 volts

5.0 - 0.12 = 4.88 volts delivered to the relay 75 feet away.

I know theres an equation to calculate resistance based on wire length and diameter. But I was wondering more how to overcome this extra resistance, thanks for the information though I'll no doubt use it.

BillHo:

syphex: V=IR so an increase in resistance means increase in voltage, but the arduino pins only supply 5v? Still trying to wrap my head around it.

driving DC relays using a transistor connected to an Arduino pin. http://playground.arduino.cc/uploads/Main/relays.pdf, the transistor being used to increase the voltage to more then 5V

Thanks this is what I was looking for I think.. But this is using the transistor as a switch right? So where is the relay +V coming from? Wikipedia says this to use a transistor as an amplifier http://upload.wikimedia.org/wikipedia/commons/thumb/8/8c/NPN_common_emitter_AC.svg/200px-NPN_common_emitter_AC.svg.png

What is the downside to using thicker wire though, what happens if you use too large a guage? I cant be bothered remembering physics right now but wouldent it affect the charge carrier density, or just draw more current?

GoForSmoke:

syphex: V=IR so an increase in resistance means increase in voltage,

So I can get real high voltage if I put a 10 megohm resistor in my normally 5V line? :P :roll_eyes: :astonished: ]:)

Of course not with a "5V line", but if you have a constant current source, yes! Ohm's Law is actually God's Law (or a law of nature, if you like), discovered/described by Ohm, and it's always true!

If you want to understand or predict what's going to happen under certain conditions, you need to understand the nature of your power source and the nature of your load resistance/impedance. Most power supplies are designed to be "constant voltage" (approximately, within the limits of their design). If you connect a very low resistance to a power supply, you don't get unlimited current. Since Ohm's Law always holds, if you exceed the current available the voltage must drop (and maybe the a fuse blows or the power supply burns-up, etc.).

je veux commander mon CNC avec une arduino uno . j'ai besoin d'un code source (arduino) pour 3 unipolair stepper motor.

DVDdoug:

GoForSmoke:

syphex: V=IR so an increase in resistance means increase in voltage,

So I can get real high voltage if I put a 10 megohm resistor in my normally 5V line? :P :roll_eyes: :astonished: ]:)

Of course not with a "5V line", but if you have a constant current source, yes! Ohm's Law is actually God's Law (or a law of nature, if you like), discovered/described by Ohm, and it's always true!

If you want to understand or predict what's going to happen under certain conditions, you need to understand the nature of your power source and the nature of your load resistance/impedance. Most power supplies are designed to be "constant voltage" (approximately, within the limits of their design). If you connect a very low resistance to a power supply, you don't get unlimited current. Since Ohm's Law always holds, if you exceed the current available the voltage must drop (and maybe the a fuse blows or the power supply burns-up, etc.).

Which is why I don't believe that Ohm's Law which I learned about 1971 is some magic key to controlling voltage.

Sure IF I have a power supply that will give me extra potential then I can get higher voltage up to the limit of the supply but that's not stated by Ohm' Law.

Geez, try to make light of something as a gentle nudge..... let's hear about the difficulty of controlling big turbines like at Niagara Falls while we're at it!

One more time: I was making a joke!

To “THAMER”

Pour écrire en français il y a la partie francophone.
Pour un nouveau sujet on crée un nouveau post.
Pour obtenir plus facilement une réponse c’est mieux de dire “s’il vous plait” et “merci”.

To write in French there is the French-speaking part.
For a new subject you do create a new post.
To have better luck getting an answer it’s better to say “please” and “thank you.”

Welcome to the French-speaking part.

THAMER: je veux commander mon CNC avec une arduino uno . j'ai besoin d'un code source (arduino) pour 3 unipolair stepper motor.

The source code will much depend on parts and connections. But you will do better here: http://forum.arduino.cc/index.php/board,33.0.html

Sorry but Je ne parles Francais... since 1972.

Ohms law is only for linearly approximated relations between V I and R. Its not "gods rule" lol. Ohms law can fail they showed us in engineering.

So I guess the verdict is: Just do it the loss in voltage/current whatever isnt really significant for the relay.

Newton's Laws wouldn't let us have an accurate GPS but they were good enough to not just get to the moon but to send satellites out to the edge of the Solar system using orbital motion slingshots.

I view Ohm's Law as a relation.

from DHT11 tech data sheet;-

high light text is “super long transmission range”

recommend ues 5k for <= 20m transmission range, for >20m adjust R value.
It does not indicate value, but I guess it will be smaller than 5k. OP plan use it at 5m, nothing is needed to do.