BJT current polarity (AKA, RS485 TX/RX indicator circuit)

Still learning BJTs… IMO, they’re a bit trickier than MOSFETs, but I’m trying to incorporate them more in designs to better understand how they work. Here’s my current dilemma (no pun intended).

I have an RS485 controller IC that uses a Driver Enable pin (H=Enabled) and a Driver Input pin (H/L sets data on the bus). I’d like to build an indicator LED that shows transmitted activity. I came up with the attached circuit, which works great in the simulator. (Top LED is forward biased from DI to ground, and lights green. Bottom LED is forward biased from Vcc to DI, and lights red. Representative of a typical 2-pin bi-color LED.)

When DE is LOW, the LED is off – no matter the state of DI. No current flows anywhere. Likewise, when DE is HIGH and DI is high-Z, no current flows (through the LED), so it’s off again. Great!

Now, when DI is HIGH, the simulator shows E at 3.21v, B at 3.85v, and C at 3.23v. Current flows from B->E and C->E. The green LED lights. The base is higher than the collector, but both are higher than the emitter. Does that pose a problem, or being a current-driven device, is everything cool?

When DI is LOW, the simulator shows E at 1.78v, B at 2.42v, and C at 1.77v. Current flows from B->E, but also from B->C. In the simulation, the red LED lights so I’m happy, but is this OK? Or is there a problem with sourcing current through the base and out the collector?

bjt-1.png

SirNickity:
Does that pose a problem, or being a current-driven device, is everything cool?

Everything's cool, for the stated reason.

SirNickity:
When DI is LOW, the simulator shows E at 1.78v, B at 2.42v, and C at 1.77v. Current flows from B->E, but also from B->C. In the simulation, the red LED lights so I'm happy, but is this OK? Or is there a problem with sourcing current through the base and out the collector?

It's a diode so no current should flow backwards through it if a small negative voltage is applied. The datasheet will tell you the actual voltage limits for your transistor.

I see several voltage specs in the datasheet. Here's an example from one in my inventory (OnSemi P2N2222A NPN):

Collector--Emitter Voltage (VCEO) 40 Vdc
Collector--Base Voltage (VCBO) 75 Vdc
Emitter--Base Voltage (VEBO) 6.0 Vdc

If I understand this, the collector can be up to 40v higher than the emitter, and 75v higher than the base. The emitter can be a maximum of 6v higher than the base.

It does not say if or by how much the base can be higher than the emitter, which I would think is the usual case for an NPN, isn't it? Nor does it say if or by how much the base can be higher than the collector. (Unless that 75vDC can be either direction? There's no explicit polarity -- are you meant to assume only +vDC?)

As I said, I don't know much about BJTs, so I'm having some trouble making sense of these specifications in the data sheet.

Also, are the diode-like properties of the junctions always in effect, or does it change when the transistor is turned on by a base current? My simulator honors the isolation when there's no base current, but seems to allow current to flow either way through the C/E junction once base is lit up. I don't know if this is right or not. (Admittedly, it's not exactly a SPICE simulator, but generally it's accurate, if not idealistic.)

Sorry for the basic questions. :roll_eyes: Web searches have resulted in exhaustive detail about the physical makeup of BJTs, but not so much about how they conduct. For every two pages talking about doping and electrons and holes, there's one circuit diagram with a battery, transistor, resistor, and light bulb...

SirNickity:
It does not say if or by how much the base can be higher than the emitter

It's a diode so Base->Emitter is always a constant voltage drop, called VBEsat.

Somewhere there's also another value, IB, which specifies the maximum current.

Use Ohm's law to stay within sensible ranges (preferably not much more than VBEsat).

What isn't imediately obvious is that the two diodes, EB and BC are radically different,
the emitter diode is heavily doped with a very low reverse-breakdown voltage (sort
of like a zener for similar reasons), and its raison d'etre is to inject charge carriers
(electrons for an NPN, holes for PNP) into the base. Its quite easy to destroy a transistor
by exceeding the Vbe reverse rating.

The collector is less heavily doped and thus can withstand much higher reverse
voltage - its purpose is to provide a depletion layer that the charge carriers from the
emitter can diffuse into before recombining in the ultra-thin base region. That
depletion layer has a strong electric field across it to capture the carriers and
whisk them away to the collector. The two junctions have to be close enough that
electrons (or holes for PNP) can thermally diffuse between them with very high
probability.

Modern superbeta transistors have very precisely engineered doping profiles and
get to Vce(sat) of 50mV or better with high current gain (old power BJTs fail miserably
at this) - this is because the forward voltage of the BC diode has been engineered to be
a higher than the EB diode and doesn't sink any significant current from the base
(the limiting factor in saturation). This is precisely the effect your similator is showing,
unwanted current from base to collector.

fungus:
It's a diode so Base->Emitter is always a constant voltage drop, called VBEsat.

Somewhere there's also another value, IB, which specifies the maximum current.

Use Ohm's law to stay within sensible ranges (preferably not much more than VBEsat).

OK! That makes sense. The voltage through B->E can be anything (within reason -- perhaps same as C->E rating for rule of thumb) so long as the series resistance doesn't allow the current drawn to exceed its rating. Got it.

@Mark -- Thanks for the explanation. It's starting to make sense, although many of the physical aspects still don't mean much to me. (The obvious downside of being self-taught and having no formal training in theory to back it up.)

Regarding this:

MarkT:
Modern superbeta transistors have very precisely engineered doping profiles and get to Vce(sat) of 50mV or better with high current gain - this is because the forward voltage of the BC diode has been engineered to be a higher than the EB diode and doesn't sink any significant current from the base (the limiting factor in saturation). This is precisely the effect your similator is showing, unwanted current from base to collector.

When you say "unwanted current from base to collector"... My circuit actually takes advantage of this. Does "unwanted" mean "transistor-killing", or just what is usually nuisance leakage? The reverse voltage here isn't much, but I'm pulling 7mA from base through collector with the values in the schematic. That seems enough for an indicator... but what about 20mA?

I'm inclined to try this on a breadboard, but 1) I don't have many BJT transistors on-hand, and would hate to smoke one needlessly; and 2) just because it works for ten minutes doesn't mean it'll work for 5 years.

If it helps, here’s an animated GIF of the circuit in simulation, doing exactly what I want it to do. If this is acceptable practice in a real circuit, I’m golden.

bjt-anim.gif

I took the cricket chirping as uncertainty and decided to give this a try... for SCIENCE! XD

I have a breadboard with an ATtiny13 driving a BC549, and the little bicolor LED is flashing red/green in a festive display of randomness. So far, no smoke.

I'll try to leave it running overnight and check back in the morning afternoon. If I don't catch the house on fire, I guess it can be considered a usable circuit! I'll report back later... I hope. If not, well, it's been nice knowing you guys!

I’ve tweaked the circuit a bit more to lower the parts count and balance the current through the LED in forward and reverse conditions to between 5-6mA. (Assuming 2.0v Vf red, and 2.1v Vf green.) Also designed (and tested) an opposite polarity enable input since the receive enable is inverted compared to driver enable on the DS/MAX485.

Seems to work swimmingly! If anyone is looking for a simple TX/RX indicator for RS-485 driver ICs, I think this will do the trick. I used whatever NPN/PNP transistors I had lying around – On Semi BC549 NPN and Fairchild BC640 PNP in my case, but it doesn’t seem to matter much. No difference in simulation for 30-1000 hfe.

rs485txrx.png