4N26 optocoupler internal diagram.
Fig. 1

Optocoupler Input Circuits for PLCs

by Lewis Loflin


Here I'll introduce programmable logic controller (PLC) input circuits using opto-couplers. We use these devices to interface high voltage sensors to low voltage microcontroller logic and to isolate sensitive circuits from noise.

I'll also discuss the concepts of SOURCE and SINK.

Fig. 1 illustrates a typical 6-pin opto-coupler. These can also be surface mount as well. All contain an LED emitter and many a photo transistor output.

Example optocoupler internal diagrams.
Fig. 2

Fig. 2 show just a few of the many types of optocouplers. The bottom two are often used as output while the top two can be either way.

Basic optocoupler IR emitter and phototransistor detector.
Fig. 3

Fig 3 illustrates a typical bipolar transistor opto-coupler to a microcontroller.

Home built optocoupler IR emitter and phototransistor detector.
Fig. 4

Fig 4 shows how to build you own opto-coupler with a light emitting diode and a photo transistor.

Internal diagram H11AA1 optocoupler.
Fig. 5

The H11AA1 is a very useful device because the dual back-to-back LEDs simplify circuits design because we don't have to worry about input polarity.

PLC sinking sensor input.
Fig. 6

Fig. 6 shows what is called a SINK configuration. This refers to the current path in relation to the PLC input. (This is really simplified.)

U1 is an open drain or collector in this case a Hall effect sensor. When a magnet turns on the Hall sensor a path to ground is enabled through the output pin. When U1 is turned on one of the LEDs is turned on switching on the transistor. The 5-volt micro-controller reads this as a switch closure.

The switching is in the ground side of the PLC input.

PLC source sensor input.
Fig. 7

Fig. 7 illustrates a SOURCE configuration. When U3 is turned on it switching on a PNP transistor completing the current path though the H11AA1 to ground. The switching is on the positive supply side of the PLC input.

PLC with both sinking and source sensor inputs.
Fig. 8

Fig 8 shows both SINK and SOURCE inputs on the same PLC. Because the opto-coupler is say a 4N26 with a single LED we must observe LED polarity.

In Fig. 6 the NPN transistor was internal to the Hall sensor.




Electronics Homepage
TA8050P H-Bridge Motor Control