EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: Szewczykm on January 14, 2013, 06:40:57 pm
-
Hi, I'm just starting to play with LT spice and what I'm trying to simulate is a delay that's controlled with a capacitor. There is an LED controlled by a 2n2222, and I want to have the LED stay on for a few seconds after a button is pressed and released.
I'm trying to build this in LTSpice so I can play with values and just figure out how it all works, but how do you simulate a button press?
-
Lots of ways. You could use a separate voltage source instead of the button. Then doing a transient simulation set the delay to whatever value you want.
-
Thanks, I created another voltage source and then edited it's properties.
Right Click Voltage Source -> Pulse
Then I played with the pulse values and it acted like a button I was pressing.
Thanks!
Mike
-
Another useful and non-obvious feature is that you can create components which don't have fixed values. I often simulate a switch by creating a resistor whose resistance changes between a very large and a very small value at some point in time.
The way to do it is to create one whose value is "R=V(name)", where "name" is a label attached to some node in your design. You can assign it to the output of a voltage source which steps between (say) 1V and 1000kV at some time, to make the resistor change from 1 Ohm to 1MOhm.
-
Another useful and non-obvious feature is that you can create components which don't have fixed values. I often simulate a switch by creating a resistor whose resistance changes between a very large and a very small value at some point in time.
The way to do it is to create one whose value is "R=V(name)", where "name" is a label attached to some node in your design. You can assign it to the output of a voltage source which steps between (say) 1V and 1000kV at some time, to make the resistor change from 1 Ohm to 1MOhm.
+1 Much more flexible than a stepped voltage source, because it's not a low impedance to ground when it's off.