Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
So guys there’s a piece of code, that involves temperature measurement. If the temperature is more than a certain value, a fan comes on, else it goes off. The sensor used is an NTC sensor, hooked up to a heat sink. This is the line of code:
if (temperature > 30)
{
FANON;
}
else
{
FANOFF;
}
the bug I have observed is that once the temperature gets to 30 degree the fan comes on, after some few seconds, the Temperature drops, the fan goes off, few seconds again the fan comes on just like that, which is not good for the system, I love to know how we would address the issue, in a simple way @here
Use a hysteresis function, with 2 thresholds
Something like
if temp > 30 { fan on }
if temp < 25 { fan off } temp between 25 and 30 will not change the state of the system
CONTRIBUTE TO THIS THREAD