What's the max distance which I can connect a led to an Arduino io pin?
this depends on the wire you are using. (specificly the resistiance of the wire)
You can either measure the resistance of your wire you'll be using or use a wire-calculator (google).
I'll look at the wire calculators tools.
The wire resistance actualy depends on the wire width, doesn't it? So in fact I have to calc the wire resistance based on the distance that I want to put the led, and see if the resistence is acceptable... Is it right? If so, how can I assert it?
Sorry for such dumb questions, I have little knowledge on eletrics
How far do you plan to extend wiring? Several meters for leds 20 mA isn't a distance, don't worry
About 70 mts, at most... Is it OK?
Beside leds, I'd have to trigger relays (through a transistor, I supose) and receive input from reed switches
If you will use CAT5, they say 0.188 Ohm / m: http://en.wikipedia.org/wiki/Category_5_cable do your homework with Ohm law. What about relay, how much current its need? You probably can connect a couple twisted pair in parallel
If using cat5 I'll get a resistence of .188/m, I would get a total of 13.16ohms for my 70mts cable
The ohm's law Magician mentioned states that V = R * I, but I didn't understand how to apply it here
Regarding the relays, I didn't know it, but the relays should drive elements like 127v lamps
V = R * I, but I didn't understand how to apply it here
I'm afraid, you are not qualified to do a job... Find a contractor ]:D
Well, I never pretended to be skilled in eletrics... Just tryin' to learn
If you could post what you are trying to do, it would be better to give you ideas regarding this!!
Welcome to the world of electronics! If you want to hope to go anywhere, you [u]have to[/u] do your homework and right off the bat, that means understanding Ohm's Law. Fortunately, there's lots of sites that explain it very well. Make Magazine has an awesome series of videos on beginning electronics http://www.youtube.com/watch?v=-mHLvtGjum4.
For your particular problem:
You want around 20 mA to light up your LED. The question is, will 70 m of cat5 cable give you that much current? Your 70 m cat5 cable has a total resistance of 13.16 ? So, using Ohm's law V=IR and rearranging to solve for current (I=V/R) and knowing that an arduino will output 5V we see that: I=V/R -> I=5/13.16 = 0.38 A or 380 mA. WOW! 380 mA?? That's definitely wayy more than required so we're good to go right? Yes. BUT WAIT!! Your arduino can source (supply) only up to 40 mA. Still, that's more than the 20 mA needed so you're fine.
So what's up with the 380 mA then? That's the theoretical current that you will get if your power supply had no current limitation (a power supply rated for 1 A will give you the 380 mA. One rated for 10 mA will not).
So if you had a 1 A supply directly driving an LED with a resistance of 13.6 Ohms will you have a current of 380 mA? Not likely. LEDs have a certain resistance also but that's a story for another day.
Hope this helps...
It will work. Try it. 13 ohms is neglible compared the the usual limiting resistors. If you want lower the limiting resistor to the next available value in order to get a good brightness.
Why don't you just try it? :)
Felix, it's actually two projects.
One will receive input from N reed-switches do know about door openning and will notify a software of mine running on a pc
The other is to enable/disable specific eletric elements (lamps, etc) based on commands received from another software. It should also enable/disable leds acordingly.
On both cases, the leds/relays/reeds might be located near the arduino board, or as long as 70mts
superKittens, thanks for the explanatino.. I'll watch the video later today. So, according to the explanation, with 70mts of cat5 I could theoriticaly use anything that takes up to 380ma (provided the source can supply 380ma or more)... Right?
bibre, I'll probably try it today!
Thanks everyone for the help
That's right. Suppose you had something that needed 400 mA to run, then you wouldn't be able to have much luck because that wire length has too high of an impedance to let that "thing" operate properly.
That 380ma would be with a 5V voltage drop in the wire, your device at the end would get 0V. That is assuming it acted as a dead short. you use ohms law to calculate voltage drop in the wire. V=IR, in this case you treat the LED(with its current limiting resistor) at the end as the load so:
20ma * 13ohm= 260mv so you would have 5V-.26V=4.74 V at the end, plenty.
Lest look at another example, say you have a relay that needs 4V @ 100ma to pull in: 100ma * 13ohm= 1.3V so 5V-1.3V= 3.7V, your relay will not work reliably.
Also keep in mind "5V" can mean anything from 4.5V to 5.5V depending on the tolerances and requirements of the components involved.
That 380ma would be with a 5V voltage drop in the wire, your device at the end would get 0V. That is assuming it acted as a dead short.
D’oh! Yes absolutely! Thanks for pointing that out tjbaudio. In a perfect world a forward biased LED would happily be a dead short and I would be indulging myself under a chocolate waterfall in candy mountain.