# Need help with LTspice

1. Sep 20, 2010

### hayowazzup

Does anyone know how to measure the input and output impedance of a bjt circuit on Ltspice???? eg. a circuit like this

2. Sep 20, 2010

### vk6kro

You can if you have actual component values.

You just put a resistor in series with the input to get the input impedance.
Try 10 K. Then the input will be reduced according to the input impedance.

You could calculate it or keep changing the resistor until the voltage is halved.
If the two voltages are not in phase, you might need to consider reactive components.
This could happen in this circuit as you have a capacitor in the feedback line.

The output impedance can be estimated by putting a resistor across the output to ground. Measure the gain with and without this resistor.
A resistor that halves the output will be equal to the output impedance. It is usually something like the resistance of the collector resistor.

3. Sep 20, 2010

### hayowazzup

I just tried it on Ltspice but there's something I still dun understand ..does this have to be done in ac analysis with ac amplitude?
And also will this method also work on circuits such as oscillator,opamp etc?

4. Sep 20, 2010

### vk6kro

You could use transient analysis. This would tell you if the output was getting distorted. Look for "simulate" then "edit simulation cmd" then "transient".
Use an oscillator set to 1000 Hz with 50 mV out and a stop time of 5 mS.

Just measure the peak to peak value of the sine waves and calculate the ratio of them.

I think the 10 K I suggested is probably too high for typical components. Try 1 K.

You could test the output impedance of opamps like that but testing the input Z would depend on the circuit. Adding resistors to the input may upset the operation of the opamp.

I suppose you could test the output impedance of oscillators by loading them with resistance although it may affect the oscillation.

5. Sep 20, 2010

### hayowazzup

So I guess by putting 1k in series then I could just measure the Vin p-p and use the voltage divider rule to solve for Rin?hmm I tried it but it doesn't seem to work.

Last edited: Sep 20, 2010
6. Sep 20, 2010

### vk6kro

Yes, I think you have done it wrongly.

You are measuring DC voltages, but there is a capacitor C1 in series with the input.

Just put a 1K in series with the capacitor (on the left of it) and measure the voltages on each side of the resistor.

7. Sep 20, 2010

### hayowazzup

I have tried it with voltage divider rule but when I put the Rin value back at the resistor it measures 0.64 of the voltage source, is that normal?

8. Sep 20, 2010

### vk6kro

Could be.

Which resistor did you use as the series one? What were the values of the bias resistors and the capacitors.

I guess you measured voltage with respect to ground, did you?

If it was 64% getting to the capacitor, and 1000 ohms you could say the input impedance was 1000 * 64 / 36

9. Sep 20, 2010

### hayowazzup

This is actually the circuit I am working on
[PLAIN]http://img96.imageshack.us/img96/8237/bjt1.jpg [Broken]

I've chosen the first two peaks to measure.

P-P voltage 2.58 - (-1.207) = 3.845mV

