2
\$\begingroup\$

I'm a bit overwhelmed by the sheer amount of variations in optocouplers and since I've never used one before in any project I don't really know what criteria to look out for.

A colleague of mine suggested that I should replace the relays in my circuit with optocouplers as they are much cheaper and also smaller in size. I agree with him once I looked into it, but unlike relays, I'm very unfamiliar with optocouplers.

I have this schematics in which I use relays to enable/disable a parallel resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

From my understanding, if I were to use optocouplers I could get rid of the TPIC6C596, which I only need due to the high current draw of the relay.

So for this output-schematic I figured I could use this LTV-847 which would replace 4 relays at once.

But there were many other options to choose from and I just feel like I'm making a wrong choice because the above was simply the cheapest 4 channel chip that I found.

It's a simple circuit without much timing constraints, so any optocoupler that uses less mA than a relay and handles 24V could work.

For relays it was a bit easier, because I needed the smallest, cheapest 5V relay that I can get, which narrowed down the search quickly.

But with optocouplers pretty much all of the options are cheaper than the relays, are smaller and also use less current...

Edit:

Would this circuit produce the same result as the relays?

schematic

simulate this circuit

Is my optocoupler choice fitting for the scenario, given that I have 24V on the input module and 5V on the control side. Basically just requiring a "switch" solution but in a smaller form factor.


Regarding my schematic:

Originally I used relays because I knew they don't produce a voltage drop on the output.

However, from what I've read, optocouplers do produce voltage drops because of the phototransistor used.

But since I'm unfamiliar with the component itself I didn't know how I could best reproduce the result of a relay with an optocoupler, meaning I can get the ~24mA needed on the output side.

The relay simply creates a parallel resistor, so the total resistance is around 1K ohm.

Would I need to lower the resistance of the output resistor R3 or are there optocouplers with identical results as relays?

\$\endgroup\$
  • 2
    \$\begingroup\$ Possible duplicate of What are the differences between optoisolator output styles? \$\endgroup\$ – CL. Aug 8 at 20:37
  • \$\begingroup\$ Thanks for the link. I'll adjust the question, as it is not directly about the types of optocouplers.. \$\endgroup\$ – HackXIt Aug 8 at 21:17
  • \$\begingroup\$ I don't see how you can replace 4 relays at once, it is a 4 pin optocoupler but it has 2 inputs and 2 outputs only. \$\endgroup\$ – Juan Aug 9 at 0:56
  • \$\begingroup\$ "...the ~240mA needed on the output side" - your schematic suggests it only needs to switch 16mA. Where does the 240mA come from? What is the purpose of the two resistors? \$\endgroup\$ – Bruce Abbott Aug 9 at 3:46
  • \$\begingroup\$ @Juan: The one I found was a 4 channel optocoupler, so it has 4 inputs/outputs. \$\endgroup\$ – HackXIt Aug 9 at 10:59
2
\$\begingroup\$

Optocouplers like the LTV-846 consist of an infrared LED and an NPN transistor. Output characteristics are similar to a normal bipolar transistor, except that Base current is created from light generated by the LED. This is not very efficient so despite the transistor's current gain the CTR (Current Transfer Ratio) is often less than 1.

In your circuit the LED current is about (5V-1.2V)/220Ω = 17mA, and the transistor has to switch 24V/1.5kΩ = 16mA. Therefore the CTR needs to be at least 1, preferably higher to ensure that the transistor is fully saturated for low voltage drop.

The LTV-846 is available in several 'ranks' depending on CTR. You should choose the B, C, or CD version, which have a minimum CTR of 2 or higher.

If your supplier doesn't have the high CTR version or the price is too high then you have a few other options. One is to use the optocoupler to turn on another transistor in Darlington configuration. This has a minimum voltage drop of ~0.8V, which will reduce the resistor current by about 0.7mA at 24V. If this is a concern then you could reduce the resistance from 1.5kΩ to 1.4kΩ.

schematic

simulate this circuit – Schematic created using CircuitLab

R4 ensures that the external transistor won't turn on due to leakage current from the optocoupler transistor.

Since Q2's current gain is >40 you could reduce LED current, perhaps enough to eliminate the TPIC6C596. Raspberry Pi GPIO outputs have a recommended maximum output current of 3mA, which should be enough to reliably operate the circuit even with a CTR of only 0.5. R1 would then be ~(3.3V-1.2V)/3mA = 680Ω (nearest 5% value).

\$\endgroup\$
  • \$\begingroup\$ But R4 will also affect the current at the Input module, or not? \$\endgroup\$ – HackXIt Aug 10 at 11:30
  • \$\begingroup\$ Actually I'll take your suggestion and clarify some things with my colleague about this input module and how it operates, which should make circuit design a bit more clear when I have concrete numbers about the input module. \$\endgroup\$ – HackXIt Aug 10 at 11:34

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.