Interfacing a button to MCU (and PC) with 50m long cable The Next CEO of Stack OverflowUsing optoisolator and triac with mcu to switch light on/off--need low power alternativeSimple light bulb operated by button and optoisolator triacDesigning an ethernet isolatorProblems with high-side current sensing with 12V comparator and logicReading ECU tacho signal with PIC MCU - noise issuesControlling 2 PSUs with an mCUInterfacing retriggerable oneshot with optocouplerHow to protect MCU IO and 5V from shorted +12VHow to isolate the car ground with MCU ground?Can you and/or why should you not replace optocouplers with transistors when dealing with slightly different voltage

How did people program for Consoles with multiple CPUs?

What can we do to stop prior company from asking us questions?

Workaholic Formal/Informal

How should I support this large drywall patch?

Non-deterministic sum of floats

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

How do we know the LHC results are robust?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Do I need to enable Dev Hub in my PROD Org?

Disadvantage of gaining multiple levels at once in a short milestone-XP game

Why do we use the plural of movies in this phrase "We went to the movies last night."?

Elegant way to replace substring in a regex with optional groups in Python?

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

In excess I'm lethal

Why didn't Khan get resurrected in the Genesis Explosion?

Won the lottery - how do I keep the money?

If a black hole is created from light, can this black hole then move at speed of light?

Make solar eclipses exceedingly rare, but still have new moons

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

Anatomically Correct Strange Women In Ponds Distributing Swords

How to prepend a string to only the lines of text which are numbers

Rotate a column

How to subset dataframe based on a "not equal to" criteria applied to a large number of columns?



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



The Next CEO of Stack OverflowUsing optoisolator and triac with mcu to switch light on/off--need low power alternativeSimple light bulb operated by button and optoisolator triacDesigning an ethernet isolatorProblems with high-side current sensing with 12V comparator and logicReading ECU tacho signal with PIC MCU - noise issuesControlling 2 PSUs with an mCUInterfacing retriggerable oneshot with optocouplerHow to protect MCU IO and 5V from shorted +12VHow to isolate the car ground with MCU ground?Can you and/or why should you not replace optocouplers with transistors when dealing with slightly different voltage










3












$begingroup$


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



