Electronic – how to reduce turn-off delay time of PNP transistor

opto-isolatortransistors

I am having tough time while driving PNP transistor with optocoupler to generate 1KHZ PWM signal. my circuit consists of micro controller which will generate 1KHZ pwm signal which will go to base of PNP transistor(Q2) and the collector terminal of PNP transistor(Q2) will go to optocoupler input. and the optocoupler collector terminal is going to base of PNP transistor(Q1). the collector terminal of PNP transistor(Q1) is going to microcontroller pin. when i probe at micro pin or Q1 transistor collector the turn off time i am seeing 400ms. because of this i am getting error in PWM signal measurement which is 1KHZ.

output of R4 is connected to micro controller in the below circuit but not grounded like below

enter image description here

Best Answer

Your circuit is slow because of the way you are using the optoisolator.

enter image description here

Because of the gain of the transistor, the effective load at turn-off is more than 1M\$\Omega\$, so you can extrapolate the curves to see what kind of trouble that causes.

So reduce the load resistance to something like 1K and your error will be greatly reduced.

Here is your circuit, changed about as little as makes sense, which behaves much better:

enter image description here

I've increased the optoisolator LED drive current (to about 4x the load current to account for the minimum 50% CTR, aging and temperature), and increased the load current to speed up the response.