User avatar
milkboy007
Posts: 36
Joined: Tue Apr 16, 2013 1:21 pm

what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 2:53 pm

i have been searching around for the longest GPIO-button cable connection (radius & weight), cant find anything about it
does any one know what is the longest (radius & weight) GPIO-button cable connection i can make?


i want to make and intergrated doorbell and help button in my parents house, that will play assigned mp3 tone and push notification (to email and twitter) for every button event.
i want to make it as simple as possible, just Rpi, buttons and cables....
i wold like to avoid unnecessary complexity(like using gpio expander), so it has a single point of failure( the rpi/sdcard), that my parents or the nurse can just replace the rpi or the sdcard by themselves without extra knowledge required, with backup rpi and sdcard, if im not around. (as im often work abroad & AFAIK no one near my parents can diagnose & fix it on site ,without hiring special help which will incur huge labour cost, if it were to break down plus )
i'm guestimating that the wiring topology has around 50m-100m ( for each button) and a total weight of 200-300m (4 buttons).

topology

[RPi]
|-- 50m bed side on GPIO2 BUTTON
|-- 80m toilet side on GPIO17 BUTTON
|---75m bathtub on GPIO4 BUTTON
|---- door on GPIO3 BUTTON

User avatar
hansotten
Posts: 403
Joined: Fri Jul 13, 2012 6:01 am

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 3:10 pm

Without conditioning the signal this is quite long cabling. The voltage drop can be higher than the 3.3V range of the Pi GPIO allows for, very small margins.

Consider things like RS485 serial for reliable connections.

I do wonder if an application like a Help in Need button, life saving like, would not better be served with something supported, reliable and professional?
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with 8 bit CPU's

User avatar
mikronauts
Posts: 2823
Joined: Sat Jan 05, 2013 7:28 pm

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 3:31 pm

Ideally, I'd use a small microcontroller with RS485 back to the Pi, but given your simplicity requirement, I would use a 12V power supply for the button, along with a small opto isolator to interface it to gpio.
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

klricks
Posts: 8557
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 5:02 pm

Google for a [wire voltage drop calculator] and enter the specifications of the wire you plan to use, distance etc. (cat5 is 24ga).
With something like cat5 there are 4 pairs of wires, you can double up the wires to decrease voltage drop if needed.
Take care when routing the cables... To avoid false triggers, do not run them near other mains wiring...... Especially not parallel to or through the same bore holes.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

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

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 5:48 pm

