failed RS-232 level converter :(

bahstrike

Oct 31, 2008
82
Joined
Oct 31, 2008
Messages
82
I have a circuit that already provides +12 and -12 volt supplies.
The microcontroller Vdd is 3.3v.

I tried designing a transistor / resistor system to handle the invert and voltage shifts, without using a MAX232, but unfortunately it does not work..  It overheats and I could only salvage the rest of the system by snipping off these transistors.

Before I ordered the PCBs I tested the design in LTSPICE and sure enough the TTL <-> RS232 voltage shift and invert worked great, but admittedly I didn't check the current running through the components...  simulating again I see that the lower-right-most transistor has 1.1A running through collector-emitter..

Attached is the schematic..  what did I fail to anticipate?  I'm now thinking I only need some strategically placed diodes to prevent mis-bias the transistor bases.

View attachment 41451

 

Hero999

Oct 28, 2007
2,433
Joined
Oct 28, 2007
Messages
2,433
The transistors are biased so when there's no signal, they're all on. It looks like you've forgotten that a transistor's base is just a diode which will pass current. Look at the current flowing hrough the PNP transistor bases to the NPN transistors.

 

bahstrike

Oct 31, 2008
82
Joined
Oct 31, 2008
Messages
82
I was under the impression that if base voltage is equal to emitter voltage, the transistor is totally off and the collector is essentially high-Z.

That's why I have pull-ups on base-emitter of most transistors.



So you're saying that I basically have current flowing from pull-up of transistor A,  through its base/collector,  and then through the pull-up of transistor B..  and that's enough to establish an "on"  on transistor B,  because its base is also connected to this pathway?

I actually shot myself in the foot by adding all these  "safety" pull-ups?

But luckily, maybe the whole design can still work by just leaving out the pull-ups?


Back to LTSPICE to test this theory..  I'll be so relieved if that's all it is!

 

Hero999

Oct 28, 2007
2,433
Joined
Oct 28, 2007
Messages
2,433
Here are a couple ways to do it.

V1 is more complicated and it has the disadvantage of both output transistors being on simultaneously for a point during switching but it'll have virtually no saturation loss i.e. you'll get +/-15V out. V2 is simpler and has the advantage of not having both transistors on during switching but you loose 0.7V on either supply rail so with 15V in, you'll only get +/-14.3V out.

View attachment 41453

View attachment 41454

 

bahstrike

Oct 31, 2008
82
Joined
Oct 31, 2008
Messages
82
Thank you Hero, I really like V2 for the benefit of no switching waste.  I'll try that design with my next attempt at a DC->AC  coil driver, where higher currents are necessary.


From simulating, my existing receiver  (RS232 -> TTL)  should work OK with ~8mA maximum switch waste (on output).


For the transmitter  (TTL -> RS232)  it looks like I can use my existing PCB layout by hacking on one new resistor, changing a couple resistor values, and removing the pull-ups and base resistors at each transistor-to-transistor.  For now, I have to stick to the original layout as much as possible since I foolishly already ordered 12 PCBs!!  This solution should work properly with only a ~40uA maximum switch waste (on output).

View attachment 41455

 

Hero999

Oct 28, 2007
2,433
Joined
Oct 28, 2007
Messages
2,433
You need a low value pull-down resistor on the input, otherwise when there's no signal Q1 and Q4 will turn on, allowing current through Q2 and Q5 which will cause Q3 and Q6 to turn on and short circuit the power supply.

There will be switching waste because Q3 and Q6 will both turn on simultaneously when the input voltage changes from 0V to 3.3V.

Here's another idea which you should be able to cobble together on the existing PCB.

View attachment 41456

 
Last edited by a moderator:

TomTang1

May 27, 2011
10
Joined
May 27, 2011
Messages
10
I don't  think there are some issues in the schematic . or you test its input line and output line separately and measure it by osc

Moderator edit: spam link removed

 
Last edited by a moderator:
Top