Switch Circuit

Thread Starter

letoppina

Joined Dec 11, 2017
28
Hi all,

I'm trying to design a circuit in LTSpice with a voltage source and a switch that should be turned on only when the outputs of the voltage source reaches a peak (maximum and minimum --> see attached image) and it should be closed only for a very limited amount of time (and in order to let the tension be inverted). Now, in order to do so I was thinking of using a peak detector. Should it be a good idea or should I think of something else?

Thank you in advance!
 

Attachments

Last edited:

smooth_jamie

Joined Jan 4, 2017
107
Depends what you are trying to do. If you knew the maximum peak voltage you are trying to detect then you could use a simple voltage comparator and a potential divider to set the reference level.

Setting a one-shot pulse on detection can be done using the classic 555 timer in monostable configuration
 

Thread Starter

letoppina

Joined Dec 11, 2017
28
Here is the .asc file

(don't pay too much attention to the parameters of the voltage source that controls the voltage controlled switch)
 

Attachments

crutschow

Joined Mar 14, 2008
34,407
What exactly are you trying to do with the inductor and this circuit?
You can't place a switch in series with an inductor and shut if off without creating some very high voltages.
 

Thread Starter

letoppina

Joined Dec 11, 2017
28
You can use a behavioral voltage source (bv) to operate the switch.
But with the behavioural voltage source I always have to set the parameter in order to detect the maximum voltage, that means that I have to explicitly tell the switch under which circumstances operate, is that right? My voltage peaks can be very random so I wanted to find a way in order to let the switch operate automatically (if it's possible....) that's why I was thinking of using a peak detector (or maybe a comparator...).
 

smooth_jamie

Joined Jan 4, 2017
107
sounds interesting! Practically speaking how do I do that?
You can make a zero crossing detector with a comparator. Just set your voltage reference to zero volts (ground) on one input, and put your signal voltage on the other input. Everytime the signal voltage goes to 0V the output will be high. The output will stay high as long as the input is positive, and is sometimes known as a sine to square wave generator.

The timing pulse can be set with a monostable 555.
 

Alec_t

Joined Sep 17, 2013
14,312
Here's a way of using a comparator for sensing both positive and negative peaks, even if their amplitude is variable. The peak detector output can be inverted as necessary for triggering a 555 monostable:
PeakDetector.PNG
V1, V2 and A1 are just for the simulation. R1 and C1 give a slight delay to one of the two inputs of the comparator. Their values are not critical.
 

Thread Starter

letoppina

Joined Dec 11, 2017
28
Ok thank you very much, I will try if it works with my model!! Is it possible to do a similar model with Simulink too? Would it be easier?
 

smooth_jamie

Joined Jan 4, 2017
107
For anyone interested, here is my version of a zero crossing detector. Instead of a square wave it gives a short pulse which can be monitored with a microcontroller.

Excuse the rubbish oscilloscope trace, just for illustrative purposes. You can see when the square wave crosses the zero point there is a short spike which is the output of the circuit. I have attached the pdf schematic and a multisim file (zipped) so you can simulate the circuit.

Additional:
You can simply increase the value of the capacitor to increase the length of the output pulse
 

Attachments

Top