In the figure we show how to use an LM324 as a voltage comparator the reference voltage is adjusted in R2 and when the Vin voltage exceeds the set value, the circuit output goes to the high level. Other operators and comparators can be used in the same configuration.