hello once again, I'm unable to work this comparator circuit :-(

Thread Starter

rafiyaaa

Joined Jun 22, 2024
8
Screenshot 2024-06-23 at 3.23.45 AM.pngI'm designing a temperature sensor with an alarm that goes off when the temperature reaches beyond the threshold temperature of 55 degrees Celsius. The output voltage when the temperature is at 55 degrees is 3.28V. The op amplifies the output with a gain of 2. Thus, the reference voltage for the comparator circuit is 6.56V. I'm supposed to get a high output when Vin>Vref and a low output when Vin<Vref. However, the waveforms are not changing and only gives me an output of 6.56V through out. Would love some help <33
 

dl324

Joined Mar 30, 2015
17,220
Who knows what LTspice will do with no hysteresis on the comparator.

What happens if you have Vin1 set to a voltage higher than 3.28V?
 

Papabravo

Joined Feb 24, 2006
21,343
It happens because you don't know what you are doing and you are using an operational amplifier as a comparator. On top of that the second operational amplifier is operating open loop which is a big Bozo [the clown] no-no.
Bozo the Clown - Wikipedia

Here is my rendering of the initial conditions.

1719091404210.png

If you want the function of a comparator, then use a freakin' comparator!!
 

Thread Starter

rafiyaaa

Joined Jun 22, 2024
8
It happens because you don't know what you are doing and you are using an operational amplifier as a comparator. On top of that the second operational amplifier is operating open loop which is a big Bozo [the clown] no-no.
Bozo the Clown - Wikipedia

Here is my rendering of the initial conditions.

View attachment 325209

If you want the function of a comparator, then use a freakin' comparator!!
I'm gonna take the L and agree with everything you said, thanks man :,)
 

Papabravo

Joined Feb 24, 2006
21,343
Just in case anyone was wondering about sweeping the input; here are those results. If U2 also has a -10V supply then the output in open loop with the given inputs will ALWAYS be close to -10V.

1719093239605.png
 

Papabravo

Joined Feb 24, 2006
21,343
If you want an actual comparator with an analog output, as opposed to an open collector output, you can use an LT1017. The homework problem is to look at the output waveform and assume that output is always at one of the rails to figure out what the voltage divider is doing. I've attached the .asc file for your convenience.

1719094316250.png
 

Attachments

Thread Starter

rafiyaaa

Joined Jun 22, 2024
8
If you want an actual comparator with an analog output, as opposed to an open collector output, you can use an LT1017. The homework problem is to look at the output waveform and assume that output is always at one of the rails to figure out what the voltage divider is doing. I've attached the .asc file for your convenience.

View attachment 325224
you're a god sent miracle. I hope your pillows are always cold, you find cash in your pockets, and every meal you eat is at the perfect temperature. Thank you for being so nice :)
 

Papabravo

Joined Feb 24, 2006
21,343
you're a god sent miracle. I hope your pillows are always cold, you find cash in your pockets, and every meal you eat is at the perfect temperature. Thank you for being so nice :)
Thank you. You are most welcome. If you can figure out the voltages for the upper and lower trip points, please post them. If you are still stumped, I'll post my solution in a day or two.
 

Thread Starter

rafiyaaa

Joined Jun 22, 2024
8
sorry, I think there was confusion. I have to use the op-amp as a comparator. I have to configure the second op-amp in an LM258P as an open-loop comparator. (using LT1413 as LTspice doesn't have that component.)
 

Papabravo

Joined Feb 24, 2006
21,343
sorry, I think there was confusion. I have to use the op-amp as a comparator. I have to configure the second op-amp in an LM258P as an open-loop comparator. (using LT1413 as LTspice doesn't have that component.)
You can find a model for the LM358/LM258/LM158 from online sources.
Opamps have internal frequency compensation components that inhibit their use as comparators, but hey it's your life and your time to utilize any way you see fit.
 

Thread Starter

rafiyaaa

Joined Jun 22, 2024
8
You can find a model for the LM358/LM258/LM158 from online sources.
Opamps have internal frequency compensation components that inhibit their use as comparators, but hey it's your life and your time to utilize any way you see fit.
mannnn if I could i'd use a comparator as well but I gotta follow my lecturer's commands. thanks for your help though, really appreciate it :D
 
Top