I think its 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 < 100Ohm 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$
















    3












    $begingroup$


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



    I think its 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 < 100Ohm 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$














      3












      3








      3





      $begingroup$


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



      I think its 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 < 100Ohm 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 ~50m away in an office environment. (its actually a lot closer but the cable is long)



      I think its 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 < 100Ohm 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










      asked 2 hours ago









      Wesley LeeWesley Lee

      5,77652241




      5,77652241




















          3 Answers
          3






          active

          oldest

          votes


















          4












          $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 hours ago



















          2












          $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$












          • $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 hours ago










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


















          2












          $begingroup$

          A simpler way would be to use shielded cable (to shunt noise and ESD away), then protect the MCU 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$













            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-mcu-and-pc-with-50m-long-cable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4












            $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 hours ago
















            4












            $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 hours ago














            4












            4








            4





            $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 hours ago

























            answered 2 hours ago









            Spehro PefhanySpehro Pefhany

            211k5162426




            211k5162426







            • 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 hours 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 hours 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 hours 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 hours ago














            2












            $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$












            • $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 hours ago










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















            2












            $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$












            • $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 hours ago










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













            2












            2








            2





            $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 hours ago









            scorpdaddyscorpdaddy

            50127




            50127











            • $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 hours ago










            • $begingroup$
              You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
              $endgroup$
              – scorpdaddy
              1 hour 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 hours ago










            • $begingroup$
              You may forgo the fuses, as D1+D2 clamp circuit voltages to acceptable levels.
              $endgroup$
              – scorpdaddy
              1 hour 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 hours 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 hours ago












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




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











            2












            $begingroup$

            A simpler way would be to use shielded cable (to shunt noise and ESD away), then protect the MCU 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$

















              2












              $begingroup$

              A simpler way would be to use shielded cable (to shunt noise and ESD away), then protect the MCU 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$















                2












                2








                2





                $begingroup$

                A simpler way would be to use shielded cable (to shunt noise and ESD away), then protect the MCU 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 shielded cable (to shunt noise and ESD away), then protect the MCU 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










                answered 1 hour ago









                laptop2dlaptop2d

                27k123484




                27k123484



























                    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-mcu-and-pc-with-50m-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

                    Благоевград Съдържание География | История | Население | Политика | Икономика и инфрастуктура | Здравеопазване | Образование и наука | Култура и забавления | Забележителности | Личности | Литература | Външни препратки | Бележки | Навигация42°01′18.99″ с. ш. 23°05′51″ и. д. / 42.021944° с. ш. 23.0975° и. д.*БлагоевградразширитередактиранеОфициален уебсайт на община БлагоевградНовинарски портал на Благоевград – blagoevgrad.euСайтове за БлагоевградНационален статистически институтdariknews.bgГригоровичъ, Викторъ. „Очеркъ путешествія по Европейской Турціи“. Москва, 1877.Стрезов, Георги. Два санджака от Източна Македония. Периодично списание на Българското книжовно дружество в Средец, кн. XXXVII и XXXVIII, 1891, стр. 18 – 19.Македония. Етнография и статистикаГаджанов, Димитър Г. Мюсюлманското население в Новоосвободените земи, в: Научна експедиция в Македония и Поморавието 1916, Военноиздателски комплекс „Св. Георги Победоносец“, Университетско издателство „Св. Климент Охридски“, София, 1993, стр. 244.паметник на незнайния четник&cd=18&hl=en&ct=clnk&client=firefox-a „История на днешен Благоевград“, взето от www.museumblg.com на 16 март 2010 г.„Справка за населението на град Благоевград, община Благоевград, област Благоевград, НСИ“„The population of all towns and villages in Blagoevgrad Province with 50 inhabitants or more according to census results and latest official estimates“„Ethnic composition, all places: 2011 census“История на Неврокопска епархия.Национален статистически институтМюсюлманско изповедание. Главно мюфтийствоНационален публичен регистър на храмовете в БългарияМюсюлманско изповедание. Главно мюфтийствоwww.dnes.bg Джамията в Благоевград не била паленаwww.sesc-bg.orgСписък на побратимени градовеТехническо побратимяванеГУМ грейва в цветовете на нощен Лас Вегас под името „Largo“, „МОЛ Благоевград“..., в. „Струма“grabo.bgwww.cinemaxbg.comррр4238731-067cad53a-0546-417b-a3d3-51e49b1d2232147736077147736077

                    What is the best defense strategy for Survival in Grand Theft Auto Online?What is JP used for in Grand Theft Auto Online?How do I setup a Crew HQ in Grand Theft Auto Online?How does stealth work in Grand Theft Auto Online?Is it possible to own more than 10 cars in Grand Theft Auto online?Where to find truck/trailers in Grand Theft Auto OnlineWhat are some of the best missions to do on Grand Theft Auto 5 onlineFastest Car in Grand Theft Auto V PCHow to setup a Crew vs Crew online session in Grand Theft Auto Online?Grand theft auto 5 crossplayingRestart Grand Theft Auto V Online?

                    How does Billy Russo acquire his 'Jigsaw' mask? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why does Bane wear the mask?Why does Kylo Ren wear a mask?Why did Captain America remove his mask while fighting Batroc the Leaper?How did the OA acquire her wisdom?Is Billy Breckenridge gay?How does Adrian Toomes hide his earnings from the IRS?What is the state of affairs on Nootka Sound by the end of season 1?How did Tia Dalma acquire Captain Barbossa's body?How is one “Deemed Worthy”, to acquire the Greatsword “Dawn”?How did Karen acquire the handgun?