Level shifting - transistor type selection

Thread Starter

mondo90

Joined May 16, 2025
122
Hi,

In the diagram presented below I wonder if transistor Q7 can be changed to NPN transistor with its collector connected to R4 and emitter connected to R5, in other words oriented in a way Q8 is. The role of Q7 is to provide a wider voltage swing because the preceding stage is limited due to Q5 collector-base close voltage range. So Q7 as it is on the diagram can swing from ~14V to ~(-12V). However it looks like I can accomplish the same with Q7 being an NPN transistor, am I right?

1756145262378.png

Thanks.
 
Last edited:

drjohsmith

Joined Dec 13, 2021
1,549
Hi,

In the diagram presented below I wonder if transistor Q7 can be changed to NPN transistor with its collector connected to R4 and emitter connected to R5, in other words oriented in a way Q8 is. The role of Q7 is to provide a wider voltage swing because the preceding stage is limited due to Q5 collector-base close voltage range. So Q7 as it is on the diagram can swing from ~14V to ~(-12V). However it looks like I can accomplish the same with Q7 being an NPN transistor, am I right?

View attachment 354777

Thanks.
this is the circuit from a chip ?
it relies upon the current mirrors being balance , how are you going to ensure that ?
can I suggest you get to use a simulator , and try?
 

MrChips

Joined Oct 2, 2009
34,628
Hi,

In the diagram presented below I wonder if transistor Q7 can be changed to NPN transistor with its collector connected to R4 and emitter connected to R5, in other words oriented in a way Q8 is. The role of Q7 is to provide a wider voltage swing because the preceding stage is limited due to Q5 collector-base close voltage range. So Q7 as it is on the diagram can swing from ~14V to ~(-12V). However it looks like I can accomplish the same with Q7 being an NPN transistor, am I right?

Thanks.
No. I think the DC bias and logic will be wrong. I have not fully analyzed the circuit but a common emitter circuit is inverting where as an emitter follower is non-inverting.
 

Ian0

Joined Aug 7, 2020
13,097
Unfortunately not, because you are limited to the voltage swing at the output of Q5, and that cannot get below the input voltage.
 

Thread Starter

mondo90

Joined May 16, 2025
122
Unfortunately not, because you are limited to the voltage swing at the output of Q5, and that cannot get below the input voltage.
I agree but the output of Q5 can not get below the input voltage regardless if what type of transistor Q7 is. So how is PNP better here?
 

Ian0

Joined Aug 7, 2020
13,097
I agree but the output of Q5 can not get below the input voltage regardless if what type of transistor Q7 is. So how is PNP better here?
Because as an emitter follower, the output voltage (at the emitter) has the same limitations as the base, but a common emitter amplifier can swing almost rail to rail on the collector.
 

Thread Starter

mondo90

Joined May 16, 2025
122
@Ian0, thanks I can see that. However I have another problem: when I take the differential output to the final output stage (the PNP transistor), I can't couple this signal to get a reasonable output. For the circuit
1756839951010.png
I get:
1756840020256.png

Green - Q5 base
Purple - Q2 collector

So as you can see the base voltage of Q5 exceeds the supply voltage, and the voltage across R10 resistors is completely distorted:
1756840219842.png

On the other hand if I remove C2 coupling capacitor, then Q5 base-emitter enforces the Q2 collector voltage to ~4.2V and entire differential stage is broken, producing this signal on Q5 base:
1756840386468.png

I am lost, how to get a correct output stage from this?

Thank you.
 

Ian0

Joined Aug 7, 2020
13,097
@Ian0, thanks I can see that. However I have another problem: when I take the differential output to the final output stage (the PNP transistor), I can't couple this signal to get a reasonable output. For the circuit
View attachment 355228
I get:
View attachment 355229

Green - Q5 base
Purple - Q2 collector

So as you can see the base voltage of Q5 exceeds the supply voltage, and the voltage across R10 resistors is completely distorted:
View attachment 355230

On the other hand if I remove C2 coupling capacitor, then Q5 base-emitter enforces the Q2 collector voltage to ~4.2V and entire differential stage is broken, producing this signal on Q5 base:
View attachment 355231

I am lost, how to get a correct output stage from this?

Thank you.
Replace C2 by a short circuit. . .
. . but you need a careful choice of R3, so it runs with fairly equal currents in Q1 and Q2, when you have Q5 base current being supplied by one and not the other.
It makes things simpler if you just replace R2 and R3 by a current mirror - then you don't have to worry about getting the right value, and it works even if the tail current (i.e. the current supplied by Q3) varies AND you get a lot more gain (and what's not to like about lots more gain?)
 

Thread Starter

mondo90

Joined May 16, 2025
122
Yes good suggestions, thank you! Also, if I replace BJTs with MOS then the problem of unequal current in Q1/Q2 is gone right?
 

Ian0

Joined Aug 7, 2020
13,097
Unfortunately not. It needs to get just enough voltage on the MOSFET gate for its drain current to make the voltage across R10 equal half supply. That requires a certain amount of current through R3. The LTP is only in balance if that current is exactly half the current through Q3. The LTP will work with the transistor currents out of balance, but you can't push it too far.
Obviously, if the current required through R3 is more than the current through Q3 then it's not going to work!
 

Thread Starter

mondo90

