I just finished a small project that might interest people who want to save a few € on their heating bill.
For now I will provide some basic information (including the code and some bad paint drawings to illustrate.
I people are interested i can provide furtherinformation. If not this post can be used by future archaeologists
Some info about the project:
We use radiators to heat our home. In our living room one of these radiators' airflow is being blocked by a sofa. This prevents hot air to rise and reduces the efficiency of the radiator.
as shown on the badly drawn picture below:
to solve this i made a construction housing a couple of 90mm fans that push are trough the radiator, thus extracting more heat from the radiators.
The circuit
- Attiny85
- TIP122 + resistor between the attiny and the tip122 to PWM the fans
- ds18b20 temperature sensor
- 10k ohm trimpot
if you read the code the circuit sould be easy enough to reproduce.
I use a 12V laptop charger to power the fans trought the tip122 and a 7805 + caps to feed the attiny85
The construction:
the fans are glued together on a wooden construction that fits perfectly under the radiator.
The code:
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 0
#define TEMPERATURE_PRECISION 9
int fanpin = 1; // this pin goes to a TIP122
int maxspeedpin = 3; //This pin is connected to a 10k Ohm trim pot that allows us to adjust the maximum fan speed
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
float fanStartTemp = 32;
float fanStopTemp = 30;
float fanFullSpeedTemp = 80;
float currentTemp;
float minimalPWM = 30;
float maximalPWM = 100;
float calculatedPWM = 0;
void setup(void)
{
pinMode(fanpin, OUTPUT);
sensors.begin();
TCCR0B = TCCR0B & 0b11111000 | 0x01; //this changes the pwm frequency so you don't get a buzzing sound from the fans
//Turn fans on min speed for 10 seconds
analogWrite(fanpin, minimalPWM);
delay(10000);
//Let the fans spin down for 5 seconds
digitalWrite(fanpin, LOW);
delay(5000);
//Turn fans on max speed for 10 seconds
calculateMaxPWM();
analogWrite(fanpin, maximalPWM);
delay(10000);
}
digitalWrite(fanpin, LOW);
}
void loop(void)
{
calculateMaxPWM();
getTemps();
calcFanSpeed();
adjustFanSpeed();
}
void calculateMaxPWM()
{
float analogValue = analogRead(maxspeedpin);
maximalPWM = (((float)255-minimalPWM)/1024 * analogValue) + minimalPWM;
}
void getTemps()
{
sensors.requestTemperatures();
currentTemp = sensors.getTempCByIndex(0);
}
void calcFanSpeed()
{
if (currentTemp < fanStopTemp) calculatedPWM = 0;
if (currentTemp >= fanStartTemp && currentTemp < fanFullSpeedTemp) calculatedPWM = minimalPWM + ((maximalPWM - minimalPWM)/(fanFullSpeedTemp - fanStartTemp) * (currentTemp - fanStartTemp));
if (currentTemp >= fanFullSpeedTemp) maximalPWM = 255;
}
void adjustFanSpeed()
{
if(calculatedPWM > 0)
{
analogWrite(fanpin, calculatedPWM);
}
else
{
digitalWrite(fanpin, LOW);
}
}
Stating the obvious:
The ds18b20 is glued to the radiator (not near a fan)
The fans start turning at minimalPWM when fanStartTemp is reached. The fanspeed is linearly increased until fanFullSpeedTemp is reached.
Some numbers:
maximalPWM is set to 100 because the fans i used started making to much noise above 100.
I use 7 90mm fans for a 120cm radiator, at maximalPWM each fan pushes about 28m³/h trough the radiator (196 m³/h). The room volume is about 100M³, so it gets cylced trough the radiator twice every hour.
Comments/questions are welcome