My code doesn't work, plsss help!

I have crated a code with the objective is to read the temperature and activate diferente relays depending on the temprature, but whenever the temperature gets close to the turn point temperature, de sensor flotuation, makes the relays close and open until the temperature exceeds that point, can sombody help me????

Read about Hysteresis -it is an exact solution for your issue

3 Likes

Another way is to add a deadband where you turn it on at setpoint and when above it by a bit turn it off. It is an easy to generate Hysteresis without a lot of software.

Hello dead4ever07

Check the constrain() function to design and code a window comparator to get a switch hysteresis.

Have a nice day and enjoy coding in C++.

thanks to evryone that comented, but based on what you have said, i have reserched about hysteresis and finally, i have been hable to solve my problem

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.