Home school circuit analysis class suggestions needed

MrChips

Joined Oct 2, 2009
34,834
Something is not quite right with the simulation.

You should not be getting 0.9V across the base-emitter junction.
About 0.7V is expected.
 

WBahn

Joined Mar 31, 2012
32,891
I finally got around to simulating a 2N3904 NPN, like in post #95. This simulation uses actual models (not Eagle defaults) for the Red LED and the 2N3904. Most of it makes sense, 1.77V across LED. But what's up with the negative current?!?

View attachment 286056
All simulators that I know of, particularly SPICE-based ones, use the convention (which is consistent with most device manufacturers) that the current at a device pin is defined as the current flowing INTO the pin. For two-terminal devices, the current flowing through the device is defined as the current flowing into INTO pin #1. For voltage sources, pin 1 is pretty universally defined as the positive terminal. So your simulation is saying that you have -17.2 mA flowing into the positive terminal of V1, hence it's really 17.2 mA flowing out of that terminal.

If you were to measure the current at the transistor pins, you should find that the base and collector currents are positive and the emitter current is negative. For diodes, the anode is pin 1, so forward currents are conveniently positive.
 

MrChips

Joined Oct 2, 2009
34,834
Here is the simulation on CircuitMaker.

LED 2N3904 simulation.jpg
Base voltage is 0.746V.
It also gives 15.122mA flowing into collector of Q1 and -17.185mA flowing out of the emitter.
 

WBahn

Joined Mar 31, 2012
32,891
meter still works without the fuse.
I looked up your meter to see what it says about the specs. First I followed your link on Amazon and discovered immediately that the description is misleading and contradictory. They say in one spot that the meter cannot be used to measure AC current or capacitance, but further down they clearly indicate that these are functions it has. In another spot they claim that it can measure frequency and temperature, which is clearly not the case. I then looked up the manual and it doesn't say what any of the input or burden resistances are. But it does say that the fuse is easily replaceable similar to the battery.

I found a very informative review.

https://lygte-info.dk/review/DMMXL830L UK.html

It shows that, as you indicated, the fuse is soldered in and not easily accessible.

It also indicates that there is little to no overload protection, despite what the Amazon listing claims.

If that's the case, I would second their recommendation that this meter not be used to measure anything associated with mains voltage.

But, for what you are doing, it should be fine.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
821
R1 = 1kΩ, R2 = 1kΩ
R1 = 10kΩ, R2 = 1kΩ
R1 = 10kΩ, R2 = 10kΩ
R1 = 1kΩ, R2 = 10kΩ

R1 = 1MΩ, R2 = 1MΩ
R1 = 10MΩ, R2 = 1MΩ
R1 = 10MΩ, R2 = 10MΩ
R1 = 1MΩ, R2 = 10MΩ
I don't have 10M, so I substituted 100k.
2 meters: XL830L (1MΩ) and my 25 year old Radio Shack 22-168A (10MΩ)

1674693155539.png

BD5E36A9-AF18-4319-A85C-3E8076E976D0.jpeg

1k-10k on bottom rail, 1M-100k on top rail. R1 on left, R2 on right. 5.08v rail voltage.

Looks like the rule of thumb should be make sure your meter input impedance is >10x any resistors used in a voltage divider.

The 1.68 makes PERFECT sense, that's 5.08/3. Two resistors and the meter all in parallel.
 
Last edited:

Thread Starter

rpschultz

Joined Nov 23, 2022
821
Something is not quite right with the simulation.

You should not be getting 0.9V across the base-emitter junction.
About 0.7V is expected.
Probably just the LED NPN models used. We both get exactly the same emitter current (-17.185 mA). LED Vf is slightly different, mine is 1.77v, your is 1.82v.
 

WBahn

Joined Mar 31, 2012
32,891
Using the reading with the largest error, we can get an estimate of the internal resistance of your meter.

Assuming the resistors are perfect, as are the readings. The voltage that is read should be:

Vout = Vin (R2||Rm) / (R1 + R2||Rm)

Solving for Rm when R1=R2, you have

Rm = R·(Vin/Vout - 2)

Rm = 1 MΩ · ((5.08 V / 1.68 V) - 2) = 1.024 MΩ

Which agrees well with both what you said earlier and what the review measured.
 

MrChips

