I am trying to make an Arduino circuit as outlined here.

enter image description here

This is for connecting an Arduino input to a DCC system. DCC is a command control system for model railways that uses the same two wires for power and data (there's a wikipedia article that explains it better than I can)

I'm wondering what the optocoupler has more than 4 pins for? I'm new to this and I understand the purpose of the optocoupler but I am confused as to how this particular one works. It is a 6N136 optocoupler. I don't understand why it has the extra pins compared to 4 pin optocouplers, and I don't understand how it would read the polarity of the signal. DCC sends commands using polarity as I understand it, so I know I need to read the polarity, but how does the optocoupler do it here?

I have a very limited knowledge of electronics right now so pardon anything stupid I said :P

  • I also built this circuit but sometimes my R1 1K resistor gets hot and nothing works. I have a dcc Roco Multim.10765 on the dcc side. I can't find what causes, you have an idea?
    – David V
    Mar 7 '18 at 15:15

That specific chip (the 6N137) uses a more efficient IC detector rather than a simple transistor junction. It also has an "enable" pin that allows it to be turned on or off. Consequently it needs a power supply to run it. That all means extra pins.

This design allows for higher speed communication (it's a 10Mbaud chip) with less leakage when compared to a traditional design.

The pin VE (pin 7) needs to be pulled up to make the chip work (the job of R2) and the output is pulled high (it's open drain) by R3.

The optocoupler will be on with one polarity and off with the other. It's as simple as that. The diode D1 protects the LED in the optocoupler from the reverse voltages.

  • Out of curiosity, why does a diode need to be protected by a diode? (LED = Light Emitting Diode).
    – Nick Gammon
    Jan 18 '16 at 1:54
  • Reverse voltages on fragile optocoupler LEDs can break them, so by providing a low resistance path to cut out the reverse voltage you stop the led from being damaged.
    – Majenko
    Jan 18 '16 at 1:56
  • So if I'm understanding this right, if I run AC current through there, then whenever it's in the reverse polarity of the LED, it will read as off because the LED inside will be off since its a diode?
    – K4KFH
    Jan 18 '16 at 5:19
  • Pretty much, yes. Except it's open drain, so it will be LOW when it is on.
    – Majenko
    Jan 18 '16 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.