Interfacing a button to a microcontroller (and PC) with a 50 m long cable The Next CEO of Stack OverflowIsolating motor control signals from microcontroller from high voltage/current linesNeed help with 90vdc PM motor speed control circuitSimple light bulb operated by button and optoisolator triacDesigning an ethernet isolatorWhich isolated ground should I use for an RF can/shield over an optically-isolating component?Interfacing open-collector optoisolator to 3.3V microcontrollerCombining dirty 12V inputs with delicate micro controllerInterfacing retriggerable oneshot with optocouplerlogic level conversions for opto-isolators in digital input acquisitionWhy use opto-isolation in this way?

Reference request: Grassmannian and Plucker coordinates in type B, C, D

how one can write a nice vector parser, something that does pgfvecparseA=B-C; D=E x F;

What happened in Rome, when the western empire "fell"?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Can you teleport closer to a creature you are Frightened of?

Yu-Gi-Oh cards in Python 3

What flight has the highest ratio of timezone difference to flight time?

Which one is the true statement?

Spaces in which all closed sets are regular closed

Is fine stranded wire ok for main supply line?

Is French Guiana a (hard) EU border?

Computationally populating tables with probability data

Can this note be analyzed as a non-chord tone?

Won the lottery - how do I keep the money?

How do I fit a non linear curve?

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Is it okay to majorly distort historical facts while writing a fiction story?

What CSS properties can the br tag have?

What steps are necessary to read a Modern SSD in Medieval Europe?

Lucky Feat: How can "more than one creature spend a luck point to influence the outcome of a roll"?

Airplane gently rocking its wings during whole flight

What does "shotgun unity" refer to here in this sentence?

Does higher Oxidation/ reduction potential translate to higher energy storage in battery?

How to find image of a complex function with given constraints?



Interfacing a button to a microcontroller (and PC) with a 50 m long cable



The Next CEO of Stack OverflowIsolating motor control signals from microcontroller from high voltage/current linesNeed help with 90vdc PM motor speed control circuitSimple light bulb operated by button and optoisolator triacDesigning an ethernet isolatorWhich isolated ground should I use for an RF can/shield over an optically-isolating component?Interfacing open-collector optoisolator to 3.3V microcontrollerCombining dirty 12V inputs with delicate micro controllerInterfacing retriggerable oneshot with optocouplerlogic level conversions for opto-isolators in digital input acquisitionWhy use opto-isolation in this way?










6












$begingroup$


