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.
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?
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?
Answer
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Ω.
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).
No comments:
Post a Comment