Can't Control the Base Current in optoIsolator - PIC16F877A

Thread Starter


Joined Mar 18, 2010
Its my first time of using optoIsolator. I have connected a PIC MCU to Control the External DC motor through it.
The problem is; I am not able to control the Base current ! I don't know the Current Gain in OptoIsolator, i have somehow used transistors in the past.

So I have calculated the input current via --> [(Input-1.7(led))/130] = 25.3mA.
Now i am not able to guess the current at output Emitter of OptoIsolator. It gives me very less current (0.03mA) at the output. Its too low.

I have attached the Snapshot of the circuit herwith.


Joined Mar 14, 2008
The output of the opto feeds the base of an emitter follower transistor, whose base current equals the emitter current divided by the transistor current gain.
Assuming the transistor emitter voltage is about 12V when the opto is on, this gives an emitter current of 6ma.
Dividing the emitter current by the measured base current gives a transistor gain of 6mA/.03mA = 200 which is a high but reasonable gain for the transistor.
So there's nothing wrong with the circuit.

Thread Starter


Joined Mar 18, 2010
The Problem isn't with the 2nd transistor, It works fine, But why do the Opto gives me such a low current ?
I was anticipating the high current so that it can be further be increased Beta times (by the second transistor) to drive the DC motor.

25.3mA (Opto Input) > 0.03mA (Opto O/P)
I was expecting optoIsolator to be increasing the current NOT to decrease it by 99.88%


Joined Aug 23, 2012
I will using the circuit as below, the current for motor is 100 mA, if you want some more, then you can decrease the value of R3, R2 is providing a quick stop for the motor.

If the motor could afford 14V then you just shorted the D1 and D2, D3 used to protecting the motor from emf.



Joined Jan 6, 2004
Hola Tajiknomi,

Just for me to know: do you intend to control (I mean, adjust it) the current through the motor or you simply want switch it ON / OFF?

By the way, what simulation software is that? Most of the drawings I run across, they look weird. Not enough straight lines available? :)

Last time I had to use a 6-V relay with 9V, instead of using diodes as ScottWang is proposing (I like that) I calculated the resistor needed to create the necessary 3V drop.

Thread Starter


Joined Mar 18, 2010
Thanks for your kind replies. It helped.

I often works on micro controllers but what trouble me most is ---> "Circuit Designing". I often can't able to design a circuit for specific currents. I have read Circuit analysis, But i will go through this again.

If anyone can provide me OR Suggest me a good materiel which can help me to improve my knowledge in circuit designing. I will be very thankful.