An Optocoupler also known as Photocoupler or Optical Isolator is a component that transfers electrical signals between two isolated circuits using light. It physically and electrically separates a low-voltage control circuit (like a #microcontroller) from a high-voltage or noisy power circuit (like a motor or AC mains). It is basically a solid-state relay that optically interconnects two electrically isolated circuits.
In this tutorial, I am going to talk about the #PC817#Optocoupler which is one of the most common and inexpensive 4-pin optocouplers.
Chapters ------------- 00:00 Intro 01:34 Pin Configuration and Functions 02:18 How Optocoupler Works 06:58 Technical Specifications 08:52 PC817 Applications 09:55 Using an Arduino to Drive a 12V Motor 10:30 Why do optocouplers fail?
Thanks ------- Thanks again for checking my post. I hope it helps you. If you want to support me subscribe to my YouTube Channel: https://www.youtube.com/@CrazyCoupleDIY
Support My Work --------------- BTC: 1Hrr83W2zu2hmDcmYqZMhgPQ71oLj5b7v5 LTC: LPh69qxUqaHKYuFPJVJsNQjpBHWK7hZ9TZ DOGE: DEU2Wz3TK95119HMNZv2kpU7PkWbGNs9K3 ETH: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4 BAT: 0x9D9E77cA360b53cD89cc01dC37A5314C0113FFc3 LBC: bZ8ANEJFsd2MNFfpoxBhtFNPboh7PmD7M2 COS: bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23 Memo: 572187879 BNB: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4 MATIC: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4
Thanks, ca again in my next tutorial.
An optocoupler also known as a photocoupler or optical isolator is a component that transfers
electrical signals between two isolated circuits using light. It physically and electrically
separates a low voltage controlled circuit like a microcontroller from a high voltage
or noisy power circuit like a motor or AC mains. It is basically a solid state relay
that optically interconnects two electrically isolated circuits. In this tutorial, I am going
to talk about the PC817 optocoupler which is one of the most common and inexpensive
4 pin optocoupler.
This video is sponsored by PCBWay. PCBWay specializes in manufacturing of very high
quality low volume colored PCBs at a very budgetary price. In addition to standard PCBs,
you can also order advanced PCBs, aluminum PCBs, rigid flex PCBs. They also provide PCB
assembly and other related services which can meet your need to the greatest extent.
Make your Christmas projects merrier with PCBWay's biggest sale of the season. From
November 28th to December 31st, you can save up to 50% off on all orders, 10% off on 3D printing,
including transparent 3D printing. Additionally, receive free upgrades to pink, purple and matte
black solder masks. It is the perfect time to bring your year-end ideas to life.
The PC817 optocouplers are key components in modern electronics and are designed for signal
isolation and transmission in a circuit. It consists of two main parts inside a small black
4-pin DIP package, an infrared LED on the input side and a phototransistor on the output side.
The two components face each other but are physically separated by a transparent
insulating barrier providing complete electrical isolation between the two sides.
Starting from the side with the notch or dot and going anticlockwise, pin number 1 is the
anode of the internal LED, pin number 2 is the cathode of the internal LED, pin number 3 is the
emitter of the phototransistor and pin number 4 is the collector of the phototransistor.
To fully understand the optocoupler's working principle, we will explore it from four
different perspectives, each highlighting a unique method of circuit isolation.
The main aim is to enable one circuit to activate another while maintaining a complete
electrical isolation between them. The initial configuration consists of two circuits assembled
on a breadboard. Circuit 1 and circuit 2 are electrically isolated, meaning the operation of
one has no effect on the other. When powered, the LED on circuit 2 illuminates immediately.
In contrast, the LED on circuit 1 is controlled by a switch and only illuminates when activated.
Activating the switch in circuit 1 illuminates its LED while the LED in circuit 2 always remains
illuminated, unaffected by the circuit on the left. To control the right circuit's LED using
the left circuit, we can connect them using a transistor. Activating the switch on the left
side sends a current to the transistor's base, enabling the current flow from collector to
emitter, illuminating the LED on the right side. Deactivating the switch cuts off the base current
and turns off the LED. However, this setup requires both circuits to operate at the same potential
with a common ground, and hence, it cannot be used for voltage level shifting or to control
a circuit with a higher voltage. In the next setup, I am using an IR LED and an IR receiver
to create my own optoisolator. Circuit 1 on the left consists of the IR transmitter and a switch,
and circuit 2 on the right holds the IR receiver and an indicator LED that lights up upon receiving
IR signal. Flipping the switch turns on the IR LED. The IR receiver then detects the signal
and responds by illuminating its indicator LED. While it is possible to design infrared circuit
manually, the PC817 optocoupler offers a fully pre-engineered solution with a compact built-in
integrated circuit. In the final setup, we are going to use the inexpensive PC817 optoisolator
to optically interconnect and electrically isolate the two circuits. When we apply a
sufficient voltage higher than the forward voltage of 1.25V across pin 1 and 2 with the
current limiting resistor, the internal IR LED turns on and emits infrared light. This light
then passes through the insulating barrier. As you can see, there is no electrical connection
between the input and output. The infrared light hits the base of the phototransistor,
causing it to turn on and conduct current between its collector pin pin number 4 and emitter pin
pin number 3. So, we can control a secondary circuit just by using a beam of light. The input
side mandates a current limiting resistor for the optocoupler. Without it, the IR LED would try to
draw as much current as the power supply can provide, quickly exceeding its maximum rating
and burning it out. The closest standard value would be around 330 ohms or 470 ohms. A resistor
on the output side is not for protection, but for operation. It pulls up the voltage and converts the
phototransistor's variable conductivity into a variable voltage that your microcontroller or
next circuit can read. Unless exposed to light, the phototransistor acts as an insulator, blocking
the flow of current. So, when the phototransistor is off, the LED is off and when the phototransistor
is on, the LED is on. Because of this setup, voltage spikes and noise on one circuit will not
destroy or disrupt the other circuit. So, our circuits are protected. The two circuits can
therefore use different voltages and currents because of the separation. We can expand the
capabilities of this device by adding other components such as a transistor to the output
of circuit 2, allowing it to control even higher voltage and currents. Please note, the grounds on
the input side and the output side must be kept separate to maintain the isolation. This is the
entire point of using the optocoupler. Another critical parameter to consider while utilizing
an opto-isolator is the rise time and the fall time. The output does not transition instantaneously
as the input logic changes its state. One of the PC817's outstanding feature is its
strong electrical isolation capability with voltage rating of up to 5kV. By creating this
barrier, it safeguards expensive microprocessor and logic circuits by making the entire system
much safer and more reliable. Now, let's have a look at the technical specifications of the
optocoupler. PC817 comprises of 4 pins and is available in SMT and DIP packages. The forward
voltage of PC817 optocoupler's input diode is specified to be 1.25V. This parameter determines
the minimum voltage required for the infrared LED to operate properly. Forward current is rated at
50mA. Forward current is the amount of electric current flowing through a semiconductor like a
The maximum allowed collector emitter voltage of PC817 is 80V. This specification applies to
safe operation in high-pressure environment to avoid electrical failure or damage to the
optocoupler. Current transfer ratio or CTR is the ratio of output current to input current. A CTR
of 50% is common. So, if you put 20mA into the LED, you can get up to 10mA out of the transistor.
The input current is typically limited to under 20mA for safe operation. Input and output are
internally protected with 5kV electrical isolation. The operating temperature is between
minus 30 degree centigrade and 100 degree centigrade. Optocoupler's temperature range
during soldering is around 260 degrees. It is crucial to note that exceeding the specified
temperature during soldering can damage the IC. The PC817 has a total response time,
including rise and fall times of 18 microseconds. This fast response capability is beneficial for
applications requiring fast switching, such as pulse signal processing or high-speed switching
circuits. PC817 has an internal resistance of 100 ohms and a maximum power consumption
of 200mW. These factors manage the energy efficiency and heat load on the equipment.
For more detailed information, please consult the datasheet available in the description below.
The PC817 Optocoupler is commonly used for following applications. Signal isolation and
transmission. Electrical isolation circuits capable of withstanding up to 5kV. Isolation
of digital from analog circuits. It allows a 5V circuit to control a 12-24V circuit.
Microcontroller IOS switching circuit, effectively maintaining circuit continuity
without disconnection. Noise coupling circuit to keep the circuit in use without any interruption.
It helps in breaking ground loops. In AC-powered control circuits,
the Optocoupler regulates AC load by introducing frequency-induced pulses,
enabling precise control within a defined range. Driving relays, controlling motors,
or AC power switches. Is Optocoupler a suitable replacement for a relay?
The key distinction between an Optocoupler and relay lies in their power handling.
Optocouplers are used for low-power signal isolation and relays for high-power load
control. While there is a functional overlap, the specific load requirement determines the
optimal choice. A 12V DC motor cannot be connected directly to an Arduino pin.
The motor's high power demand and electrical noise can damage the sensitive microcontroller.
To mitigate this problem, the Arduino controls the 12V motor through a PC817 Optocoupler.
A high signal on the Arduino's pin activates the Optocoupler's LED,
turning on the internal phototransistor to power the motor, and a low signal turns it off.
The PC817 electrically isolates the Arduino's 5V ground from the motor's 12V ground,
protecting the Arduino from motor-induced noise.
So, why do Optocouplers fail? Common cause of Optocoupler failure includes
voltage surge. High voltage surge can breach the Optocoupler's isolation barrier,
resulting in permanent failure. Overcurrent. Exceeding the specified current on either
input or output terminal can damage the Optocoupler's internal components.
Aging. The performance of an Optocoupler degrades over time as its internal LED ages and loses
efficiency. Environmental factor. Harsh environmental conditions, particularly
extreme temperature and humidity, can lead to performance degradation or failure of an Optocoupler.
Assembly. During circuit assembly, ensure that all connections and solder joints are stable and
intact. Thanks again for watching this video. I hope it helps you. If you want to support me,
you can subscribe to my channel and watch my other videos. Thanks. See you again in my next video.
Bye now.