Contents
How is an optoisolator used in a microcontroller?
An optoisolator can protect microcontroller circuits since there is no physical connection between the microcontroller and the outside world. The only connection is a beam of light. Besides providing isolation, optoisolators provide a convenient way to interface higher voltages and AC to microcontroller inputs.
What is the output of the 4n32 optoisolator?
The red signal is the output of the 4N32 optoisolator and what the microcontroller input pin PO sees. The first thing to notice is the output is low only during the positive half cycle of the input. We will get one low pulse every 1/60 of a second in the US and 1/50 of a second in many other places of the world.
How to determine the collector current of an optoisolator?
Select the value for R1 to allow the current it can drive. Multiply that by the transfer ratio to find what the theoretical collector current will be. If this current is several times the saturation current (.4ma in the example above) you will be OK. You have a couple of options if the LED current multiplied by the transfer ratio is too low.
Why do you need a resistor for opto collector?
If you must run your circuit near the edge with a high value opto collector load, you might need to put in resistor from the opto pin from the transistor base to ground. The base pin is not connected in Figure 11-1. This resistor will help to keep the transistor or Darlington pair turned off when no signal is present.
What is the voltage isolation of an opto?
Since there is no physical connection between the transistor and the LED, there is excellent voltage isolation. The opto will provide isolation of 1500V or more depending on the device selected. A number of companies make optoisolators. A common family is the 4N3x series.
How to connect an opto led to a microcontroller?
A simple way to do that is to connect a low voltage UL rated wall transformer to the opto LED. For this example assume that we picked a 12V AC wall transformer. It is important we used an AC version instead of the more common DC wall wart because we want to see each cycle of the AC.