sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.36k stars 643 forks source link

1N34 (germanium diode) incorrectly simulated? #949

Open ericfont opened 5 months ago

ericfont commented 5 months ago

Try this simulation of a 1N34. When inputting voltage from 0 to 500 mV, the current only reaches 1.363 micro amps:

image

But germanium diodes are typically said to have a rough threshold around 300 mV, and all datasheets and plots of 1N34 diodes I can find on the internet show the current should be well into the milli amp range by the time its voltage is 500 mV, for instance:

image

I looked at https://github.com/sharpie7/circuitjs1/blob/dd47cf43a1baa91e2d6ae0f5884ccf0f589989bf/src/com/lushprojects/circuitjs1/client/DiodeModel.java#L90 but it seems to match what https://www.allaboutcircuits.com/textbook/semiconductors/chpt-3/spice-models gives. Though there are some parameters left out from that...maybe they are necessary? Or maybe there is some other error simulating it in DiodeModel.java?

Thanks as always for such a great tool.

ericfont commented 5 months ago

I don't notice any glaring issues with the two Shottkey diodes, which are also low-threshold diodes and match my limited understanding. But the 1N34 seems way off...maybe it should just be deleted from that menu if fixing its simulation is too hard.

pfalstad commented 5 months ago

Have you seen this:

https://forum.allaboutcircuits.com/threads/error-in-1n34-spice-model.48758/

I tried it with MacSpice and got exactly the same results. I guess the model is just bad. Deleting it from the menu seems like a good idea.


vin 1 0 0.5V

.MODEL D1N34 D(IS=200P RS=84M N=2.19 BV=60 IBV=15U
+ CJO=4.82P VJ=.75 M=.333 TT=144N)

DX 1 0 D1N34

.control
* dispose of any 'save' statements from previous runs
delete all
* perform a transient analysis
tran 0.01ms 10ms 0.0ms 0.2ms
plot i(vin)
.endc
ericfont commented 5 months ago

Ahh. Yeah...just delete it for now.