RichHaynes
Posts: 45
Joined: Sat Jul 16, 2016 12:23 pm
Location: Stoke-On-Trent

GPIO output wire length limits?

Wed Mar 01, 2017 5:00 pm

i wish to use my RPi to remotely switch on/off some lights at the bottom of my garden but I wish to keep the RPi indoors. The lights already have a solar power source but I hate having to get out of bed and walk down the garden in winter having noticed I forgot to switch off the lights :(

is it possible to have the RPi switch a relay thats 90ft from the RPi or will the resistance cause too much of a voltage drop? I have some 24 gauge wire for this but when I think of the GPIO output (3.3V @ 16ma) over 90ft, i cant imagine it will switch the relay :/

ive used an online calculator and it reckons the drop is only 0.007V but I just dont trust it so if anyone can explain the maths or has a good reference I would appreciate it :)

ps, i could possibly have the relay indoors and have the 12V line from solar run to the house and back out to the lights but if the voltage drop is indeed only 0.007V then having the relay at the solar end makes more sense and less work :)

pss, i will eventually dedicate a RPi to controlling my solar set up but for now, I just want to kill the lights from my nice warm bed! :D
Main Computer: RPi3
BOINC Server: RPi2
Torrent Box: RPi2 + 2TB WD Green HDD via USB Dock
Web + Email Server: RPi2
Home Automation Server: RPi2 + Edimax EW-7811Un
Decomissioned: 2 x RPi Model B

User avatar
mikronauts
Posts: 2822
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: GPIO output wire length limits?

Wed Mar 01, 2017 6:02 pm

No, you need to use at least a transistor or a mosfet to switch a higher voltage to drive the relay.

Look at the relays data sheet to determine minimum acceptable (and maximum) coil voltage, and coil current needed.

24ga wire is also a potential issue, I'd use 18ga.

Likely to work: switch 12VDC via MOSFET or UNL2803, use that to control the distant relay.
RichHaynes wrote:i wish to use my RPi to remotely switch on/off some lights at the bottom of my garden but I wish to keep the RPi indoors. The lights already have a solar power source but I hate having to get out of bed and walk down the garden in winter having noticed I forgot to switch off the lights :(

is it possible to have the RPi switch a relay thats 90ft from the RPi or will the resistance cause too much of a voltage drop? I have some 24 gauge wire for this but when I think of the GPIO output (3.3V @ 16ma) over 90ft, i cant imagine it will switch the relay :/

ive used an online calculator and it reckons the drop is only 0.007V but I just dont trust it so if anyone can explain the maths or has a good reference I would appreciate it :)

ps, i could possibly have the relay indoors and have the 12V line from solar run to the house and back out to the lights but if the voltage drop is indeed only 0.007V then having the relay at the solar end makes more sense and less work :)

pss, i will eventually dedicate a RPi to controlling my solar set up but for now, I just want to kill the lights from my nice warm bed! :D
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: GPIO output wire length limits?

Wed Mar 01, 2017 8:43 pm

I agree; my gut reaction is this won't work. That's a long distance for such a small voltage and such thin wire, and volt drop isn't the only consideration here.

However, I would try it and see. If it doesn't work, add an intermediary stage. If you don't want to play with transistors, use another relay at the Pi end to switch a higher voltage, and an adjustable DC-DC converter like this to provide it http://www.ebay.co.uk/itm/LED-LM2596-Vo ... Sw4DJYkNFi. Just adjust the output to set the load-end voltage to whatever it needs to be.
Submarine communication systems engineer and amateur robot enthusiast.

User avatar
aTao
Posts: 1094
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: GPIO output wire length limits?

Wed Mar 01, 2017 9:10 pm

If you really must use wired connection then a current loop is the proper method. The transmitter is a switched current source which will (on signal) output whatever voltage is required to send a set current (20mA is standard)
Other solutions are RF: WiFi, BlueTooth etc, opto or off the shelf network systems.

