0

https://imgur.com/a/dfR5LDj

The image shows a way of connecting an optocoupler. My problem comes from how the emitter (Q1 in the image) is connected. The emmiter goes to a resistance going to ground and to v_out. When i try to add this to my circuit the pin that is suppost to be receiving data, the v_out pin goes silent. If i remove the resistance going from the emitter to ground and just have vout to the emitter everything works fine.

4
  • Is the optocoupler connected to an arduino board? What is your circuit?
    – Jot
    Dec 5, 2018 at 19:33
  • My first reaction is "YIKES- That's 18Volts going into the arduino input pin?". If the Ardiono in question is the kind that has an on-board 5V regulator, use that in place of the 18V at Q1's collector, put the resistor back in, and try again. Obvious, but don't forget to configure your input pin and an INPUT. You also might want to try a different input pin because as much as I hate to say it, you're first experiment could have destroyed the input circuit for the first pin.
    – Randy
    Dec 5, 2018 at 20:18
  • please explain what this means .... pin goes silent
    – jsotola
    Dec 6, 2018 at 6:16
  • pin that is suppost to be receiving data .... which pin are you talking about?
    – jsotola
    Dec 6, 2018 at 6:17

1 Answer 1

2

Normally you would connect the ground (0V) side of resistor R2 to the ground of the Arduino and the other side of R2 (which is also connected to the emitter of Q1) to an input pin of the Arduino. When the LED is energized by pressing the button it sends light to the fototransistor. Because of this the phototransistor starts conducting current (I1) which causes a voltage drop I1xR2 over R2. When this voltage is high enough the input pin will show a "1" (or HIGH) when read out. "High enough" means >= 0.7 x Vcc, where Vcc is the voltage of the powerline to the Arduino.

The website from which the picture in your question originates (here) has an extensive article about the working and implementation of optocouplers. It also shows examples of alternative circuits.

2
  • maybe i'm misunderstanding here, but something like this? imgur.com/6xZE5gx Here the red wire goes to the collector. the emitter goes to ground via resistor and sends signal to the Arduino via the gray cable Dec 5, 2018 at 20:16
  • I would leave away the resistor in the collector line. Are the resistors from the picture the real ones you use (how did you get a non standard resistor of 250 Ohm?). Personally I have more faith in the circuit of fig. 14 in the datasheet: vishay.com/docs/81181/4n35.pdf
    – PimV
    Dec 5, 2018 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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