In this article, we are going to make a simple Analog Temperature Controller using OP-Amp and Relay. This is a basic article, that can be used as a reference for large designs. If you understand it clearly, you can apply it in other controls. So let’s start!
⚠️Disclaimer:
Working with electricity involves serious risk. Ensure you have the necessary skills and take proper safety precautions before attempting any electrical projects. Proceed at your own risk — the author assumes no responsibility for any damage, injury, or issues resulting from the use or misuse of the information provided.
All content on this website is original and protected by copyright. Please do not copy or reproduce content without permission. While most of the resources shared here are open-source and freely accessible for your learning and benefit, your respect for our intellectual effort is appreciated.
If you find our tutorials helpful, consider supporting us by purchasing related materials or sharing our work — it helps keep the content flowing.
Need help or have questions? Leave a comment below — the author is always happy to assist!
You can this article too: Analog Temperature Controller for an Incubator with Capacitor Power Supply
Table of Contents
The basic comparator:
The comparator is one of the modes of the Op-Amp circuit. It is pretty simple in a configuration like the image below:

The output of a comparator is high when the voltage at the non-inverting (+) input is higher than the voltage at the inverting (–) input. Conversely, the output goes low when the non-inverting input voltage is lower than the inverting input. This fundamental operation is quite simple and can be used to compare an input voltage against a fixed reference voltage.
However, there is a common issue when using a comparator to control devices like switches, relays, or loads. If the input voltage hovers around the reference voltage, even slight fluctuations or noise can cause the comparator output to rapidly switch between high and low states. This results in unstable operation or chatter, which can be problematic in real-world applications.
Refer to the image carefully to understand how such fluctuations occur near the threshold level.

The output may fluctuate rapidly for a very short duration when the input voltage is close to the reference voltage. This kind of behavior, often caused by noise or small variations, can be highly problematic—especially when driving relays or other inductive loads. Continuous chattering or frequent switching in such a state will significantly reduce the relay’s lifespan or even damage it over time.
You might initially consider adding a capacitor filter to smooth the signal, but this approach is generally ineffective in eliminating this kind of rapid toggling.
To solve this issue properly, the comparator circuit should be modified into a Schmitt Trigger configuration or a comparator with hysteresis. This technique introduces two different threshold voltages—one for turning on and another for turning off—creating a clear and noise-immune switching region. This ensures stable operation even when the input voltage is near the threshold.

Explanation:
Here, a resistor R2 is used as a feedback resistor. This feedback resistor works as our hysteresis control resistor. Think simply, whenever the input Vin is lower than the reference voltage, the output will be high. Then the feedback resistor will carry a minor current to the reference pin which increases the pin voltage a little. That makes the reference voltage a little higher than the present Vin voltage. So to turn the output off, the Vin pin has to be slightly higher than the previous reference voltage.
However once it is higher than the preset reference voltage, the output will be low. Again the feedback resistor will draw some current from the reference pin which will reduce the actual reference voltage by a little. Now what? the Vin pin needs to be lower than this voltage (actual reference voltage + voltage droop due to the feedback resistor). This way the hysteresis works.
This hysteresis helps to control the output from fluctuating at the same input voltage range. That protects relays from chattering ensuring longer life.
If you want to know the calculations you can read this article here.
Now, we can apply the comparator circuit in our project.
Circuit diagram:
Here is the circuit diagram of our Analog Temperature Controller:
Here, a common Op-Amp LM358 is used, where the R6 is our feedback resistor. By tuning the potentiometer RV1, we can set our temperature range. Then, sensor RT1 is a 10KOhms NTC type temperature sensor. When the temperature is higher than the set point, the relay will be turned on, and the heater will be off. The same circuit can also be used for cooling purposes, connecting a cooler in the other terminal of the relay.
PCB:

PCB diagram:

Conclusion:
Many people have asked me to share simplified projects that are easier to understand. That’s exactly why I’ve created this article—I’ve made it as simple and beginner-friendly as possible. I hope it helps you understand the circuit clearly.
If you still have any questions or face any issues, feel free to leave a comment below. And don’t forget to subscribe for more practical and easy-to-follow electronics content!
Liked this article? Subscribe to our newsletter:
or,
Visit LabProjectsBD.com for more inspiring projects and tutorials.
Thank you!
See you in the next article, Thanks.
Check this: 6V Lead-Acid battery charger circuit
3 Comments
R K Hammy · 29/06/2021 at 4:48 am
Many thanks for the project and clear explanation
MKDas · 05/08/2021 at 4:55 pm
Thank you.
chupacup · 14/06/2025 at 12:47 pm
Hey, Thanks for the explanation. but could you please fix the images? it would be such a life safer