# Zener diode for simulation

**URL:** <https://forum.fritzing.org/t/zener-diode-for-simulation/18556>\
**Category:** bugs\
**Created:** [March 13, 2023, 6:19pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556 "2023-03-13T18:19:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![capramat](https://forum.fritzing.org/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@capramat](https://forum.fritzing.org/u/capramat)\
**Post date:** [March 13, 2023, 6:19pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/1 "2023-03-13T18:19:37Z")

</div>

Hello, when i try to build a simple schema using zener diode and simulate it i get this error.  
Some one knows why?

 ![Screenshot 2023-03-13 191802](https://forum.fritzing.org/uploads/default/original/2X/6/61fe0eefaaa9fb92c5a0a99ef5536511c5a2b254.png)  
Matteo

---

<div class="post-metadata">

**Author:** ![vanepp](https://forum.fritzing.org/user_avatar/forum.fritzing.org/vanepp/32/4426_2.png) [@vanepp](https://forum.fritzing.org/u/vanepp)\
**Post date:** [March 13, 2023, 7:05pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/2 "2023-03-13T19:05:48Z")

</div>

It appears the spice model in the in4732A part is incorrect. Your best bet is likely to file a bug report on github (including the sketch, the .fzz file will make reproduction easier.) The solution is to fix the spice model in the part (with a custom part to start with) and then fix the model in core parts. Open an issue in github here (as this is a part issue)

> **[Issues · fritzing/fritzing-parts](https://github.com/fritzing/fritzing-parts/issues)**
>
> Electronic components for use in the Fritzing app (aka the parts library) - Issues · fritzing/fritzing-parts

@fai who did the simulation may also be able to suggest a fix (I don’t know enough about the spice models to see where the error is.) Assuming you are using the 1n4732A from core parts (which seems likely) the spice model looks like this

 ![capture1](https://forum.fritzing.org/uploads/default/original/2X/9/9a1c9b9f0a40dd04324c588a44da74b5392dbcfc.jpeg)

and it appears to be unhappy about the DI\_4732A label in line 4 which appears there but may not be correct, or need to be defined further. As noted I know very little about spice.

Peter

---

<div class="post-metadata">

**Author:** ![fai](https://forum.fritzing.org/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fai](https://forum.fritzing.org/u/fai)\
**Post date:** [March 13, 2023, 7:17pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/3 "2023-03-13T19:17:59Z")

</div>

Yes, this issue has been already reported and we fixed it in the repository. Next version will not have this error.  
See:

> <https://github.com/fritzing/fritzing-app/issues/3983>
>
> Hey
> 
> I am experiencing simulation error and I don’t know how to solve it. Can …you please assist
> !\[image\](https://user-images.githubusercontent.com/116161452/196658981-f4e9e5f3-980c-4321-871e-de3d2a3d60e7.jpg)

The fix is relatively easy: replace the D by an X in the spice model of the part. The problem is that you need to find the file, change the spice model and rebuild the database, which may be difficult depending on your knowledge of Fritzing…

---

<div class="post-metadata">

**Author:** ![vanepp](https://forum.fritzing.org/user_avatar/forum.fritzing.org/vanepp/32/4426_2.png) [@vanepp](https://forum.fritzing.org/u/vanepp)\
**Post date:** [March 13, 2023, 7:44pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/4 "2023-03-13T19:44:41Z")

</div>

OK here is a temporary solution til the fix comes out. This is a copy of the core part with spice corrected:

[Zener-Diode-fixed.fzpz](https://forum.fritzing.org/uploads/short-url/rfaiGfXvvC1o3NS64IkqpIr6Bwk.fzpz) (5.3 KB)

if you load this part then do a delete minus (or just delete the current diode and replace it with this one which may be as easier than the delete minus) then the simulation should work.

Peter

---

<div class="post-metadata">

**Author:** ![capramat](https://forum.fritzing.org/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@capramat](https://forum.fritzing.org/u/capramat)\
**Post date:** [March 13, 2023, 10:37pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/5 "2023-03-13T22:37:14Z")

</div>

Many thanks this Zener works well 😊  
this one is fix at 3.6V Zener Voltage?

---

<div class="post-metadata">

**Author:** ![vanepp](https://forum.fritzing.org/user_avatar/forum.fritzing.org/vanepp/32/4426_2.png) [@vanepp](https://forum.fritzing.org/u/vanepp)\
**Post date:** [March 13, 2023, 11:51pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/6 "2023-03-13T23:51:02Z")

</div>

From the datasheet it should be 4.7V, but the spice model says

```
   <model>VZ 2 3 2.99</model>

```

which I think should set the zener voltage ( but I don’t know how exactly). It is pretty close to a 4.7V zener from diodes (their VZ is a little lower) but I don’t know how that relates to the voltage since I would expect it to be 4.7.

\*SRC=AZ23C4V7;DI\_AZ23C4V7;Diodes;Zener \<=10V; 4.70V 0.300W Diodes Inc. Per node. Device contains two  
\*SYM=HZEN  
.SUBCKT DI\_AZ23C4V7 1 2

- 

```
   Terminals A K

```

D1 1 2 DF  
DZ 3 1 DR  
VZ 2 3 2.24  
.MODEL DF D ( IS=26.3p RS=33.7 N=1.10

- CJO=350p VJ=0.750 M=0.330 TT=50.1n )  
.MODEL DR D ( IS=5.26f RS=62.5 N=3.00 ).ENDS

Again perhaps @fai may be able to provide more insight.

Peter

---

<div class="post-metadata">

**Author:** ![fai](https://forum.fritzing.org/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fai](https://forum.fritzing.org/u/fai)\
**Post date:** [March 16, 2023, 3:00pm UTC](https://forum.fritzing.org/t/zener-diode-for-simulation/18556/7 "2023-03-16T15:00:19Z")

</div>

I do not understand very well the model they are using for this diode (I did not create it, it was already in the core parts). However, I get 4.7V as expected:

 ![image](https://forum.fritzing.org/uploads/default/original/2X/c/c127aa166ecaecaae8cfa4f649bb6e49892e2061.png)