Joined May 16, 2025
122
Ok, I think it makes sense. I have modified the circuit and replaced the bare resistors with a current mirror formed by Q6 and A7:
1756846730182.png
As expected, now both differential collector show the same waveform. In addition there is a gain of 1.6 (not much but also the input voltage is low comparing to input signal). However I have a problem now, with the DC offset: 8 ohm resistance models a speaker load, but as it is, it has a large DC offset I try to eliminate. For this I tried to decouple it with a capacitor at the Q5 collector, however this completely ruins the gain despite the fact I also offset it with a large resistance hoping all the current will follow the lower resistance path. What's wrong?
1756847063709.png
 

Ian0

Joined Aug 7, 2020
13,097
At the moment, you are asking the 10k resistor to deliver the negative-going part of the waveform to the 8Ω load, and I'm sure you realise, it isn't going to get very far.
You can only drive an 8Ω load with that circuit if R10 were MUCH lower than the load resistance.
But what you have now is an improvement: you now have got an output voltage than can swing the whole of your power supply, but it is at quite a high impedance (10k). You need that voltage swing and you need to make it able to supply enough current to drive the loudspeaker. For that you need emitter followers, two of them, one in each direction.
By the way, the input and output for a current mirror is always on the collectors, so you need PNP transistors for Q6/Q7.
Another point - there's something weird about the generic NPN and PNP transistors in SPICE. You will get better results if you pick a real transistor from the list, say BC847B and BC857B.
 

Thread Starter

mondo90

Joined May 16, 2025
122
For that you need emitter followers, two of them, one in each direction.
Sounds like a push pull formed by NPN on the top and PNP on the bottom, yes I was thinking about it but here I was trying to go without it. Why? Because my differential pair already gives me ~1.6 gain, so I was hoping to just amplify once more to get maybe a gain of 3, 4 and take the signal part of it. But looks like I can't get it without the push pull config huh?
By the way, the input and output for a current mirror is always on the collectors, so you need PNP transistors for Q6/Q7.
Hmm, but it shouldn't make any difference right?


You can only drive an 8Ω load with that circuit if R10 were MUCH lower than the load resistance.
Another point - there's something weird about the generic NPN and PNP transistors in SPICE. You will get better results if you pick a real transistor from the list, say BC847B and BC857B.
Good points, I agree.
 

Thread Starter

mondo90

Joined May 16, 2025
122
I have updated my diagram to include a push pull stage but I am unable to get the "rail to rail" swing you mentioned:

1756861008087.png

Green - base of Q8
White - base of Q9
Red - C3 voltage

Not only is the output amplitude very low but also distorted. I understand the rail to rail is impossible due to BE junction drop of ~0.7 but I should still be able to accomplish ~3V P2P output from it.
 
Since you take the signal for Q5 from Q2 collector (not Q1) the whole amp work as inverter.
You should take the signal from Q1 collector to not invert the phase.

Using the R10 to pulling 8ohm speaker to Gnd is not sufficient because it is too high impedance. Use transistor instead the R10.

Btw, you didn’t implement a feedback so now the amp is open-looped. It has too much gain(which is ok) but the output will be always clamped to one rail.
Use Q2 base as feedback input.
 

Thread Starter

mondo90

Joined May 16, 2025
122
Since you take the signal for Q5 from Q2 collector (not Q1) the whole amp work as inverter.
I know but this is not that important for now, the gain is.

I just can't get this shi** work in LTspicie... I tried:
1756871156295.png

An here obviously the output is limited 4 times so the gain is almost 0... Then I tried to use diodes between Q8/9 bases and the C2, this helped a bit but the gain is still very low and I can't get it any better... Then I tried voltage multiplier but I can't get it work either... the offset doesn't happen plus the input differential gain is distroyed... :(((
1756871088634.png

What is wrong here?

Btw, you didn’t implement a feedback so now the amp is open-looped. It has too much gain(which is ok) but the output will be always clamped to one rail.
Feedback is a good suggestion but once the basic gain is done.
 

Ian0

Joined Aug 7, 2020
13,097
With NPN transistors what you have done amounts to no more than putting a diode in series with the supply. There's no mirror action going on there at all.
 

Thread Starter

mondo90

Joined May 16, 2025
122
With NPN transistors what you have done amounts to no more than putting a diode in series with the supply. There's no mirror action going on there at all.
But my Q3 Q4 is NPN and it is fine? Also, what about those:
1756878365288.png

The current mirrors Q9,Q3 and Q6 are all made out of NPN transistors ain't they?
 

Ian0

Joined Aug 7, 2020
13,097
But my Q3 Q4 is NPN and it is fine? Also, what about those:
View attachment 355273

The current mirrors Q9,Q3 and Q6 are all made out of NPN transistors ain't they?
Of course they are, that is because they connect to the negative supply.
The current mirror is a COMMON EMITTER circuit.
If you want a current mirror on the positive supply, it needs PNP transistors, because the inputs and outputs are on the collectors, and the collectors need to be connected to AC earth (a DC power supply rail)
 
Last edited:

Thread Starter

mondo90

Joined May 16, 2025
122
@Ian0, thanks I think you are right, I also noted that the current of Q6 and Q7 as it is on my diagram is not equal which proves your point, however I don't fully get it.
..and the collectors need to be connected to AC earth (a DC power supply rail)
On my diagram Q6 and Q7 ARE connected to the DC power supply, and if I replace them with PNPs they won't be anymore. So I am not sure if this statement is true. Likewise Q3 emitter and not collector is connected to the ground.

The only difference between Q6 and Q4 is that Q4 emitter sits at ground potential while Q6 emitter sees more impedance, why does it matter? I though the diode connected transistor will enforce base current in both cases. Also in both cases the voltage of the base will be > than emitters therefore I really don't see what the problem is.
 
Top