Part 2: Opto-Isolated Transistor Drivers for Arduino Micro-Controllers

In part 1 we looked at a number of bipolar transistor and MOSFET driver circuits. They had a flaw of having to be electrically connected to low voltage digital circuits. With opto-isolators we can sever this connection including the higher-voltage power supplies totally from the low-voltage digital circuits if desired. In fact we can even change the polarity of the higher voltage supplies without regards to the digital circuits common negative grounds/commons if we desire. See Part 1.

On the left is basic opto-coupler (or opto-isolator) the voltage at Vo is at Vcc with S1 open. When S1 is closed the infra-red light from light emitting diode D1 falling on the base of Q1 causes it to conduct to ground like a switch. The voltage at Vo drops to zero. Q1 is an NPN bipolar photo transistor and both the LED and transistor are often one part. Again an important note is the output has no electrical connection to the input and can hold up to several thousand volts. Also see More sample circuits.



The output transistor of a 4N25 is still a low power device, so we
must use it to to drive higher power components.



Here we drive a NPN Darlinton power transistor. With a gain of
1000 very little base current is needed to be switched though
the 4N25. The TIP120 has a maximum base current (Ib) of 150 mA
while the 4N25 has a maximum collector current of 150 mA. R2
can be 5600-10,000 ohms.



Here we switch a N-channel MOSFET to "sink" the load.
R3 can be 100K ohms.



In these two examples we sever the 24 volt supply totally
from the digital circuits. In fact we could have done this
with all of the circuits on this page. Here we switch on a
P-channel power MOSFET to "source" the load. R6 = 10K
and BATT2 is limited to 30 volts because of the 4N25.



Same as above except we use a PNP Darlington.


[ My Homepage ] [ Electronics Mainpage ]

PDF files and spec sheets


Read this safety warning and Disclaimer

[ My Homepage ] [ Electronics Mainpage ]

Added February 2009: Using a CdS Photo resistor. How to use photocells and touches on comparators, thermistors, relays, etc. Includes circuits to build and test.


Arduino demos April 30, 2009:
Using the ATMEGA168/Arduino with a 24LC08 Serial EEPROM
Using the ATMEGA168/Arduino with a DS1307 Real Time Clock
More to come. this will include using the MCP23016 I2C I/O Expander and several simple demo projects for robotics and power control.

Atmega168/Arduino features:
14k flash program storage
1k RAM for program memory
6 PWM outputs
6 A/D inputs
UART and SPI interfaces
2 Hardware interrupts
20 general purpose I/O pins (shared with PWM and Analog pins)
16 MHz RISC microcontroller
Open-source hardware, IDE, bootloader
Easy upgrade to more powerful hardware (Wiring)
Easy to use and learn.

Visitors since
March 2002