Belkin tells me (http://www.belkin.com/support/dl/A7L504.pdf) that cat-5 cable is about 30Ω per 1000 ft, so about 1Ω per 10m
That means your longest run - 100m - will be about 10Ω
So if you use a 330Ω pull-up resistor (to 3v3), the switch should pull it down to about 0.1v - plenty low enough.

I'd put a capacitor across the GPIO to ground to get rid of as much interference as possible - somewhere above 0.1μF

User avatar
milkboy007
Posts: 36
Joined: Tue Apr 16, 2013 1:21 pm

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 7:09 pm

Burngate wrote:Belkin tells me (http://www.belkin.com/support/dl/A7L504.pdf) that cat-5 cable is about 30Ω per 1000 ft, so about 1Ω per 10m
That means your longest run - 100m - will be about 10Ω
just want to see if anybody knows, what they can handle. if no one knows for sure, i'm planning to test it on 100m Cat6 and Coaxial cable.
hansotten wrote: I do wonder if an application like a Help in Need button, life saving like, would not better be served with something supported, reliable and professional?
my parents still using commercially available (simple) button, it just that they tend to break relatively quick, due to high salty moisture (they live near the shore). so those equipment need to be changed regularly. therefore less reliable and cost effective.i find that many commercially available utility electronics are not design for sea air. and customized design is needed to increase reliability in these situations.
i also want to have a push notification to twitter, so that if the nurse is outside on an errand, they would know and hurry back. i still have not seen any help button with this feature available to date.
in their home there is already an RPi running (for single push button VOIP and automated dog feeder), housed in a dry box, with little reliability issue. i just want the least complex solution to add help button, with existing HW.
mikronauts wrote:Ideally, I'd use a small microcontroller with RS485 back to the Pi, but given your simplicity requirement, I would use a 12V power supply for the button, along with a small opto isolator to interface it to gpio.
good idea, will try before going with uC.

i also have thought about using wifisoc in conjunction with RPi, i would like to know if a simpler design is possible. (KISS)
fyi the distance isnt really 100m its just that, to keep it tidy(def get nagged if i dont), i have to run the cable around the room instead of straight tru

but to keep it simpler does any one know what is the longest gpio cable before signal degrade becoming unusable?

User avatar
karrika
Posts: 1352
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 7:16 pm

My DiscoHAT uses long cables. I have not tested max lengths yet. But they use 5V for the GPIO lines. And optical isolation plus rc circuit for killing spurious signals. Look at http://discohat.com

One DiscoHAT has 8 input cables. I have a few proto boards still left. As you don't need DMX or eeprom I could send you just the pcb plus the parts required for long wires GPIO. Drop me a line if you are interested.
Last edited by karrika on Fri Dec 18, 2015 8:06 pm, edited 1 time in total.

ghp
Posts: 2919
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany

Re: what is the longest GPIO-button cable possible on RPI?

Fri Dec 18, 2015 7:57 pm

There is a good article in
http://www.digikey.com/en/articles/tech ... lectronics
Replace 5V by 3.3V and it applies to RPI.
But generally it is better to avoid problems like interference, spikes and all that sort of things. The approach already proposed with optocouplers is a PLC-type solution which isolates the button circuits from the pi. Use a separate power supply for the button side (with a 12V or 24V supply, wire resistor is almost no problem), and perhaps an additional optocoupler input used to signaling power-button-on to RPi. There are some sketches on the net, e.g. http://www.edn.com/design/analog/442039 ... al-control
Regards,
Gerhard

ame
Posts: 6091
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: what is the longest GPIO-button cable possible on RPI?

Sat Dec 19, 2015 12:10 am

milkboy007 wrote: my parents still using commercially available (simple) button, it just that they tend to break relatively quick, due to high salty moisture (they live near the shore). so those equipment need to be changed regularly. therefore less reliable and cost effective.i find that many commercially available utility electronics are not design for sea air. and customized design is needed to increase reliability in these situations.
Put the button in a ziplock bag?
Hmm. What can I put here?

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

Re: what is the longest GPIO-button cable possible on RPI?

Sat Dec 19, 2015 6:37 pm

milkboy007 wrote:... i'm planning to test it on 100m Cat6 and Coaxial cable.
For a simple on/off signal, I don't think going to Cat-6 is going to help - Cat-6 seems to be Cat-5 modified to be more bulky and harder to terminate ;) Both are designed for high-speed signals, which you aren't using. The same goes for coax, depending on what sort it is (I've run analogue UHF TV over more than 500 metres, but did have to drive the source rather hard if I wanted anything sensible to crawl out the far end)
milkboy007 wrote:my parents still using commercially available (simple) button, it just that they tend to break relatively quick, due to high salty moisture (they live near the shore). so those equipment need to be changed regularly. therefore less reliable and cost effective.i find that many commercially available utility electronics are not design for sea air. and customized design is needed to increase reliability in these situations.
Most door-bell buttons are very cheaply made, bits of bent metal stuck in cheap plastic.
I'd be thinking about a photo-interrupter such as the one Google tells me Pimoroni sells for £2, with the button pushing a flag into the gap. That way, it's totally enclosed so no salt ingress, and you can use one of the spare pairs in the cat-5/6 to drive the LED.

ghp
Posts: 2919
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany

Re: what is the longest GPIO-button cable possible on RPI?

Sat Dec 19, 2015 9:37 pm

Hello,

another point: possibly an inactive==closed button and active==open is useful for an alarm system. When contacts are bad, or wires broken, then this will cause a false alarm. When you use a active==close-button, bad contacts or broken wires will not cause an alarm...
For the cable, a twisted pair will be good enough, supposed you use optocoupler.
Regards,
Gerhard

User avatar
karrika
Posts: 1352
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: what is the longest GPIO-button cable possible on RPI?

Sat Dec 19, 2015 11:54 pm

The reason why modern CAT cables are mainly good for high speed is the way the cables are made today. Some years ago they used copper. Today they use aluminium plated with a very thin layer of copper. High speeds work well with these cables as the high frequencies travel over the copper surface. But if you try to move DC current it will see the aluminium cable as a resistance so you can only pass a small current.
If you dream about Power Over Ethernet try to find full copper cables.

User avatar
Milliways
Posts: 807
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: what is the longest GPIO-button cable possible on RPI?

Mon Dec 21, 2015 7:38 am

Most of the comments you have got are ill-informed. (The suggestion of NC contacts is sensible if reliability is important.)

The GPIO can source/sink 8mA in its standard configuration.
To achieve maximum reliability in this situation use the lowest impedance possible i.e. use a pull-up of 3.3/8 kΩ say 560Ω.
The resistance of any reasonable cable is going to be negligible.

Your most important issue is going to be interference. Use twin or better twisted pair cable. Run EACH pair back to the Pi. Preferable bypass each input with a capacitor. There are other standard techniques you could use, but should not be necessary in a domestic environment.

35-40 years ago I worked with a couple of enthusiasts to build a doorbell based on the SC/MP microprocessor. This was designed to run for >6 months on a 6V battery so ran much lower currents, but mine still works reliably over ~50m using standard telephone cabling.

User avatar
milkboy007
Posts: 36
Joined: Tue Apr 16, 2013 1:21 pm

Re: what is the longest GPIO-button cable possible on RPI?

Tue Dec 22, 2015 7:43 am

so no ones absolutely knows, i guess i have to test and figure it out. :)
Milliways wrote:...... reliability is important.)
]
it is important, but fixability / maintaince is also important. after all im the only (occasional) repair guy
after all, IMO, reliablitily is higher in simpler design than complex one. single point of failure is easier to fix with redundancy.
i would like to avoid complexity IF posible. if not using 433MHZ wireless module is simple too, despite questionable reliablilty.
gotta test it out to find out.
ame wrote: Put the button in a ziplock bag?
hahahaha....... tried that along time ago. it is an unreliable long term solution solution, sometimes even makes things worse (micro holes no one realise, lead to high humidity in the bag)

@gph
sry not interested, its abit and over kill for a single button in multi location thx thou

thx for the inputs guys.

Return to “Interfacing (DSI, CSI, I2C, etc.)”