0
\$\begingroup\$

To switch a 12V relay with a micro controller, I designed ("borrowed") this schematic. Schematic

Build the pcb and it works great. But there's a little bug that got me a bit worried. If I touch the optocoupler (I used the 4N25) with a finger between pin 5 and (floating pin) 6, the relay switches. enter image description here Is this normal behavior? Do I need to worry if this gets used in a more humid environment? Is there maybe a simple bodge I can add to overcome this (if needed)?.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ You can throw out your optos as they do nothing for your circuit. You're not needing optocoupling as the 0V is shared. You could run R9 to the base of T3 and your circuit would operate as expected. Recalculating the value of R9 would be advisable in this instance. \$\endgroup\$
    – Kartman
    Commented Oct 2, 2021 at 13:08

3 Answers 3

1
\$\begingroup\$

Your finger is providing a path from the collector to the base. Injecting some base current will turn the transistor on so the behaviour is expected.

\$\endgroup\$
0
\$\begingroup\$

Is this normal behaviour?

Yes it is so, if you find that this is unacceptable for your specific application, choose an opto-coupler without a base connection to the photo-transistor. There are literally hundreds of choices but, make sure you choose one with about the same CTR (current transfer ration) as the 4N25.

If you insist on using that part then spray lacquer over the pin 6 connection to improve its resilience to humidity.

\$\endgroup\$
4
  • \$\begingroup\$ The pin will still be slightly exposed so put some silicone sealer over it. \$\endgroup\$
    – Andy aka
    Commented Oct 2, 2021 at 10:18
  • \$\begingroup\$ Glad I didn't made a mistake. Ill just cut the base leg of the 4N25. I have to much of them lying around here, and saves me from searching for a baseless optocoupler with the same pinout. (EDIT) Sorry, I didn't see the message so I typed it again. Then my previous message showed up, and I deleted the wrong message. [Edited by a moderator.] \$\endgroup\$
    – satoer
    Commented Oct 2, 2021 at 10:21
  • \$\begingroup\$ Add a 1k resistor from pin6 of opto to pin4 or ground. \$\endgroup\$
    – Antonio51
    Commented Oct 2, 2021 at 12:26
  • \$\begingroup\$ Antonio - please delete your comment or explain why you feel it is necessary to add this resistor and why you feel that my answer is so bad that you have to contradict what I'm saying. If you think you are being helpful to me; you aren't. If you think you are being helpful to the OP then leave this comment under his question. \$\endgroup\$
    – Andy aka
    Commented Oct 2, 2021 at 12:49
0
\$\begingroup\$

Yes, normal, since the pin 6 is high impedance and floating. Sometimes a resistor is put there to make it less sensitive.

If you want or need to modify the circuit, you can simply remove the optocoupler to make the design more robust and cheaper. As it does not provide any isolation, it is a rather useless part.

\$\endgroup\$
2
  • \$\begingroup\$ A resistor to GND? What value is a good choice? In the past I have had so much problems with interference from relays. To the point of completely freezing the microcontroller. Especially when switching heavy things like motors. With this project I want to prevent interference or noise as best as possible. The relay might put some interference on the supply line, but at least I prevent noise on the direct I/O lines of the microcontroller thanks to the optocoupler. The snubber circuit on the switching part of the relay also prevents noise. \$\endgroup\$
    – satoer
    Commented Oct 2, 2021 at 19:34
  • \$\begingroup\$ I just don't see what interference would come from the transistor to IO pin so I don't see what good will an optocoupler will do between them, especially when it is not designed to isolate as they share a ground and as the PCB does not guide the relay driving currents in any special way, it's just all connected together. An optocoupler is not a magical thing that makes things better, even if chinese relay modules have them to be able to add buzzwords to marketing material. For the 8mA you drive the optocoupler, you can easily saturate the transistor so it can drive the 75mA relay current. \$\endgroup\$
    – Justme
    Commented Oct 2, 2021 at 20:33

Your Answer

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

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