You must have a fair sized solar panel to make it worth while driving a relay to switch the lights on though....
>)))'><'(((<

User avatar
Burngate
Posts: 6427
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: GPIO output wire length limits?

Thu Mar 02, 2017 10:21 am

Just as a matter of interest, your calculation in your first post might be wrong.
180 ft (90 ft there and back) of 24AWG wire will have resistance of 4.6 ohms, and with 16mA flowing there'll be a drop of 74mV (not 7mV)

But that doesn't take into account such things as contact resistance in any connectors at either end.

And the current may or may not be 16mA - that will depend on what's connected at the other end.
It's possible that the relay you're planning on using will want a separate (5v?) supply and only take a small current on its input.
Or it could be that it requires a lot more than 16mA to switch.

peterlite
Posts: 720
Joined: Sun Apr 17, 2016 4:00 am

Re: GPIO output wire length limits?

Thu Mar 02, 2017 10:48 am

27 metres is a stretch for low cost wireless. A good wireless keypad door relay combo will work over that distance. The switch voltage in the keypad is low. Crack open the keypad. Connect the open and close switches to the Pi through resistors. Connect the 12 volt relay to your solar power if 12 volts. The output of the relay will switch your mains relay.

User avatar
Ronaldlees
Posts: 294
Joined: Sat Apr 16, 2016 4:28 pm
Location: North Carolina, US
Contact: Website

Re: GPIO output wire length limits?

Thu Mar 02, 2017 12:59 pm

aTao wrote:If you really must use wired connection then a current loop is the proper method. The transmitter is a switched current source which will (on signal) output whatever voltage is required to send a set current (20mA is standard)
Other solutions are RF: WiFi, BlueTooth etc, opto or off the shelf network systems.

You must have a fair sized solar panel to make it worth while driving a relay to switch the lights on though....
Agree with that. It's also the cheapest way. So few use it with the Pi GPIO tho.
I am the Umbrella man

RichHaynes
Posts: 45
Joined: Sat Jul 16, 2016 12:23 pm
Location: Stoke-On-Trent

Re: GPIO output wire length limits?

Thu Mar 02, 2017 4:26 pm

Hi all,

Firstly, sorry for the late reply. Secondly, thanks for all your responses!
mikronauts wrote:No, you need to use at least a transistor or a mosfet to switch a higher voltage to drive the relay.

Look at the relays data sheet to determine minimum acceptable (and maximum) coil voltage, and coil current needed.

24ga wire is also a potential issue, I'd use 18ga.

Likely to work: switch 12VDC via MOSFET or UNL2803, use that to control the distant relay.
Moe wrote:I agree; my gut reaction is this won't work. That's a long distance for such a small voltage and such thin wire, and volt drop isn't the only consideration here.

However, I would try it and see. If it doesn't work, add an intermediary stage. If you don't want to play with transistors, use another relay at the Pi end to switch a higher voltage, and an adjustable DC-DC converter like this to provide it. Just adjust the output to set the load-end voltage to whatever it needs to be.
My gut was it wont work either :(

I have a few TIP120G's hanging around from an LED project which I could use but that would require a second power supply for the 12V so I was trying to avoid that (aka cheat!).

The 24 gauge wire was what I have hanging around that is in one run. I have other gauges but that would involve soldering them together and I dont want the added resistance / failure points. Its also got to fit in some buried pipe thats 10mm wide and already has flex in at 7.5mm, hence the avoidance of running the 12V supply to the house and back again as i couldnt get two more lengths of flex in the pipe (this one is avoiding cost of laying more pipe or laziness if you want to go with that :) ).
Burngate wrote:Just as a matter of interest, your calculation in your first post might be wrong.
180 ft (90 ft there and back) of 24AWG wire will have resistance of 4.6 ohms, and with 16mA flowing there'll be a drop of 74mV (not 7mV)

But that doesn't take into account such things as contact resistance in any connectors at either end.

And the current may or may not be 16mA - that will depend on what's connected at the other end.
It's possible that the relay you're planning on using will want a separate (5v?) supply and only take a small current on its input. Or it could be that it requires a lot more than 16mA to switch.
The calculation was from an online calculator as I dont know how to calculate it myself yet (if anyone knows the formula then please let me know :) ). For clarity, I only need a single GPIO signal to the relay to switch it. The power for the relay itself is provided by the solar system using a buck converter (12 to 5). Lengths were never an issue when I set up my solar system as the voltages and currents involved made voltage drop negligible. The RPi low voltage and current and shear length makes it more of an issue to consider.

The 16mA is more than enough to switch the relay. Ive used it on the RPi already to switch a mains bulb on and off remotely. I cant be certain it was 16mA provided by the RPi but thats the only info I can gather about the GPIO power output. I just need to increase the objects separation from 90cm to 90ft and it will work fine and dandy.

Someone mentioned using wireless. If I was to go down this route I would put the RPi in the box with the solar charger and batteries as its waterproof. I already have a 5V supply in there to power the RPi and relay but from my test with my Galaxy S7, the box blocks the wifi reception. Im almost sure the wifi chip in the S7 is more powerful than my Edimax EW-7811Un so that rules out wifi and bluetooth options.

I will wire it up above ground and let you all know if it switches. Thanks again for your responses. Its always food for thought :)
Main Computer: RPi3
BOINC Server: RPi2
Torrent Box: RPi2 + 2TB WD Green HDD via USB Dock
Web + Email Server: RPi2
Home Automation Server: RPi2 + Edimax EW-7811Un
Decomissioned: 2 x RPi Model B

User avatar
Burngate
Posts: 6427
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: GPIO output wire length limits?

Thu Mar 02, 2017 5:09 pm

RichHaynes wrote:The calculation was from an online calculator as I don't know how to calculate it myself yet (if anyone knows the formula then please let me know :) ). For clarity, I only need a single GPIO signal to the relay to switch it. The power for the relay itself is provided by the solar system using a buck converter (12 to 5). Lengths were never an issue when I set up my solar system as the voltages and currents involved made voltage drop negligible. The RPi low voltage and current and sheer length makes it more of an issue to consider.

The 16mA is more than enough to switch the relay. I've used it on the RPi already to switch a mains bulb on and off remotely. I can't be certain it was 16mA provided by the RPi but thats the only info I can gather about the GPIO power output. I just need to increase the object's separation from 90cm to 90ft and it will work fine and dandy.
Wikipedia has a page about American Wire Gauge, with a table that has a column "mΩ/m" (it also has right next to that "mΩ/ft". No idea why I didn't use that)
It says 84.22 mΩ/m for 24AWG
So I converted your 90ft into metres and got 27.432m, doubled that to 54.864m because the signal has to come back as well as go, then multiplied that by 84.22mΩ/mto get 4.6Ω near as dammit.
Using the mΩ/ft figure of 25.67 also gives 4.6Ω, with a quarter of the work

Ohm's law says current times resistance equals voltage, so 16 * 4.6 = 73.6 mV or 0.0736V

The 16mA figure for a GPIO is just the maximum you should draw. Less would be fine, and assuming the relay has some drive circuitry built in, it probably draws far less, maybe 3 or 4 mA.
Also worth noting: a lot of the problems people have with GPIOs over long distances is to do with high frequencies and RF pick-up.
I don't think driving a relay falls into that class. The only problem you might get is pickup from the close-by flex depending on what it's carrying, but I doubt you'll have a problem.

RichHaynes
Posts: 45
Joined: Sat Jul 16, 2016 12:23 pm
Location: Stoke-On-Trent

Re: GPIO output wire length limits?

Thu Mar 02, 2017 6:42 pm

Burngate wrote:Wikipedia has a page about American Wire Gauge, with a table that has a column "mΩ/m" (it also has right next to that "mΩ/ft". No idea why I didn't use that)
It says 84.22 mΩ/m for 24AWG
So I converted your 90ft into metres and got 27.432m, doubled that to 54.864m because the signal has to come back as well as go, then multiplied that by 84.22mΩ/mto get 4.6Ω near as dammit.
Using the mΩ/ft figure of 25.67 also gives 4.6Ω, with a quarter of the work

Ohm's law says current times resistance equals voltage, so 16 * 4.6 = 73.6 mV or 0.0736V

The 16mA figure for a GPIO is just the maximum you should draw. Less would be fine, and assuming the relay has some drive circuitry built in, it probably draws far less, maybe 3 or 4 mA.
Also worth noting: a lot of the problems people have with GPIOs over long distances is to do with high frequencies and RF pick-up.
I don't think driving a relay falls into that class. The only problem you might get is pickup from the close-by flex depending on what it's carrying, but I doubt you'll have a problem.
Found a better calculator with formulas! http://www.rapidtables.com/calc/wire/vo ... lculations :D Your drop is correct. I might have accidentally, mistakenly, stupidly used 0.0016 instead of 0.016 :/

My relay is a Songle SRD-05VDC-SL-C. Someone mentioned coil data earlier so here it is from the 'coil data chart': 3VDC 120mA; 5VDC 71.4mA; 12VDC 30mA. Im not sure this is relevant though as like you said, it does have the extra circuitry to make it simple to use with the RPi. It has pins for 5V, GND & SIG and screw clamps for the NO and NC and to top it off, ive made a demo circuit to make sure I knew the basics before considering any of this. However, the concern always has and always will be the wire length.

Talking about food for thought, I never even considered interference! And I should know better since that's the reason audio and power leads run on opposites sides of the car! It will be running up the pipe alongside an AC power supply but this finishes half way up. Im not entirely sure how much effect this will have if any.

ps, for those wondering, the AC supply is for a pond pump. The intention is to get a more powerful inverter in the solar setup to supply the pond pump and an additional relay will allow me to control this remotely too ;) Im basically trying to get everything thats outside running off solar and then use an RPi to remotely switch everything off outside without going in the rain / snow / wind. It also isolates any faults from the house electrics.

pss, I really should have added this is a temporary solution until I can get a reliable wifi connection to move the RPi alongside the solar setup. It definitely wont work in the waterproof box and if I put it in the shed, it will suffer extreme cold and heat so I want it in the house for time being.
Main Computer: RPi3
BOINC Server: RPi2
Torrent Box: RPi2 + 2TB WD Green HDD via USB Dock
Web + Email Server: RPi2
Home Automation Server: RPi2 + Edimax EW-7811Un
Decomissioned: 2 x RPi Model B

User avatar
mikronauts
Posts: 2822
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: GPIO output wire length limits?

Thu Mar 02, 2017 7:13 pm

Hmmm... with short cable RPI GPIO can supply a maximum of 16mA on a pin.

The relay needs 3VDC 120mA (I am the one who mentioned coil current/voltage)

Probably a pretty decent way to fry a GPIO pin (if the relay board does not have an opto isolator).

Now if the relay board has an opto isolator on it, it *may* work, depending on the current limiting resistor used for the opto isolators LED. Or you can change that resistor to make it work.

Regarding noise, you can always add a filter capacitor, as the relay will not exactly be switched at high frequencies.
RichHaynes wrote: My relay is a Songle SRD-05VDC-SL-C. Someone mentioned coil data earlier so here it is from the 'coil data chart': 3VDC 120mA; 5VDC 71.4mA; 12VDC 30mA. Im not sure this is relevant though as like you said, it does have the extra circuitry to make it simple to use with the RPi. It has pins for 5V, GND & SIG and screw clamps for the NO and NC and to top it off, ive made a demo circuit to make sure I knew the basics before considering any of this. However, the concern always has and always will be the wire length.

Talking about food for thought, I never even considered interference! And I should know better since that's the reason audio and power leads run on opposites sides of the car! It will be running up the pipe alongside an AC power supply but this finishes half way up. Im not entirely sure how much effect this will have if any.

ps, for those wondering, the AC supply is for a pond pump. The intention is to get a more powerful inverter in the solar setup to supply the pond pump and an additional relay will allow me to control this remotely too ;) Im basically trying to get everything thats outside running off solar and then use an RPi to remotely switch everything off outside without going in the rain / snow / wind. It also isolates any faults from the house electrics.

pss, I really should have added this is a temporary solution until I can get a reliable wifi connection to move the RPi alongside the solar setup. It definitely wont work in the waterproof box and if I put it in the shed, it will suffer extreme cold and heat so I want it in the house for time being.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: GPIO output wire length limits?

Thu Mar 02, 2017 10:27 pm

You've got a DC signal so RF pickup shouldn't be a problem unless you live next to an airport.

Mains on the other hand is a large, high-current, slowly varying signal that will induce false currents in your signal cable. This will manifest as a floating voltage at the far end of the cable. Now, in theory this shouldn't matter if the send and return wires are in close proximity, because they will be affected equally and the relay only cares about the difference between them (known as common mode rejection).

BUT - the relay module will use the same 0V for the supply and the control signal. And you're powering the relay from a separate supply at the far end, and therefore must have the signal and supply grounds connected, creating a ground loop, so your ground and signal can vary with respect to each other. The fix is to power the relay from the near-end house supply, use three wires, and don't connect the relay's ground to the far-end supply ground.

The other EMC risk is switching transients caused by the pump switching on and off. A big capacitor across and/or resistor inline with the signal wire might help, but you probably don't care since the worst that can happen here is the lights turn or or off briefly when the pump switches.

So, basically, like I said, try it and see.
Submarine communication systems engineer and amateur robot enthusiast.

User avatar
Burngate
Posts: 6427
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: GPIO output wire length limits?

Fri Mar 03, 2017 11:16 am

I'm going to go off at a tangent, here, which may annoy some ...
RichHaynes wrote:... Its also got to fit in some buried pipe thats 10mm wide and already has flex in at 7.5mm, ...
As a matter of interest, how are you going to get the wire down the 90ft of pipe?
You've probably already thought about it, and left a string in the pipe for this very purpose, but it's an interesting problem

To get cables across to the Queen Victoria Memorial in the Mall, we used a ferret.
But I don't think a ferret would fit through a 10mm pipe

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: GPIO output wire length limits?

Fri Mar 03, 2017 11:56 am

Burngate wrote:To get cables across to the Queen Victoria Memorial in the Mall, we used a ferret.
But I don't think a ferret would fit through a 10mm pipe
Time to train a cockroach?

I looked into this a while ago. I could find no relays of any type that could be used directly on the GPIO. With 5V logic you can do it with a small reed relay, but not 3.3V.

So you need some hardware between the Pi and the relay, and the best place is next to the Pi. That way all your long wiring is isolated from the delicate electronics. I wouldn't worry too much about the voltage drop, since 0.1V isn't high. But I would worry about interference and lightning spikes. Logic signals are low current, so they can be interfered with easily. That can cause higher voltages than you want the Pi to be exposed to. That becomes much worse if there's a lightning strike within a mile or two.

The easiest way to do this is probably two relays. Use an off-the-shelf relay board at the Pi end switching 24V to drive a relay at the other end. High voltage makes low current, which reduces voltage drop but there's a path for interference and spikes to be drained away through the 24V power supply. And if the worst happens, relays are cheap and neither the Pi nor your lights are in the circuit.

User avatar
aTao
Posts: 1094
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: GPIO output wire length limits?

Fri Mar 03, 2017 5:38 pm

Burngate wrote:I'm going to go off at a tangent, here, which may annoy some ...
RichHaynes wrote:... Its also got to fit in some buried pipe thats 10mm wide and already has flex in at 7.5mm, ...
As a matter of interest, how are you going to get the wire down the 90ft of pipe?
You've probably already thought about it, and left a string in the pipe for this very purpose, but it's an interesting problem

To get cables across to the Queen Victoria Memorial in the Mall, we used a ferret.
But I don't think a ferret would fit through a 10mm pipe

90', fish tape, no probs.
>)))'><'(((<

RichHaynes
Posts: 45
Joined: Sat Jul 16, 2016 12:23 pm
Location: Stoke-On-Trent

Re: GPIO output wire length limits?

Mon Mar 06, 2017 4:51 pm

mikronauts wrote:Hmmm... with short cable RPI GPIO can supply a maximum of 16mA on a pin.

The relay needs 3VDC 120mA (I am the one who mentioned coil current/voltage)

Probably a pretty decent way to fry a GPIO pin (if the relay board does not have an opto isolator).

Now if the relay board has an opto isolator on it, it *may* work, depending on the current limiting resistor used for the opto isolators LED. Or you can change that resistor to make it work.
I really should add that its not JUST the relay I have. Its this board: http://www.ebay.co.uk/itm/5V-1-2-4-8-Ch ... 2051910091. Dont ask me the other components on the board as I cant be certain what they are. All I will say is that it works perfectly fine when using directly on the RPi i.e. 5V and GND and switch signal all from the RPi.
Moe wrote:BUT - the relay module will use the same 0V for the supply and the control signal. And you're powering the relay from a separate supply at the far end, and therefore must have the signal and supply grounds connected, creating a ground loop, so your ground and signal can vary with respect to each other. The fix is to power the relay from the near-end house supply, use three wires, and don't connect the relay's ground to the far-end supply ground.
I wired it up at the weekend just running the 90ft of 24 gauge up and down the stairs and the relay did switch! But the RPi restarted :/ Could this be down to a lack of common ground? Or am I just frying it? I used my multimeter to try get some readings but then nothing happened and the readings were zero. When I use the RPi to switch a TIP120G on my LED strip light project, I dont have the signal routing to ground unless its grounding inside the transistors electronics?
Burngate wrote:As a matter of interest, how are you going to get the wire down the 90ft of pipe?
Cable rods :) The pipe has junction boxes at 20 & 40 & 60 & 80 ft intervals so I can push it through in stages. So no cockroaches or ferrets :( I have this one myself http://www.screwfix.com/p/cable-access-kit-10m/82483 but as its 8mm I will have to remove the pond pump cable and then pull that AND the signal cable through at same time.

From all the feedback I am considering dropping this option for now and look at getting a second RPi (safely) at the bottom of the garden. That way the power and signal can all come from the RPi itself and through a measly 1ft cable :) I already have USB sockets from the solar system its just making sure the RPi can survive the hot or cold, dry or damp conditions in my shed :/ If anyone has any advice on that it would be much appreciated :)
Main Computer: RPi3
BOINC Server: RPi2
Torrent Box: RPi2 + 2TB WD Green HDD via USB Dock
Web + Email Server: RPi2
Home Automation Server: RPi2 + Edimax EW-7811Un
Decomissioned: 2 x RPi Model B

User avatar
mikronauts
Posts: 2822
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: GPIO output wire length limits?

Mon Mar 06, 2017 5:06 pm

RichHaynes wrote:
mikronauts wrote:Hmmm... with short cable RPI GPIO can supply a maximum of 16mA on a pin.

The relay needs 3VDC 120mA (I am the one who mentioned coil current/voltage)

Probably a pretty decent way to fry a GPIO pin (if the relay board does not have an opto isolator).

Now if the relay board has an opto isolator on it, it *may* work, depending on the current limiting resistor used for the opto isolators LED. Or you can change that resistor to make it work.
I really should add that its not JUST the relay I have. Its this board: http://www.ebay.co.uk/itm/5V-1-2-4-8-Ch ... 2051910091. Dont ask me the other components on the board as I cant be certain what they are. All I will say is that it works perfectly fine when using directly on the RPi i.e. 5V and GND and switch signal all from the RPi.
That has opto isolators on it, which is why it is working with the 3v3 output from the Pi when the Pi is close to the relays.
RichHaynes wrote: I wired it up at the weekend just running the 90ft of 24 gauge up and down the stairs and the relay did switch! But the RPi restarted :/ Could this be down to a lack of common ground? Or am I just frying it? I used my multimeter to try get some readings but then nothing happened and the readings were zero. When I use the RPi to switch a TIP120G on my LED strip light project, I dont have the signal routing to ground unless its grounding inside the transistors electronics?
1) if you are also sending the 5V from the Pi to the relay board, after the cable, it would draw too much power from the Pi, lowering 5V below the brown out threshold, thus rebooting

