LT Spice Switch component

Thread Starter

AnalogKid

Joined Aug 1, 2013
9,979
The Switch component in LTS has always confused me. What I want to do is simulate turning a light switch on and off. Setting the sine source to go to 0 V is not the same as an open circuit, so I need the switch. The Help section was not great, so here I am. How do I configure the component or spice directives of whatever to turn a light swith on and off rapidly?

Help me, Wally-Obi-Wan; you're my only hope.

ak
Light-Control-2.gif
 

Attachments

eetech00

Joined Jun 8, 2013
3,111
The Switch component in LTS has always confused me. What I want to do is simulate turning a light switch on and off. Setting the sine source to go to 0 V is not the same as an open circuit, so I need the switch. The Help section was not great, so here I am. How do I configure the component or spice directives of whatever to turn a light swith on and off rapidly?

Help me, Wally-Obi-Wan; you're my only hope.

ak
View attachment 256360
V2 needs ground. So disconnect it from V1 and connect V1 to ground.

Also

If the AC source represents a line voltage, like 120VAC, use Params to convert to Pk voltage first then use the result in the voltage source.

Like this (files attached):

1640826402416.png

I've shown 120vac as the RMS value but you can use whatever you want.
 

Attachments

Last edited:

crutschow

Joined Mar 14, 2008
29,528
You have VSW and Vsw nodes which are connected together, since LTspice does not differentiate letter case.
Remove that connection and you should be okay.
V2 can be connected to ground to simplify its voltage measurement but it's not required for the circuit to operate, since the switch control pins are completely isolated and only look at the difference signal between the two control inputs.

Wally-Obi-Wan out. :)
 

Thread Starter

AnalogKid

Joined Aug 1, 2013
9,979
What's the purpose of D6?
Not shown:
R12 approximates a 10 mA semi-constant current load, which is two solid state relay inputs (rated 3-30 Vdc) in series, with a switched connection to GND between them. C1 will eventually be sized to hold up this load for approx. 1 sec.

Vsw goes to one input of a NAND S-R flipflop. C3 is much smaller than C1, just large enough to keep the ripple voltage negative peaks above the ff input transition level. When the wall switch is turned off, D6 allows Vcc to remain near 12 V while Vsw drops down to near GND. Also not shown are a power-on reset circuit, a power-on delay circuit, and some steering logic.

The idea is that a bank of 4-tube fluorescent light pans can be turned into low and high brightness pans with just the one wall switch and no additional wiring to the pans. When first turned on, only one pair of tubes comes on in each pan. If you flick the wall switch off and on again in less than 0.5 second, the second pair of tubes comes on while the first pair remains on. The initial turn-on is delayed 0.5 sec to allow time for the second flick without beating up the tube filaments with short bursts.

Each pan has two 2-tube ballasts, so the two pairs of bulbs are completely independent. The circuit and two SSRs go between the existing AC into the pan and the two ballast inputs. I'm still playing around with the ergonomics and the various timers.

For even more craziness, the ff can be replaced by a 4-bit shift register. Now, each pan or half-pan could be assigned to a unique number of switch flicks. For example, in a randomly selected basement somewhere in Ohio, flick 1 turns on two tubes next to the stairs and two tubes over the bar; flick 2 turns on 2 tubes in the rest of the pans for low-brightness lighting throughout the basement; flick 3 turns on the remaining 2 tubes in all pans for high-brightness lighting everywhere. All of this with zero wiring changes outside the pans, and nothing but wire nuts and screw terminals inside the pans.

I;m in the puttering-around-with-different-ideas stage. When I get to this project for real, I'll post it.

ak
 
Last edited:
Top