so 3.845 = (R/(1000+R) * 100 => R = 39.9875 Ohms

[PLAIN]http://img713.imageshack.us/img713/6051/bjt2.jpg [Broken]

P-P voltage 28.12 - (-36.38) = 64.5mV

Maybe I should pick a larger capacitor value?

Last edited by a moderator: May 4, 2017
10. Sep 20, 2010

### vk6kro

So, you have 64.5 mV on one side of the 1K resistor (to ground) and 3.845 mV on the other side (to ground). Is that right? I couldn't see where some of your figures were coming from.

If so, I make that about 63.3 ohms input impedance.

This happened because you changed the circuit. You now have a lot of signal current coming back from the output to the base and this makes the input impedance low.

You should try putting a large capacitor (10 uF) at the junction of R1 and R4, to ground. This should remove most of this feedback. This was the function of C3 in the previous circuit.

In your circuit, you changed the value of the series resistor. You need to take two readings: across the input signal and from the other side of the 1 K resistor to ground.

[PLAIN]http://dl.dropbox.com/u/4222062/input%20Z.PNG [Broken]

So, from each of the points with a red arrow pointing at it, to ground

Note the capacitor added as well.

Last edited by a moderator: May 4, 2017
11. Sep 20, 2010

### skeptic2

We RF engineers do things a little differently. We like to measure impedances with all the inputs and outputs terminated the way they will be when the circuit is operating. If we don't, the circuit will most likely oscillate. So for me, the first thing I notice is that there is no load in the circuit. If we measure the impedance this way, it may change when a load is connected. What is the expected load when the circuit is operating?

Nevertheless, if we are to measure the input impedance of the circuit as it is, it seems to me the most logical way to do it is to plot the AC voltage at the left of C1 divided by the AC current through C1. There are different ways of doing this and I'm not familiar with LTSpice, so you'll have to find the right commands.

You may be able to use Mag(V(n007))/Mag(I(C1)) or VM(V(n007))/IM(I(C1)) or RMS(V(n007))/RMS(I(C1)), or something similar.

12. Sep 20, 2010

### vk6kro

The idea of measuring the input current is good and easily done with LT Spice.

It would be available just by left-clicking on the capacitor in the circuit diagram after a simulation has been run.

13. Sep 21, 2010

### skeptic2

For example, I entered the circuit into PSPICE and not having a model for the BF199, I used the 2N2222. In order to get the output into the linear region I also had to change R2 to 390 K ohms. To begin with, I put a 1 meg resistor from C2 to ground. The input impedance was, using the method I suggested was about 10 K ohms. Then I reduced the resistor on C2 to 1k ohm and the input impedance dropped to about 31 ohms.

14. Sep 21, 2010

### vk6kro

I tried that with a 2N2222 and got very different results. I had to use 400 K as the bias resistor, too.

Without the extra 1K resistor, the input impedance was 952 ohms. When it was added I got 1176 ohms. Not a lot of difference, but an increase.

I would expect this, too, because the extra resistor drops the total gain and hence the current feedback is reduced.

However, this is not the point of the exercise. The circuit should remain as it was originally proposed. If you change it, it is a different problem.

I substituted a 2N3646 which has a much lower current gain (only 86) and this allowed me to reduce the bias resistor to 100 K. The input impedance was then 303 ohms.

If you still have the model, could you try this again?

15. Sep 21, 2010

### skeptic2

Yes, I made a mistake in my example. Now I'm getting 2.4K for both the 1K and the 1meg resistor.

16. Sep 21, 2010

### hayowazzup

thanks alot for the replies above. I really appreciate it.
by the way, I have a question that's unrelated to the topic.
Is it possible to bias the bjt so that the output voltage can have a voltage gain of 20 (2V peak to peak AC) from a 100mV p-p signal ? I tried changing the resistors value so many times on ltspice but still couldn't get a linear 2V peak to peak ac at the output.

Last edited: Sep 21, 2010
17. Sep 21, 2010

### vk6kro

For exact voltage gains, you may need to look at op amps.

However, you can approximate the result like this:

[PLAIN]http://dl.dropbox.com/u/4222062/X20%20amp.PNG [Broken]

The gain is roughly the ratio of R5 / R2. Because R5 is in parallel with the output resistance of the transistor, R5 has to be a bit bigger than this formula.

Having an emitter resistor improves the input impedance of the amplifier too. It is about 10 K as shown.

Last edited by a moderator: May 4, 2017
18. Sep 21, 2010

### skeptic2

I have a textbook about transistors that talks about transistor gain. It says that current gain is limited to beta but voltage gain can be much greater than beta. What if failed to mention is that voltage gain greater than beta comes from impedance transformation and it is no more real than voltage gain with a transformer. The gain isn't real because you can't cascade two such stages and expect to that amount of gain squared, because the output to input impedance is mismatched. You can also get current gain greater than beta by transforming the output impedance to less than the input impedance.

Also amplifier gain doesn't have to be a unitless number. Tube gain was often given as current out over voltage in or mhos (ohms backwards, now called siemens) on the other hand a transistor amplifier that produces 1 volt output change for every 10 mA change in input, could be said to have a gain of 100 ohms.

19. Sep 21, 2010

### vk6kro

If you cascade two of the amplifiers above, the input impedance of the second one becomes part of the load of the first. So, if it was 10 K in, the load on the first one would be about 3 K and the gain would drop to a bit less than 13.

The second stage would still have a gain of 20, though, so the total gain would be a fairly predictable 260.
It is a very real gain. It would produce 2.6 volts p-p from a low output microphone, for example.

You can get voltage gains greater than Beta. Beta is a current gain, not a voltage gain.

Signal current through a resistor produces a signal voltage of IR, just like Ohm's Law.
So the voltage produced depends on the resistance as well as the current.

While you could probably get a voltage gain of 260 with one 2N2222, much better bandwidth is available if you produce it in two or more stages.

20. Sep 22, 2010

### skeptic2

Yes you can get voltage gains greater than beta just as with a transformer you can get voltage gains of greater than one. And yes beta is a current gain figure.

How does current gain translate into voltage gain? You can divide the input voltage by the input impedance to find the input current. Then multiply the input current by beta to find output current. Lastly multiply output current by output impedance to get output voltage. What voltage gain would you have if input and output impedances are equal? Of course voltage gain benefits if the output impedance is higher than the input impedance. However if two such stage are cascaded, the voltage gain due to a change in impedance is lost because of the mismatch between stages. My point is that any voltage gain due to an increase output impedance over input impedance is only useful for high impedance loads, and is not any different than voltage gain in a transformer. Such gain cannot be used in multistage amplifiers.

Can you show me an example of an amplifier with equal input and output impedances and a voltage gain greater than beta? If you look at the amplifier in terms of maximum power gain, things may be a little clearer.

In your example, I don't think you are claiming the beta of the transistor is less than 13 or even 20. The problem with claiming that a single amplifier stage has a gain of 260 (which I see no problem in doing) is that the next step is to add another identical stage and expect to get a total voltage gain of 67,600.