I am designing a board that will be plugged into a computer and will read the status of a button ~50 m away in an office environment (it's actually a lot closer, but the cable is long).



I think it's a good idea to galvanically isolate the button wiring from the computer, since the PC will be grounded. I don't want any faults on the wiring to be able to damage the computer.



I'm assuming less than 100 ohm resistance for the cable, and while a simple series resistor would work, I think having a constant current sink for the opto LED is safer (i.e. if the cable has to be a lot longer, or shorter, etc.).



Is this a sensible approach to it? Cost/space is not much an issue, so I could add some protection/filtering circuitry, but I'm not entirely sure where/how to do it, so I'd be happy to hear some suggestions.





schematic





simulate this circuit – Schematic created using CircuitLab










share|improve this question











$endgroup$
















    6












    $begingroup$


    I am designing a board that will be plugged into a computer and will read the status of a button ~50 m away in an office environment (it's actually a lot closer, but the cable is long).



    I think it's a good idea to galvanically isolate the button wiring from the computer, since the PC will be grounded. I don't want any faults on the wiring to be able to damage the computer.



    I'm assuming less than 100 ohm resistance for the cable, and while a simple series resistor would work, I think having a constant current sink for the opto LED is safer (i.e. if the cable has to be a lot longer, or shorter, etc.).



    Is this a sensible approach to it? Cost/space is not much an issue, so I could add some protection/filtering circuitry, but I'm not entirely sure where/how to do it, so I'd be happy to hear some suggestions.





    schematic





    simulate this circuit – Schematic created using CircuitLab










    share|improve this question











    $endgroup$














      6












      6








      6


      2



      $begingroup$


      I am designing a board that will be plugged into a computer and will read the status of a button ~50 m away in an office environment (it's actually a lot closer, but the cable is long).



      I think it's a good idea to galvanically isolate the button wiring from the computer, since the PC will be grounded. I don't want any faults on the wiring to be able to damage the computer.



      I'm assuming less than 100 ohm resistance for the cable, and while a simple series resistor would work, I think having a constant current sink for the opto LED is safer (i.e. if the cable has to be a lot longer, or shorter, etc.).



      Is this a sensible approach to it? Cost/space is not much an issue, so I could add some protection/filtering circuitry, but I'm not entirely sure where/how to do it, so I'd be happy to hear some suggestions.





      schematic





      simulate this circuit – Schematic created using CircuitLab










      share|improve this question











      $endgroup$




      I am designing a board that will be plugged into a computer and will read the status of a button ~50 m away in an office environment (it's actually a lot closer, but the cable is long).



      I think it's a good idea to galvanically isolate the button wiring from the computer, since the PC will be grounded. I don't want any faults on the wiring to be able to damage the computer.



      I'm assuming less than 100 ohm resistance for the cable, and while a simple series resistor would work, I think having a constant current sink for the opto LED is safer (i.e. if the cable has to be a lot longer, or shorter, etc.).



      Is this a sensible approach to it? Cost/space is not much an issue, so I could add some protection/filtering circuitry, but I'm not entirely sure where/how to do it, so I'd be happy to hear some suggestions.





      schematic





      simulate this circuit – Schematic created using CircuitLab







      opto-isolator isolation circuit-protection






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday









      Peter Mortensen

      1,60031422




      1,60031422










      asked 2 days ago









      Wesley LeeWesley Lee

      5,81152242




      5,81152242




















          4 Answers
          4






          active

          oldest

          votes


















          8












          $begingroup$

          Looks like too much circuitry, which leads to more cost, complexity, failures. There is nothing in the question that indicates anything more than series resistors are required. Adding components, like isolated switching power supplies, adds components with much higher failure rates than a few resistors and diodes. The circuit below is well protected, simple, reliable, and goes high/low when switch is closed/open. There would need to be a specific, compelling reason to add all that circuitry in the question.





          schematic





          simulate this circuit – Schematic created using CircuitLab






          share|improve this answer









          $endgroup$








          • 2




            $begingroup$
            Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
            $endgroup$
            – Wesley Lee
            2 days ago






          • 1




            $begingroup$
            You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
            $endgroup$
            – scorpdaddy
            2 days ago


















          6












          $begingroup$

          That looks fine to me, but you may wish to put a diode across the optoisolator LED in case you get some ringing in the choke or wiring.



          The two transistor current sink might be slightly better and maybe 100K is a bit on the high side for the resistor. Eg,





          schematic





          simulate this circuit – Schematic created using CircuitLab



          You could also flip the current limiter and put it on the other rail. Right now the opto sees a lot of common mode voltage change when the switch is pressed. Grounding the photodiode would reduce that because of the coupling capacitance of the DC-DC.






          share|improve this answer











          $endgroup$








          • 1




            $begingroup$
            And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
            $endgroup$
            – Wesley Lee
            2 days ago



















          4












          $begingroup$

          A simpler way would be to use a shielded cable (to shunt noise and ESD away), and then protect the microcontroller inputs with diodes to VCC and ground.



          The resistance of the cable is most likely to be between 1 or 10 ohms (as long as the AWG is more than 30 gauge).






          share|improve this answer











          $endgroup$




















            1












            $begingroup$

            I would make a current loop. Simple, cheap and reliable. You can connect the transistor in a common collector configuration if you want a non-inverted output. The optocoupler LED must be rated for at least 20 mA.



            enter image description here






            share|improve this answer











            $endgroup$













              Your Answer





              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("mathjaxEditing", function ()
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
              );
              );
              , "mathjax-editing");

              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("schematics", function ()
              StackExchange.schematics.init();
              );
              , "cicuitlab");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "135"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f429700%2finterfacing-a-button-to-a-microcontroller-and-pc-with-a-50-m-long-cable%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              8












              $begingroup$

              Looks like too much circuitry, which leads to more cost, complexity, failures. There is nothing in the question that indicates anything more than series resistors are required. Adding components, like isolated switching power supplies, adds components with much higher failure rates than a few resistors and diodes. The circuit below is well protected, simple, reliable, and goes high/low when switch is closed/open. There would need to be a specific, compelling reason to add all that circuitry in the question.





              schematic





              simulate this circuit – Schematic created using CircuitLab






              share|improve this answer









              $endgroup$








              • 2




                $begingroup$
                Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
                $endgroup$
                – Wesley Lee
                2 days ago






              • 1




                $begingroup$
                You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
                $endgroup$
                – scorpdaddy
                2 days ago















              8












              $begingroup$

              Looks like too much circuitry, which leads to more cost, complexity, failures. There is nothing in the question that indicates anything more than series resistors are required. Adding components, like isolated switching power supplies, adds components with much higher failure rates than a few resistors and diodes. The circuit below is well protected, simple, reliable, and goes high/low when switch is closed/open. There would need to be a specific, compelling reason to add all that circuitry in the question.





              schematic





              simulate this circuit – Schematic created using CircuitLab






              share|improve this answer









              $endgroup$








              • 2




                $begingroup$
                Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
                $endgroup$
                – Wesley Lee
                2 days ago






              • 1




                $begingroup$
                You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
                $endgroup$
                – scorpdaddy
                2 days ago













              8












              8








              8





              $begingroup$

              Looks like too much circuitry, which leads to more cost, complexity, failures. There is nothing in the question that indicates anything more than series resistors are required. Adding components, like isolated switching power supplies, adds components with much higher failure rates than a few resistors and diodes. The circuit below is well protected, simple, reliable, and goes high/low when switch is closed/open. There would need to be a specific, compelling reason to add all that circuitry in the question.





              schematic





              simulate this circuit – Schematic created using CircuitLab






              share|improve this answer









              $endgroup$



              Looks like too much circuitry, which leads to more cost, complexity, failures. There is nothing in the question that indicates anything more than series resistors are required. Adding components, like isolated switching power supplies, adds components with much higher failure rates than a few resistors and diodes. The circuit below is well protected, simple, reliable, and goes high/low when switch is closed/open. There would need to be a specific, compelling reason to add all that circuitry in the question.





              schematic





              simulate this circuit – Schematic created using CircuitLab







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered 2 days ago









              scorpdaddyscorpdaddy

              56127




              56127







              • 2




                $begingroup$
                Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
                $endgroup$
                – Wesley Lee
                2 days ago






              • 1




                $begingroup$
                You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
                $endgroup$
                – scorpdaddy
                2 days ago












              • 2




                $begingroup$
                Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
                $endgroup$
                – Wesley Lee
                2 days ago






              • 1




                $begingroup$
                You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
                $endgroup$
                – scorpdaddy
                2 days ago







              2




              2




              $begingroup$
              Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
              $endgroup$
              – Wesley Lee
              2 days ago




              $begingroup$
              Fair points, but I am less worried about the board itself failing than it causing some damage to the computer due to the long cable being connected to say, AC mains, by accident etc. I guess high voltage resistors and some fuses would solve that. This is a one off project so cost isn't an issue. I do feel quite relieved that this approach would be enough in most cases though.
              $endgroup$
              – Wesley Lee
              2 days ago




              1




              1




              $begingroup$
              You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
              $endgroup$
              – scorpdaddy
              2 days ago




              $begingroup$
              You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
              $endgroup$
              – scorpdaddy
              2 days ago













              6












              $begingroup$

              That looks fine to me, but you may wish to put a diode across the optoisolator LED in case you get some ringing in the choke or wiring.



              The two transistor current sink might be slightly better and maybe 100K is a bit on the high side for the resistor. Eg,





              schematic





              simulate this circuit – Schematic created using CircuitLab



              You could also flip the current limiter and put it on the other rail. Right now the opto sees a lot of common mode voltage change when the switch is pressed. Grounding the photodiode would reduce that because of the coupling capacitance of the DC-DC.






              share|improve this answer











              $endgroup$








              • 1




                $begingroup$
                And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
                $endgroup$
                – Wesley Lee
                2 days ago
















              6












              $begingroup$

              That looks fine to me, but you may wish to put a diode across the optoisolator LED in case you get some ringing in the choke or wiring.



              The two transistor current sink might be slightly better and maybe 100K is a bit on the high side for the resistor. Eg,





              schematic





              simulate this circuit – Schematic created using CircuitLab



              You could also flip the current limiter and put it on the other rail. Right now the opto sees a lot of common mode voltage change when the switch is pressed. Grounding the photodiode would reduce that because of the coupling capacitance of the DC-DC.






              share|improve this answer











              $endgroup$








              • 1




                $begingroup$
                And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
                $endgroup$
                – Wesley Lee
                2 days ago














              6












              6








              6





              $begingroup$

              That looks fine to me, but you may wish to put a diode across the optoisolator LED in case you get some ringing in the choke or wiring.



              The two transistor current sink might be slightly better and maybe 100K is a bit on the high side for the resistor. Eg,





              schematic





              simulate this circuit – Schematic created using CircuitLab



              You could also flip the current limiter and put it on the other rail. Right now the opto sees a lot of common mode voltage change when the switch is pressed. Grounding the photodiode would reduce that because of the coupling capacitance of the DC-DC.






              share|improve this answer











              $endgroup$



              That looks fine to me, but you may wish to put a diode across the optoisolator LED in case you get some ringing in the choke or wiring.



              The two transistor current sink might be slightly better and maybe 100K is a bit on the high side for the resistor. Eg,





              schematic





              simulate this circuit – Schematic created using CircuitLab



              You could also flip the current limiter and put it on the other rail. Right now the opto sees a lot of common mode voltage change when the switch is pressed. Grounding the photodiode would reduce that because of the coupling capacitance of the DC-DC.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited 2 days ago

























              answered 2 days ago









              Spehro PefhanySpehro Pefhany

              212k5162428




              212k5162428







              • 1




                $begingroup$
                And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
                $endgroup$
                – Wesley Lee
                2 days ago













              • 1




                $begingroup$
                And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
                $endgroup$
                – Wesley Lee
                2 days ago








              1




              1




              $begingroup$
              And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
              $endgroup$
              – Wesley Lee
              2 days ago





              $begingroup$
              And less different parts to place with 2 transistors instead of diodes. (Oh nvm now there is a diode back again :P )
              $endgroup$
              – Wesley Lee
              2 days ago












              4












              $begingroup$

              A simpler way would be to use a shielded cable (to shunt noise and ESD away), and then protect the microcontroller inputs with diodes to VCC and ground.



              The resistance of the cable is most likely to be between 1 or 10 ohms (as long as the AWG is more than 30 gauge).






              share|improve this answer











              $endgroup$

















                4












                $begingroup$

                A simpler way would be to use a shielded cable (to shunt noise and ESD away), and then protect the microcontroller inputs with diodes to VCC and ground.



                The resistance of the cable is most likely to be between 1 or 10 ohms (as long as the AWG is more than 30 gauge).






                share|improve this answer











                $endgroup$















                  4












                  4








                  4





                  $begingroup$

                  A simpler way would be to use a shielded cable (to shunt noise and ESD away), and then protect the microcontroller inputs with diodes to VCC and ground.



                  The resistance of the cable is most likely to be between 1 or 10 ohms (as long as the AWG is more than 30 gauge).






                  share|improve this answer











                  $endgroup$



                  A simpler way would be to use a shielded cable (to shunt noise and ESD away), and then protect the microcontroller inputs with diodes to VCC and ground.



                  The resistance of the cable is most likely to be between 1 or 10 ohms (as long as the AWG is more than 30 gauge).







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited yesterday









                  Peter Mortensen

                  1,60031422




                  1,60031422










                  answered 2 days ago









                  laptop2dlaptop2d

                  27.1k123584




                  27.1k123584





















                      1












                      $begingroup$

                      I would make a current loop. Simple, cheap and reliable. You can connect the transistor in a common collector configuration if you want a non-inverted output. The optocoupler LED must be rated for at least 20 mA.



                      enter image description here






                      share|improve this answer











                      $endgroup$

















                        1












                        $begingroup$

                        I would make a current loop. Simple, cheap and reliable. You can connect the transistor in a common collector configuration if you want a non-inverted output. The optocoupler LED must be rated for at least 20 mA.



                        enter image description here






                        share|improve this answer











                        $endgroup$















                          1












                          1








                          1





                          $begingroup$

                          I would make a current loop. Simple, cheap and reliable. You can connect the transistor in a common collector configuration if you want a non-inverted output. The optocoupler LED must be rated for at least 20 mA.



                          enter image description here






                          share|improve this answer











                          $endgroup$



                          I would make a current loop. Simple, cheap and reliable. You can connect the transistor in a common collector configuration if you want a non-inverted output. The optocoupler LED must be rated for at least 20 mA.



                          enter image description here







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 14 hours ago

























                          answered 14 hours ago









                          ArchimedesArchimedes

                          30528




                          30528



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Electrical Engineering Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              Use MathJax to format equations. MathJax reference.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f429700%2finterfacing-a-button-to-a-microcontroller-and-pc-with-a-50-m-long-cable%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                              Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                              What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company