• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos 

You are here: Home / Electronics Tutorial / How to Connect a Relay through an Opto-Coupler

How to Connect a Relay through an Opto-Coupler

Last Updated on June 14, 2022 by Swagatam 54 Comments

The following post describes how to drive a relay by using an isolated method, or through an optocoupler device. We will learn three methods, first method is by connecting relay directly with the optocoupler output pins, second method is by using external PNP transistors, and third method is by using external NPN transistors. Any standard optocoupler such PC817, TIL111, or MCT2E can be used in the discussed circuit diagrams.

The question was asked by one of the interested members of this blog, Miss Vineetha.

Before studying the proposed design, let's first understand how an opto coupler works.

How an Opto-Coupler Works

An 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).

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.

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 above action illuminates the internal LED whose light is detected by the photo-transistor causing it to conduct across its relevant pin outs.

The photo-transistor output is normally used for driving the preceding isolated stage, for example a relay driver stage.

Connecting Relay Directly with an Optocoupler

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.

caution electricity can be dangerous

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.

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.

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.

The following concepts show how a relay driver can be configured with an optocoupler using transistors. As shown in the following circuit diagrams, the relay driver may consist a NPN transistor or a PNP transistor.

An 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.

Using PNP Transistor

As can be seen diagram below, a PNP relay driver is connected with the optocoupler. 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.

The freewheeling diode associated with the relay safeguards the transistor from back EMF voltage spikes generated by the relay coil.

The resistor values are not critical, any resistor value between 4k7 and 22K can be used for the two resistors.

Using NPN Transistor

The next diagram below shows how to integrate an NPN relay driver stage with an optocoupler. If an NPN transistor such as a BC547 is used in the relay driver, the switching voltage is received from the emitter of the optocoupler's internal transistor.

Thus, the base of the BC547 NPN transistor can be seen connected with the emitter of the optocoupler transistor, emitter of the BC547 is connected with the ground line, and collector of the BC547 is configured with the relay. The diode has the same function as explained in the previous paragraph.

The resistor value is not critical, any value between 1K and 10K can be used.

You'll also like:

  • 1.  How to Make Adjustable Current Limiter Circuits
  • 2.  USB Isolator Diagram and Working
  • 3.  Inductor Working and Designing, with Formulas
  • 4.  Reed Switch – Working, Application Circuits
  • 5.  What is Constant Current Source – Facts Explained
  • 6.  UP DOWN Logic Sequence Controller Circuit

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

Subscribe
Notify of
54 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (26)
  • 555 IC Circuits (99)
  • 741 IC Circuits (20)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (115)
  • Battery Chargers (83)
  • Car and Motorcycle (95)
  • Datasheets (74)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (101)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (120)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (104)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (66)
  • Mini Projects (150)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (79)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (62)
  • Sensors and Detectors (121)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (61)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (41)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz