Specifications

Chapter 6 - Samples
Connecting the optocoupler and relay to a microcontroller
A relay can also be activated via an optocoupler which at the same time amplifies the current
related to the output of the microcontroller and provides a high degree of isolation. High current
optocouplers usually contain a 'darlington' output transistor to provide high output current.
Connecting via an optocoupler is recommended especially for microcontroller applications, where
motors are activated as the commutator noise from the motor can get back to the microcontroller
via the supply lines. The optocoupler drives a relay and the relay activates the motor.
The figure below shows the program needed to activate the relay, and includes some of the
already discussed macros.
http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_06Poglavlje.htm (2 of 4) [4/2/2003 16:18:54]