Op amps are analog computers, and were the way computing was done in the days before digital logic .
They can add, subtract, multiply, divide,and a slew of other cool functions including this comparator circuit.
I learned about them when working at a company that used them for signal conditioning of their level gauges for ships and big tanks.
The triangle has a + and - input. The op amp is a high gain analog amplifier. The LM324 has an open loop gain of over 1 million, so the difference between the + and - inputs is amplified by a million, so only a few microvolts of difference between the + and - inputs will make the output shoot to either the positive or ground level. In the comparator, we want this so the op amp acts like a switch when one voltage exceeds the other. In the circuit, the PTC voltage will be less than the setpoint so the output will hit the + rail voltage and be high until the PTC voltage is equal to the setpoint, but right when they are in the zone where the difference in voltage even with the million amplification falls below the + rail, the circuit will amplify any 60 HZ noise riding on the signals by the same million and you would see a big sine wave on the output, which makes it buzz.
A high value resistor( 4.7Meg) between the output and positive input, giver the circuit some hysteresis.
The way that works is when the output is high, the 4.7M pulls the + input slightly higher than the setpoint, so the PTC voltage has to climb just a millivolt or two higher than the actual setpoint before the output starts to fall.
Once the output starts to fall for the first time, the pull up from the output through the 4.7M resistor reduces and this drops the + input voltage.
This drop in the + input voltage, increases the difference between the + and - input, and this further reduces the effective setpoint voltage, rapidly shooting the output to the ground rail, where the feedback through the 4.7M now is now pulling the + input down further than the actual setpoint, firmly switching the output off. A fast positive switching action on the first near match of the PTC voltage and the set voltage.
The same thing happens as the PTC drops below the now pulled down setpoint, this causes a nice clean turn on of the output.
The digital circuits with Schmidt trigger inputs work the same way
The ratio of the 10K input resistor to the 4.7M feedback resistor determines the size of the hysteresis. Less feedback (higher feedback resistance) and you get a smaller hysteresis band, lower feedback resistance, and you get a bigger band.
There are hundreds of usefull op amp circuits that can be made with the exact same part, and there are thousands of types of op amps available.
I always keep 50 or more in my parts bins, and use them when I don't want to deal with writing a program for a micro controller, and want a simple to understand circuit that anyone can duplicate.
With negative feedback, the gain can be controlled from 1 to the full gain of over a million as used in the comparator, and anywhere in between. The potentiometers are fed into two op amps set up as unity gain buffers, The input impedance is well over a megohm, and the output can drive a 25MA load.
Get some LM324's and play with them. There are tons of circuits available online that show the many possibilities that op amps bring.
New schematic with hysteresis and explanation.
http://99mpg.com/Data/resources/down...gersafety2.pdf
Data sheet with example circuits for the LM 124,224,324 op amps:
http://www.national.com/ds/LM/LM124.pdf
Have fun