| SimElectronics™ | ![]() |
Model optocoupler as LED, current sensor, and controlled current source
Semiconductor Devices

This block represents an optocoupler using a model that consists of the following components:
An exponential light-emitting diode in series with a current sensor on the input side
A controlled current source on the output side
The output-side current flows from the collector junction to the emitter junction. It has a value of CTR*Id, where CTR is the Current transfer ratio parameter value and Id is the diode current.
Use the Optocoupler block to interface two electrical circuits without making a direct electrical connection. A common reason for doing this is that the two circuits work at very different voltage levels.
Note Each electrical circuit must have its own Electrical Reference block. |
If the output circuit is a phototransistor, typical values for the Current transfer ratio parameter are 0.1 to 0.5. If the output stage consists of a Darlington pair, the parameter value can be much higher than this. The Current transfer ratio value also varies with the light-emitting diode current, but this effect is not modeled by the Photodiode block.
Some manufacturers provide a maximum data rate for optocouplers. In practice, the maximum data rate depends on the following factors:
The capacitance of the photodiode and the type of the driving circuit
The construction of the phototransistor and its associated capacitance
The Optocoupler block only lets you define the capacitance on the light-emitting diode. You can use the Junction capacitance parameter to add your own capacitance across the collector and emitter connections.
The Optocoupler block has the following limitations:
The output side is modeled as a controlled current source. As such, it only correctly approximates a bipolar transistor operating in its normal active region. To create a more detailed model, connect the Optocoupler output directly to the base of an NPN Bipolar Transistor block, and set the parameters to maintain a correct overall value for the current transfer ratio. If you need to connect optocouplers in series, use this approach to avoid the invalid topology of two current sources in series.
This block does not model temperature-dependent effects. SimElectronics™ simulates the block at the temperature at which the component behavior was measured, as specified by the Measurement temperature parameter value.
You may need to use nonzero ohmic resistance and junction capacitance values to prevent numerical simulation problems, but the simulation may run faster with these values set to zero.

The output current flowing from the transistor collector to emitter junctions is equal to the product of the current transfer ratio and the current flowing the light-emitting diode. The default value is 0.2.
Select one of the following methods for model parameterization:
Use I-V curve data points — Specify measured data at two points on the diode I-V curve. This is the default method.
Use parameters IS and N — Specify saturation current and emission coefficient.
A vector of the current values at the two points on the diode I-V curve that the block uses to calculate IS and N. This parameter is only visible when you select Use I-V curve data points for the Diode parameterization parameter. The default value is [ 0.001 0.015 ] A.
A vector of the voltage values at the two points on the diode I-V curve that the block uses to calculate IS and N. This parameter is only visible when you select Use I-V curve data points for the Diode parameterization parameter. The default value is [ 0.9 1.05 ] V.
The magnitude of the current that the ideal diode equation approaches asymptotically for very large reverse bias levels. This parameter is only visible when you select Use parameters IS and N for the Diode parameterization parameter. The default value is 1e-10 A.
The temperature at which IS or the I-V curve was measured. The default value is 25 °C.
The diode emission coefficient or ideality factor. This parameter is only visible when you select Use parameters IS and N for the Diode parameterization parameter. The default value is 2.

The series diode connection resistance. The default value is 0.1 Ω.

Select one of the following options for modeling the diode junction capacitance:
Fixed or zero junction capacitance — Model the junction capacitance as a fixed value.
Use C-V curve data points — Specify measured data at three points on the diode C-V curve.
Use parameters CJ0, VJ, M & FC — Specify zero-bias junction capacitance, junction potential, grading coefficient, and forward-bias depletion capacitance coefficient.
The value of the capacitance placed in parallel with the exponential diode term. This parameter is only visible when you select Fixed or zero junction capacitance or Use parameters CJ0, VJ, M & FC for the Junction capacitance parameter. The default value is 5 pF.
The junction potential. This parameter is only visible when you select Use parameters CJ0, VJ, M & FC for the Junction capacitance parameter. The default value is 1 V.
The coefficient that quantifies the grading of the junction. This parameter is only visible when you select Use parameters CJ0, VJ, M & FC for the Junction capacitance parameter. The default value is 0.5.
A vector of the reverse bias voltage values at the three points on the diode C-V curve that the block uses to calculate CJ0, VJ, and M. This parameter is only visible when you select Use C-V curve data points for the Junction capacitance parameter. The default value is [ 0.1 10 100 ] V.
A vector of the capacitance values at the three points on the diode C-V curve that the block uses to calculate CJ0, VJ, and M. This parameter is only visible when you select Use C-V curve data points for the Junction capacitance parameter. The default value is [ 3.5 1 0.4 ] pF.
Fitting coefficient that quantifies the decrease of the depletion capacitance with applied voltage. This parameter is only visible when you select Use C-V curve data points or Use parameters CJ0, VJ, M & FC for the Junction capacitance parameter. The default value is 0.5.
The block has the following ports:
Electrical conserving port associated with the diode positive terminal.
Electrical conserving port associated with the diode negative terminal.
Electrical conserving port associated with the transistor collector terminal.
Electrical conserving port associated with the transistor emitter terminal.
[1] G. Massobrio and P. Antognetti. Semiconductor Device Modeling with SPICE. 2nd Edition, McGraw-Hill, 1993.
[2] H. Ahmed and P.J. Spreadbury. Analogue and digital electronics for engineers. 2nd Edition, Cambridge University Press, 1984.
Diode, NPN Bipolar Transistor, Simscape™ Controlled Current Source
![]() | NPN Bipolar Transistor | P-Channel JFET | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |