Help with Switch Simulation

EDIT. This post was moved from an old 2019 thread titled:
Switch, Potentiometer simulator

Hello Ste,

I was trying to replicate your idea for a push button, but I an unable to get the same waveform.
Could you please comment on what I am doing wrong?
I have attached the schematic.

latch-simulator.kicad_sch (23.3 KB)

Thank you very much

How did you get this output graph?

When I run your sample file in KiCad 6.0.7 (with ngspice-37) , I just get an error message like

Error on line 6 or its substitute:
/swin 0 /vtest 0 s1 /swin 0 /vtest 0 push on
unknown device type - error 
Error: circuit not parsed.

but no simulation.

I uploaded a version that I should not have. :slight_smile:
I looked at the netlist and added it to the symbol properties.

I now solved the issue: my problem is that I edited the spice model for the switch. It seems like you just have to add the symbol and then assign the value. That was it. Editing the spice model created the problem.

2 Likes

Could you paste your project here, so that other may benefit from your solution?

2 Likes

Sure. Attached is the schematic.
Inspect → Simulator.

I added some more stuff since I originally asked this question, but the part pertaining to the switch is still valid.

Many thanks to Ste Kulov (@Ste ) for this original answer.

latch-simulator.kicad_sch (32.0 KB)