Electrical – How to eliminate noise from Relay?

arduinonoisepeltierrelay

In my recent project, I am working with Peltier module. Now, here the main purpose of my project is switching between cooling and heating. And for that purpose, I'm using the 5V relay(2-relay) board. Now, during switching, the noise is generated from the relays and it totally destroys all functionality of the system.

First of all, let me explain the functionality of the system so you can understand the what is the role of the relay. In our system, we have to maintain the temperature at the desired time.

My system diagram looks like below:

Circuit Diagram

Above is the most simple diagram. I just avoid the all actual connections and represent all connections in form of the bus. Now as you see in diagram different modules are there. Temperature sensor takes the reading which is attached with Peltier module. Now here motor driver is used for driving the Peltier module. LCD is used for display all data and keypad is used for entering the temperature and timer.

Now, here relays is used for the switching means for heating and cooling. By default, temperature is room temperature. Here we used 2-relay board in which one is used for cooling and other one used for heating.

For, switching for heating and cooling I just developed the logic like below.

if(desired_set_temp > peltier_temp)  // Heating
{
  relay 1 active
  relay 2 not active
}
if(desired_set_temp < peltier_temp)  // Cooling
{
  relay 1 not active
  relay 2 active
}

Now, the real problem starts here. Suppose, if we set temperature -5 degree then Peltier temperature try to maintain its temperature around -5 degree. and during this time switching happening and both relays generate noise. Now, how to eliminate this noise from these relays? Any circuit that removes this noise.

I used ready made relay board here like below:

Relay

Edit: totally destroys all functionality of the system means during this time,

(1)LCD showing weird characters

(2)Can't able to operate the system

(3)Can't able to enter any value from Keypad

We have to compulsory restart the system and then we can able to operate system again.

Best Answer

Add hysteresis:

auto active_error = 5;//or whatever
auto passive_error = 2;//or whatever
if(desired_set_temp > peltier_temp + allowed_error)  // Heating
{
  relay 1 active
  relay 2 not active
}
if(desired_set_temp < peltier_temp - allowed_error)  // Cooling
{
  relay 1 not active
  relay 2 active
}

if(desired_set_temp >= peltier_temp - passive_error &&
   desired_set_temp <= peltier_temp + passive_error)  // goldilocks zone
{
  relay 1 not active
  relay 2 not active
}

This will add a delay between switching one and the other.

In this case it will activate the heater or cooler when the temperature exceeds the set temp +/-active_error and deactivate when it come back within +/-passive_error.