Connect with us

How far can a gpio from a mc can be used

Discussion in 'Microcontrollers, Programming and IoT' started by dashy1981, Feb 4, 2021.

Scroll to continue with content
  1. dashy1981

    dashy1981

    46
    1
    Jun 19, 2013
    HiI always wondered how far a microcontroller's gpio output signal can be used without loss.

    Question comes from the fact that I have always used them to switch on /off relays or interface with sensors very near to the micro. But in case the sensor lies much far away say 50 mtrs... How will this configuration work ?

    Cheers
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,999
    2,502
    Nov 17, 2011
    There's no hard limit. Reliably 1 m or so, maybe 3 m - the longer the distance, the less reliable the signal. Plus the sensitivity of the line for electromagnetic noise rises with every cm of length. Therefore long lines shall be shielded.
    A better technique is to place the relay driver transistors near the mcu and feed the comparatively insensitive power lines to the relay across the long distance. The driver transistors will decouple the long line from the mcu pins and therefore add protection against electromagnetic noise to the mcu.

    In general one would not use logic level signals for long distances. There exist communication protocols like e.g. RS-232 or RS-485 for these purposes. These protocols use dedicated drivers and receivers and optimized voltage levels to provide stable communication over long distances.
     
    dashy1981 likes this.
  3. danadak

    danadak

    3
    1
    Feb 19, 2021
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,999
    2,502
    Nov 17, 2011
    Right, but that's no longer simply a long wire on an mcu's gpio. With the right kind of interface a GPIO can go around the world, but the interface complexity increases with distance.
     
  5. danadak

    danadak

    3
    1
    Feb 19, 2021
    Of course there is always UTP and STP (Unshielded Twisted Pair and Shielded TP) to make longer
    un signal conditioned runs. common mode noise, IR drop, C load considerations.... some of the
    limitations. You have a unidirectional control signal, so reflections not an issue other than protecting
    output with external diode clamps. One can think of really low data rates and use of TP. TP noise
    rejection, from noise environment, would be issue. I cannot seem to find any study on this, so far....

    There is a lot of C involved in TP....

    Does the application involve safety ? If it does I would reach for physical layer parts, transceivers,
    and use a protocol.

    https://en.wikipedia.org/wiki/Twisted_pair#:~:text=Common-mode rejection starts to,be unable to eliminate it.

    Possibly experiment with spice simulation for starters, maybe contact a cable tech
    department (like Belden) to see if they have any background on unconditioned transmission.

    https://www.pspice.com/sites/default/files/Transmission_line_Applications_in_PSpice.pdf


    Regards, Dana.
     
    Last edited: Feb 24, 2021 at 12:40 PM
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-