![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1600796/image.jpeg)
Huge inaccuracies in plotting diode IV characteristic in Matlab
20 views (last 30 days)
Show older comments
I currently have a lab for my microelectronics class where I have to plot measured data against the diode model equation using parameters extracted from the measured data: the ideality factor (n) of the diode and the saturation current (Is).
The diode model used in my class is: Id = Is*[exp(Vd/nVt)-1]
where Vt is thermal voltage, Vd is diode voltage, and Id is diode current.
However, when I plot the diode equation with logscale on the y-axis I have huge discrepancies between the data points on the plot, and the values that the diode equation model should actually assume. The only way I have gotten the models to plot even remotely accurately was by adjusting the saturation currents to absurd values on the order of 10^-51.
This is what my plots look like without the absurd correction in the saturation current. Notice the huge gap between the green and blue lines; that shouldn't be there.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1600771/image.png)
This is what my plots look like with the absurd correction in the saturation current.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1600776/image.png)
Why is this happening? I've already double checked all of my units and everything is definitely in mA, so what am I missing here? Also, as a sanity check I quickly plugged the diode equation with specific values into my TI-84 graphing calculator, and for individual plot points the discrepancy between MATLAB and my TI-84 is on the order of 10 orders of magnitude.
I've attached my MATLAB code to this post. Any explanations and or solutions to this issue would be much appreciated!
0 Comments
Accepted Answer
William Rose
on 26 Jan 2024
It is clear that your model does not fit your data. So there has been an error in the data collection, or the mdoel is just wrong. If you adjust the model parameters, I'm sure you could get a much better fit.
For example, if I change nzm from your value, nzm=1.199 to nzm=0.82, I get a decent fit to the zener data. I'm sure you can do likewise with the LED data, and you can do even better if you also tweak other adjustable parameters in the model.
I recommend comparing your I-V data to the data sheets for the diodes you used, to see if your data looks reasonable.
It can be useful to view the data on a linear-linear plot, which is what I did below. NOte the fit to the zener data when I changerd nzm.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1600796/image.jpeg)
13 Comments
William Rose
on 29 Jan 2024
@Nicholas, please email me by clicking on the envelope icon which appears in the window that pops up when you click the "WR" icon next to my posts. We can conitinue the discussion offline.
More Answers (0)
See Also
Categories
Find more on Energy Production in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!