The freewheeling diode associated with the relay safeguards the transistor from back EMF voltage spikes generated by the relay coil. When it's a PNP transistor such as a BC557, the base terminal of the transistor is coupled with the collector terminal of the optocoupler's internal transistor, the emitter is connected with the positive line and the collector pin is configured with the relay. Using PNP TransistorĪs can be seen diagram below, a PNP relay driver is connected with the optocoupler. ![]() As shown in the following circuit diagrams, the relay driver may consist a NPN transistor or a PNP transistor.Īn external transistor is recommended in a situation where the relay coil resistance is low, below 300 ohms and the relay requires a higher amount of current above 50 mA. The following concepts show how a relay driver can be configured with an optocoupler using transistors. ![]() This is because, most optocouplers cannot handle more than 50 mA current as the load current, therefore the relay coil must have a relatively high resistance so that it does not pass more than 30 or 40 mA current. So if you want to use the above configuration and connect the relay directly with the optocoupler, then you have to first measure the coil resistance of the relay and make sure it is higher than 300 ohm. Remember, although the above connection diagram looks simple and easy, you must ensure that the relay coil resistance is not below 300 ohms, otherwise the optocoupler may heat up and get destroyed. In the following circuit diagram we can see how a relay can be connected directly connected with the collector of the optocoupler's internal transistor. ![]() Connecting Relay Directly with an Optocoupler The photo-transistor output is normally used for driving the preceding isolated stage, for example a relay driver stage. The above action illuminates the internal LED whose light is detected by the photo-transistor causing it to conduct across its relevant pin outs. The idea of operating a relay with an optocoupler is simple, it's all about providing an input DC from the source which needs to be isolated to the LED pin outs via a limiting resistor (as we normally do with usual LEDs) and to switch the photo transistor in response to the applied input triggers. The LED is terminated over a couple of pin outs, while the three terminals of the photo-transistor is terminated over the other three assigned pin outs. Connecting Relay Directly with an OptocouplerĪn opto-coupler is a device which encapsules an LED and a photo-transistor inside a hermetically sealed, water proof, light proof package in the form of an 8 pin IC (resembling a 555 IC).You usually don't use pullups or pulldowns with push-pull output. Push-pull output actively sources and sinks current, when it's on - current flows out of the pin, when it's off - current flows into it. Now, while the pin is off, output will be high as the resistor is pulling it, when the pin is on, the internal transistor slams bottom side of pullup resistor to ground. When something outside of the pin wants to read voltage (like high impedance input), you solve this by hooking up a pull up resistor to open drain. When the pin is on, it just ties to the ground whatever it is connected to it. When the open drain pin is off, no current flows into the pin, the voltage at it is undefined, it is said to be "floating". You use open drain when you want to switch current. Now, what open drain is - it's just a transistor with it's drain (collector) unconnected - you can hook up your load to this drain (D1 in my schematic). Plase note, that in most stm32 MCUs outputs can be configured as open drain or push pull and whole combination of internal pull ups and pull downs. While it's discussed in this question, I'll just give a short description. Simulate this circuit – Schematic created using CircuitLabįrom your comments I get that you don't get exactly how push-pull and open drain output stages operate. ![]() For Q2 you need a transistor with hfe greater than 250mA/12mA=20 MPS2222 seems to have hfe of 75 at base 10mA current, so you should be ok. Your optocoupler will have a current transfer ratio of ~400% at 3mA LED current, this makes 12mA running thru Q1. Remember, BJT transistor is a current controlled device, that's why you can stack them on top of each other to form a Darlington pair.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |