(part B')
//THERMAL PROTECTION RULES
if ( TC30A >= 90|| TC30B >= 90||TC50A >= 90|| TC50B >= 90|| TC27A >= 90||TC27B >= 90)
The threshold temperature in °C .Over that led drivers switch off
{
digitalWrite(SSR_PIN,HIGH); <= Change to LOW ,if in "protection" state ,Arduino has to output 0V
at pin 5.
}
else
if ( TC30A < 90&& TC30B< 90 &&TC50A< 90&& TC50B< 90&& TC27A < 90&&TC27B < 90)
The threshold temperature in °C ,lower than that means "normal operation" .It can be set to lower values if you wish
the leds to cool down for longer time ,before switching on back again,after an overheat situation...
{
digitalWrite(SSR_PIN,LOW); <= Change to LOW ,if in "protection" state ,Arduino has to output 0V
at pin 5.
}
//FAN CONTROL RULES
float TCAVERG;
TCAVERG= ( (TC30A+TC30B+TC50A+TC50B+TC27A+TC27B ) / 6 );
Averaging the six Tc s' ...Simple math here ...
if ( TCAVERG < 25 || TCAVERG >= 25 && TCAVERG < 27.5) <= Temperature range in °C ,for every Duty Cycle (Fan speed ) level ..Ignore the green part ,is a debugging feature ...(In case of Tc lower than 25°C for the arduino to know what to do ... )
{
Timer1.setPwmDuty(FAN_PIN, 384 ); <= Lower (Initial) power fan level ...
(384/1024)*100= 37.5%
}
else
if ( TCAVERG >= 27.5 && TCAVERG < 30 )
{
Timer1.setPwmDuty(FAN_PIN, 416 );
}
else
if ( TCAVERG >= 30 && TCAVERG < 32.5 )
{
Timer1.setPwmDuty(FAN_PIN, 448 );
}
else
if ( TCAVERG >= 32.5 && TCAVERG < 35 )
{
Timer1.setPwmDuty(FAN_PIN, 480 );
}
else
if ( TCAVERG >= 35 && TCAVERG < 37.5 )
{
Timer1.setPwmDuty(FAN_PIN, 512 );
}
else
if ( TCAVERG >= 37.5 && TCAVERG < 40 )
{
Timer1.setPwmDuty(FAN_PIN, 544 );
}
else
if ( TCAVERG >= 40 && TCAVERG < 42.5 )
{
Timer1.setPwmDuty(FAN_PIN, 576 );
}
else
if ( TCAVERG >= 42.5 && TCAVERG < 45 )
{
Timer1.setPwmDuty(FAN_PIN, 608 );
}
else
if ( TCAVERG >= 45 && TCAVERG < 47.5 )
{
Timer1.setPwmDuty(FAN_PIN, 640 );
}
else
if ( TCAVERG >= 47.5 && TCAVERG < 50 )
{
Timer1.setPwmDuty(FAN_PIN, 672 );
}
else
if ( TCAVERG >= 50 && TCAVERG < 52.5 )
{
Timer1.setPwmDuty(FAN_PIN, 704 );
}
else
if ( TCAVERG >= 52.5 && TCAVERG < 55 )
{
Timer1.setPwmDuty(FAN_PIN, 736 );
}
else
if ( TCAVERG >= 55 && TCAVERG < 57.5 )
{
Timer1.setPwmDuty(FAN_PIN, 768 );
}
else
if ( TCAVERG >= 57.5 && TCAVERG < 60)
{
Timer1.setPwmDuty(FAN_PIN, 800 );
}
else
if ( TCAVERG >= 60 && TCAVERG < 62.5 )
{
Timer1.setPwmDuty(FAN_PIN, 832 );
}
else
if ( TCAVERG >= 62.5 && TCAVERG < 65 )
{
Timer1.setPwmDuty(FAN_PIN, 864 );
}
else
if ( TCAVERG >= 65 && TCAVERG < 67.5 )
{
Timer1.setPwmDuty(FAN_PIN, 896 );
}
else
if ( TCAVERG >= 67.5 && TCAVERG < 70 )
{
Timer1.setPwmDuty(FAN_PIN, 928 );
}
else
if ( TCAVERG >= 70 && TCAVERG < 72.5 )
{
Timer1.setPwmDuty(FAN_PIN, 960 );
}
else
if ( TCAVERG >= 72.5 && TCAVERG < 75 )
{
Timer1.setPwmDuty(FAN_PIN, 992 );
}
else
if ( TCAVERG >= 75 ) <=Threshold temperature in °C ,where fans from there and avbove operate at chosen max level .
{
Timer1.setPwmDuty(FAN_PIN, 1023 ); <=Max value of Duty Cycle .Default: 100%
}
delay(1000); <= Refresh Rate of the system operational loop in milliseconds .Default :1 sec (1 hz ,one time every sec )
}
//END