Total Pageviews

Wednesday, May 20, 2015

Arduino thermostat on 7-segment LED display

   I designed a thermostat with few components using an Arduino board.
   I use LM35DZ for temperture sensor, KW4-563ASA display (4 digit 7-segment with common anode), RGB led, 3 button (push button) for select and change the value for desired temperature and for hysteresis.
   I designed this schematic:
who is used also for an thermostat with 2 thesholds (must change the sketch).
   If measured temperature is less than desired temperture, blue led is on:
and if is to much, red led is on:
   If I push the MENU buton, display is change in:
(in right side, is "c" instead "C"). 
   If I push "-" button, temperature value decrease with 0.1 degree Celsius for each push, if I push "+" button, temperature increase with 0,1 degree Celsius for each push.
   After that, if I push again MENU button, I will see:
and I can change the value with 0.1 degree, like at desired temperature.
   Values for desired temperature and hysteresis are write and stored in internal EEPROM memory of microcontroler (any Arduno board has an microcontroller on it.)
   For easy understund this, I made a movie named Arduino thermostat
   Skech for this thermostat is put on https://github.com/tehniq3/thermostat !!!

PS:  Fist time when upload the sketch, must write default value for desired temprature and hysteresis:
after that, must comment the 3 lines:
   Actual sketch work with Arduino Uno board and you can see:
but for work with Arduino Mega board you must comment first line and uncomment second line:
PS2: If you want to connect a relay for control a heater system, subroutine leduri() must be changed in:
void leduri() {
 digitalWrite(CALD, LOW);
 digitalWrite(RECE, LOW);

if ( t0*10 < tset ) 
{  digitalWrite(RECE, HIGH);
   digitalWrite(CALD, LOW);
   pornire = 1;
}
if ( t0*10 > tset + dt ) 
{  digitalWrite(CALD, HIGH);
   digitalWrite(RECE, LOW);
   pornire = 0;
}

if (( t0*10 <= tset+dt ) && ( t0*10 >= tset )) {
if (pornire == 1)
{  digitalWrite(CALD, LOW);
   digitalWrite(RECE, HIGH);
}
if (pornire == 0)
{  digitalWrite(CALD, LOW);
   digitalWrite(RECE, LOW);
}
}
}
and at begin of sketch must define int pornire; and in setup must put pornire = 0; !!
   You can download changed sketch from https://github.com/tehniq3.
   In movie namend Arduino thermostat (2) you can see the changed style, like usual thermostat for a heater:

16 comments:

  1. Really fascinated article. Thanks for spreading the knowledge.

    Heating and Cooling Mississauga

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Hello very dear Nicu,

    I participate from France and thank you for all your beautiful share, you are a genius nothing to say, thank you very much for all this extraordinary sharing.

    As I make cheese at home, I need to control a refrigerator without a freezer to refine the cheese, I wanted to use Arduino system to control humidity and temperature of the fridge.

    My project is to use a Keypad Shield 1602 with 5 + reset buttons, an arduino uno or mega, a DHT22 and a relay module 2 outputs one for the temperature and one for the humidifier but as I am a beginner in the field Arduino I instruct me with you.

    Thank you with all my heart for your instructions, I respect you. Very good continuation.

    ReplyDelete
  4. Hi,

    I'm very bussy now, but see project from https://nicuflorica.blogspot.ro/2015/08/termostat-cu-control-umiditate.html
    In project it used LCD1602 and 3 buttons... sensist is AM2302 (DHT22)
    In article from https://nicuflorica.blogspot.ro/2015/08/termostat-cu-control-umiditate-2.html it used DHT22 or DHT11 for humidity and DS18B20 for temperature measurements

    ReplyDelete
  5. Good afternoon.

    In the sketch error. ???????

    Добрый день.
    Вроде тут ошибка ???
    ====================

    //displayNumber(t0*10);

    if (meniu == 0) {
    int numara = 0;
    while (meniu == 0) {
    numara = numara + 1;
    if (numara == 1000)
    {
    // float t = analogRead(LMPIN);
    // float t0 = t *500 / 1023;
    ??????????????????????????????????????????

    citire(); ??????????????????

    ??????????????????????????????????????????
    t0 = (t0 + t2) /2;
    leduri();
    // delay(5);
    numara = 0;
    Serial.print("t = ");
    Serial.println(t0);
    // displayNumber(t0*10); // this is number to diplay
    }
    te(t0*10); // this is number to diplay
    t2 = t0;
    if (digitalRead(BUT3) == LOW)
    { meniu = 1;
    delay(250);
    }
    //Serial.print("t = ");
    //Serial.println(t0);
    //delay(5);
    }
    delay(5);
    }

    =====
    Good afternoon.
    In the sketch error. ???????

    Добрый день.
    Вроде тут ошибка ???

    ReplyDelete
  6. when download sketck from https://github.com/tehniq3/thermostat/blob/master/thermostat_rev2m2.ino not use translate because can be replace good character

    ReplyDelete
  7. ПРИВЕТ.
    А КАК ТУТ МОЖНО ПОДКЛЮЧИТЬ ЧЕРЕЗ регистр 74HC4094

    ReplyDelete
  8. Thank you so much for everything you do.
    Transport fans

    ReplyDelete
  9. Hi
    Please insert this project with ds18b20 sensor

    ReplyDelete
    Replies
    1. you can try yourself... you must add DS18B20 temperature reading and remove for LM35 measurement

      Delete
  10. This article covers a lot more updates from south Carolina. The temperatures there varies a lot.
    http://www.cosmopolitanmechanical.ca/

    ReplyDelete