Joined Oct 2, 2009
34,834
Probably just the LED NPN models used. We both get exactly the same emitter current (-17.185 mA). LED Vf is slightly different, mine is 1.77v, your is 1.82v.
No. It does not depend on the model of the LED.
It is the forward voltage of the base-emitter junction of Q1 which behaves like a P-N silicon rectifier.
I removed R1 and LED from the circuit and left the collector not connected.
The simulation gives 0.721mV on the base of Q1.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
821
No. It does not depend on the model of the LED.
It is the forward voltage of the base-emitter junction of Q1 which behaves like a P-N silicon rectifier.
I removed R1 and LED from the circuit and left the collector not connected.
The simulation gives 0.721mV on the base of Q1.
Unfortunately, Eagle doesn't let me leave the collector unconnected.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
821
Try putting R1 = 1MΩ
or replace R1 with a capacitor.
1M, 10M, 1u, 100u, all give the same result. So maybe the 2N3904 model is not right? This is what I found on the internet:
.MODEL 2N3904 NPN(IS=5.42E-14 ISE=1.20E-15 ISC=1.08E-11 XTI=3.00
+ BF=3.00E2 BR=1.19E1 IKF=5.58E-2 IKR=1.00 XTB=1.5
+ VAF=2.88E2 VAR=4.18E1 VJE=3.33E-1 VJC=3.83E-1
+ RE=1.29E-2 RC=1.63 RB=1.51E2 RBM=1.00E-2 IRB=1.70E-3
+ CJE=8.54E-12 CJC=4.75E-12 XCJC=1.00 FC=5.00E-1
+ NF=1.09 NR=1.02 NE=1.25 NC=1.66 MJE=3.68E-1 MJC=4.02E-1
+ TF=1.58E-10 TR=238.3E-9 PTF=0 ITF=2.86E-4 VTF=1.90E-1 XTF=4.69
+ EG=1.11 KF=1E-9 AF=1
+ VCEO=40 ICRATING=100M)
.MODEL 2N3904 NPN

2N3904-graphic2.png
 

Thread Starter

rpschultz

Joined Nov 23, 2022
821
I added some ammeters. I think @WBahn is right about the convention of the current into/out of the battery.... which seems so counterintuitive to me.
2N3904-graphic3.png
 

MrChips

Joined Oct 2, 2009
34,834
There is something not quite right.
Voltage across R2 is V2 = I2 x R2 = 0.002 x 4700 = 9.4V
V2 + Vbe = 9.4 + 0.946 = 10.3V
Your supply voltage is V1 = 9V
 

WBahn

Joined Mar 31, 2012
32,891
There is something not quite right.
Voltage across R2 is V2 = I2 x R2 = 0.002 x 4700 = 9.4V
V2 + Vbe = 9.4 + 0.946 = 10.3V
Your supply voltage is V1 = 9V
Which is actually better than your CircuitMaker simulation.

Ie = 17.185 mA
Ic = 15.122 mA

Thus Ib = Ic - Ic = 2.063 mA

With a base voltage of 746 mV and a 4.7 kΩ base resistor, that yields a supply voltage of

Vcc = 746 mA + 2.063 mA · 4.7 kΩ = 10.442 V

I'm not too impressed with either of those simulators.

This is what LTSpice yields:

1674745085455.png
1674745121000.png

Vcc = 779.2 mV + 1.7491 mA · 4.7 kΩ = 9.0000 V
Ib = 20.808 mA - 19.059 mA = 1.749 mA

EDIT: The CircuitMaker and Eagle sim have the base resistor specified as 4k7, which to the simulator is just 4k, or 4 kΩ. The numbers make sense when that is accounted for.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,891
I think @WBahn is right about the convention of the current into/out of the battery.... which seems so counterintuitive to me.
It is counterintuitive. The thing to remember is that the simulator has to define a direction for all currents and it has to do it in a way that is consistent for all devices. To the simulator, a source is just another component with pins.

One thing to keep in mind is that this applies to non-polarized components, such as resistors, inductors, and capacitors, as well. I've seen people misinterpret results because the simulator told them the current in a resistor was some value and they just blindly used that in their analysis despite it being pretty obvious that the simulator's polarity was opposite what they were assuming. While I haven't done it for LTSpice (yet), when I was doing IC design I made my own library symbols for resistors and capacitors (and inductors, even though we almost never used them) that had tiny tick marks on the pin 1 side so that I could orient them to match the current polarities I wanted.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
821
It doesn't seem to take 4k7 the same as 4.7k, actually I think - Eagle thinks - 4k7 is simply 4000, it ignores the 7. So this math works out better, although it's still a different Vbe than yours.

2N3904-graphic3.png
 

WBahn

Joined Mar 31, 2012
32,891
It doesn't seem to take 4k7 the same as 4.7k, actually I think - Eagle thinks - 4k7 is simply 4000, it ignores the 7. So this math works out better, although it's still a different Vbe than yours.

View attachment 286108
You are correct. I didn't catch that, and I really should have.

This almost certainly explains the discrepancies with MrChip's simulation, too.

Another thing to watch out for is that (if it's like most simulators), if you put a space in there it will ignore it. So 4.7 k will just be seen as 4.7 Ω.

The simulator treats everything after a recognized prefix that immediately follows a number as a comment. This is what allows me to set the resistance to 4.7kΩ, including the Ω symbol. I'd like to put a space between the value and the units, because that is the proper way to write it, but then the simulator will ignore the prefix.

Another thing to be aware of is that the simulator is not case sensitive, so 100m and 100M are the same, and are interpreted as 0.1, If you want mega, you have to use Meg.
 
Top