Comparator circuit (electronic if-statement ):

Hello guys, you know the importance of "if-statement " in programming but How you can Do if-statement with electronics?

We will do this by comparator:

In electronics, a comparator is a device that compares two voltages or currents and outputs a digital signal indicating which is larger. It has two analog input terminals; A comparator consists of a specialized high-gain differential amplifier. They are commonly used in devices that measure and digitize analog signals, such as successive approximation ADCs, as well as relaxation oscillators.
Opamp105
DAC with comparator :slight_smile:
unnamed
Let’s do this algorithm:
5
power supply circuit:
1
We will use 12 v low-frequency transformers with bridge followed by filter capacitors.
2
Explanation of the circuit the Zener will make the volt staple at 5.1v on inverting pin of an op-amp, volt that is compared it will come from the pot
By variation, the pot: if the volt is more than 5-volt op-amp output is 12v led is on
Else "less than 5v the output will be zero led is off
Full circuit:


Link of the circuit:
https://drive.google.com/file/d/1RdJJluzjKoBIZ2Ho1AM5C_G-Spf0ukTe/view?usp=sharing
feel free to ask me any question:

Gmail: eng.darwishelectronics@gmail.com

Facebook: Eng. Darwish Ali