# Shifting LEDs forced by flickering temperature sensor HELP!

Hi

I am making a project where I have a temperature sensor and a Dimmer to trigger some LEDs (soon gonna be changed by magnetic valves.) Well The idea is then the value from the dimmer is equals or smaller than the temperature the LEDs is changing value too.

I Now have a problem. Let's say i have set the wished temperature to be 25 Celsius. Then my temperature sensor is reaching right between 24,9 C and 25 C it begins to jump between these two values until the temperature reach a bit over 25 Celsius.
Well because I will have some magnetic valves to control water flow, I will then have to get this problem solved or else my valve will begin to open and close really fast for some time..

So can i make some kind of "Dead point" let's say from -0.5 to 0.5 from the wanted value, where noting is happening, or how else do i handle this problem?

I have under this post an illustration of my idea of a system if that helps to understand what i want to make!

Hope you can help me!

So can i make some kind of "Dead point" let's say from -0.5 to 0.5 from the wanted value, where noting is happening, or how else do i handle this problem?

That is how I would do it. It is called hysteresis. If it were a heater, turn output off at 26 degrees but wait to 24 degrees to turn back on. That gives a dead band so it won't chatter.

groundfungus:

So can i make some kind of "Dead point" let's say from -0.5 to 0.5 from the wanted value, where noting is happening, or how else do i handle this problem?

That is how I would do it. It is called hysteresis. If it were a heater, turn output off at 26 degrees but wait to 24 degrees to turn back on. That gives a dead band so it won't chatter.

Do you have any reference to this or at least how am I embeding this in my code?

or at least how am I embeding this in my code?

In the code you haven't posted? No.

Do you have any reference to this

Sure

(Not to be confused with "hysteria")