Simulation of a switch

Hi guys!
I try to simulate a simple switch, however, using the built-in model it is allways off, while using a custom one, the interpreter returns an error regarding the state as “undefined parameter [on]”:


I tried changing the switch with a voltage controlled one and it is pretty much the same thing.

I’m not familiar with Ngspice, I can only speak for LTSpice. I think the symbol for the switch is not correct. It should have four pins, the two for the contact as you have it, but two additional pins where you have to supply the control voltage. There is a switch in the Simulation_SPICE library, try this one.


Well, it worked, but it seems like in the real world, if you want to push a button, you need a battery to power your finger! :slight_smile:
Thanks a lot for your idea!

P.S. If V2 is less then the threshold, it turns off. I am a newbie and I am not allowed to post two pictures in the same message :slight_smile:

In your profile I see a “basic user” level. I think you can upload more pictures and attachments now.

well, pushing your finger into your monitor wont work.
By taking input from a voltage source you can also use PWM to switch the switch quickly. It looks like it’s more like an ideal relay.

Honestly, it is silly not to implement a simple switch at least for compatibility with the schematic for a pcb. Would be even nicer to read the attached value as on and off. In the symmulation per-se it isn’t even necessary since you may simply leave the circuit open or closed.

This topic was automatically closed after 90 days. New replies are no longer allowed.