2) if you have an independent 5V, then due to the long cable, the opto isolators LED was trying to draw too much power through the SOC's GPIO pin, again causing a brownout and thus a reboot.
RichHaynes wrote: From all the feedback I am considering dropping this option for now and look at getting a second RPi (safely) at the bottom of the garden. That way the power and signal can all come from the RPi itself and through a measly 1ft cable :) I already have USB sockets from the solar system its just making sure the RPi can survive the hot or cold, dry or damp conditions in my shed :/ If anyone has any advice on that it would be much appreciated :)
MUCH better idea.

Get a waterproof enclosure, and caulk the power lead input - use a low power Pi (A/A+/Zero) so you won't overheat, you can use WiFi back to the house.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

RichHaynes
Posts: 45
Joined: Sat Jul 16, 2016 12:23 pm
Location: Stoke-On-Trent

Re: GPIO output wire length limits?

Tue Mar 14, 2017 11:32 am

mikronauts wrote:
RichHaynes wrote: From all the feedback I am considering dropping this option for now and look at getting a second RPi (safely) at the bottom of the garden. That way the power and signal can all come from the RPi itself and through a measly 1ft cable :) I already have USB sockets from the solar system its just making sure the RPi can survive the hot or cold, dry or damp conditions in my shed :/ If anyone has any advice on that it would be much appreciated :)
MUCH better idea.

