1
\$\begingroup\$

I designed this circuit (shown below) to level shift an input PWM (10 kHz 5% duty) signal (from microcontroller, 0/+3V3) to 0 and -12V. When the input PWM is HIGH (+3V3) the output is at 0V while when the PWM is LOW (0V) the output is at -12V.

CCT

The circuit operation (actual response graph) can be seen below;

actual response

I wish to improve the circuit response hence matching the desired response graph (shown below). I also wish to stay limited to the basic components i.e., resistors, capacitors, transistors (2N3904/2N3906) and opto-couplers (4N25/4N26/4N33). I also need to keep isolation and a small duty cycle PWM input (<= 5%).

desired response

Any tips/design changes are greatly apricated, Thanks.

\$\endgroup\$
6
  • \$\begingroup\$ These are pretty short pulses for an optocoupler \$\endgroup\$
    – po.pe
    May 11 at 10:07
  • \$\begingroup\$ @po.pe, I agree. I increased the duty cycle to 10% and the circuit behaved somewhat better. To be more realistic, isolation is not critical for this design (I did it to safeguard my micro from mistakes since working with -12V, etc), do you think that if I remove the 4N25 and replace with a 2N3904 I would get a better response like in the "desired response" graph while keeping with the <= 5% PWM? Thanks. \$\endgroup\$
    – onlooker
    May 11 at 11:02
  • \$\begingroup\$ The suggestions below about replacing the opto make sense. But have you probed the output of the opto to see if that's what's limiting your speed? \$\endgroup\$
    – SteveSh
    May 11 at 11:26
  • \$\begingroup\$ @SteveSh, Not yet, I am still simulating, hence trying to find the optimal solution without buying any parts. Do you think that the 4N25 is the main limiting factor for this? \$\endgroup\$
    – onlooker
    May 11 at 11:50
  • \$\begingroup\$ Ahhh, OK. I thought the picture were actual 'scope captures. In this case, put a simulation probe on pin 5 of the opto. \$\endgroup\$
    – SteveSh
    May 11 at 11:52
1
\$\begingroup\$

If you replace the 4N25 with a logic-output optoisolator such as the TLP2363 (there are various others, some of them with second sources) you will improve the performance. Internally, they use an IC chip with a photodiode, rather than a phototransistor.

Compare the switching time of the 4N25 with your load of a few hundred ohms (from this datasheet):

enter image description here

Your pulse width at 5%/10kHz is 5us, so the switching time is nowhere near fast enough to get an output pulse that resembles the input pulse.


Edit: If you don't need isolation, the opto-isolator is not doing much useful.

Also, the 33 ohm resistor dissipates more than 4W when on, which could be an issue if the resistor is not capable of that much pulsed (or in a fault state, continuous) power.

Here is a similar circuit with MOSFETs. You can add a CMOS inverter in front of the circuit if you want to retain the same logic as you have now.

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ Thanks for your answer! So, did I understand you correctly, I will get an output pulse if I increase the PWM switching frequency? I apricate the fact that you provided the above solutions but as mentioned above I wish to use components that I have available. \$\endgroup\$
    – onlooker
    May 11 at 12:07
  • \$\begingroup\$ Decrease the PWM frequency and thus lengthen the pulse (while still keeping 5% duty cycle) will help with your current circuit. Getting rid of the 4N25 will help a lot. \$\endgroup\$ May 11 at 12:09
  • \$\begingroup\$ Agreed, I reduced the PWM frequency to 5 kHz and obtained better results (much better), Thanks! Unfortunately, the PWM frequency has to be >= 10 kHz since with this I am sampling a fixed 1 kHz sinusoidal signal, hence lowering the PWM frequency is not an option, while, yes removing the 4N25 is an option. By any chance, do you know how I can isolate the microcontroller pin without optocouplers, if possible? \$\endgroup\$
    – onlooker
    May 11 at 12:25
  • 1
    \$\begingroup\$ There are many ways of doing isolation, but if you just want protection take a series resistor of value X (say 1K) from the MCU pin to your circuit with non-5V rail(s), split it in 2 (say 510+510) and connect the junction to ground through a 5V unipolar TVS or zener diode. \$\endgroup\$ May 11 at 13:10
  • \$\begingroup\$ All right, thanks for the idea. Much apricated! \$\endgroup\$
    – onlooker
    May 11 at 13:49
1
\$\begingroup\$

IF you simulate with the 4N25 you can achieve what you want.

When you saturate Vce the hFE drops towards 10% of a very low CTR already.

This emitter follower offers the high current gain you required. In some ways, it is overkill.

enter image description here

The 22R is optional and only affects the 0V output level by ~ 100mV.
The -12V level is exact as the driver cuts off with low current levels.

\$\endgroup\$
8
  • \$\begingroup\$ How closely do you think that simulation might reflect reality? \$\endgroup\$ May 11 at 14:04
  • \$\begingroup\$ Hi @Tony Stewart EE75, first of all thanks for your solution. So, I built your proposed circuit (see this link), Unfortunately it didn’t work as yours (see this link). I am using Proteus 8.10 SP3 to simulate, any idea what’s causing this? Shall I try the circuit in hardware? \$\endgroup\$
    – onlooker
    May 11 at 14:06
  • 1
    \$\begingroup\$ I guess not at all @Spehro Pefhany \$\endgroup\$
    – onlooker
    May 11 at 14:07
  • 1
    \$\begingroup\$ Try this tinyurl.com/yeakanyu \$\endgroup\$ May 11 at 14:32
  • \$\begingroup\$ @TonyStewartEE75 it worked kind off, please see the following links (ibb.co/fDhGN7w and ibb.co/Dttd4D2). I had to change the 1 kOhms resistor to 4.7 kOhms. Can you kindly explain what the res/cap network is doing at the input of the 4N25? Thanks! \$\endgroup\$
    – onlooker
    May 11 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.