Get a waterproof enclosure, and caulk the power lead input - use a low power Pi (A/A+/Zero) so you won't overheat, you can use WiFi back to the house.
Hi mikronauts,

Sorry for the delayed response. I've been busy reorganising my RPi's. I usually go for separation of services (web, email, torrent, boinc) but I've decided to amalgamate some of them to free up my two aging RPi Model B's. It is one of theses which I will use at the bottom of the garden once I've sorted out the networking. The other I might add a camera to and use as CCTV in the garage!

Thanks to you and everyone elses input. Its been invaluable! :)
Main Computer: RPi3
BOINC Server: RPi2
Torrent Box: RPi2 + 2TB WD Green HDD via USB Dock
Web + Email Server: RPi2
Home Automation Server: RPi2 + Edimax EW-7811Un
Decomissioned: 2 x RPi Model B

jesperscott
Posts: 3
Joined: Wed Jan 18, 2017 2:00 pm

Re: GPIO output wire length limits?

Sat Sep 09, 2017 11:31 am

Just as a matter of interest, your calculation in your first post might be wrong. 180 ft (90 ft there and back) of 24AWG wire will have resistance of 4.6 ohms, and with 16mA flowing there'll be a drop of 74mV (not 7mV)The calculation was from an online calculator .

http://www.calculatorology.com/voltage-drop-calculator/ .

Return to “Automation, sensing and robotics”