# Thermometer

Hello all, I wrote a simple code for a home 4 channel thermometer, using the Mcp9700a probe. In my case, it control the outdoor, indoor, solar panel and fireplace temperatures, and show them on a inexpensive 20\4 display.
Thanks to markal “http://starter-kit.nettigo.eu/2010/how-to-measure-temperature-with-arduino-and-mcp9700/” for the input in math calculation.
The display is connected to Arduino in the usual mode, and A0:A3 has been used for the measure input. For a stable measurement i’ve connected four 4700 ohm resistors between inputs and ground, and i’ve adjusted the “-0.5” factor in the formula, correcting it in “0.595”. This gave me a more precise measure value. Probes are connected to the 3.3 V. That’s all.
I hope this will be useful for someone else.

Below the sketch.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
float temp;
float temp1;
float temp2;
float temp3;
void setup() {

lcd.begin(20, 4);

}
void loop() {
temp = temp - 0.592;
temp = temp / 0.01;
lcd.setCursor(0, 0);
lcd.print (“T Int. “);
lcd.print(temp);
lcd.print (” C”);
lcd.print((char)223);
temp1 = temp1 - 0.592;
temp1 = temp1 / 0.01;
lcd.setCursor(0, 1);
lcd.print (“T Est. “);
lcd.print(temp1);
lcd.print (” C”);
lcd.print((char)223);
temp2 = temp2 - 0.592;
temp2 = temp2 / 0.01;
lcd.setCursor(0, 2);
lcd.print (“T Bollit. “);
lcd.print(temp2);
lcd.print (” C”);
lcd.print((char)223);
temp3 = temp3 - 0.592;
temp3 = temp3 / 0.01;
lcd.setCursor(0, 3);
lcd.print (“T Camino “);
lcd.print(temp3);
lcd.print (” C”);
lcd.print((char)223);
delay(10000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print (“Controllo” );
lcd.setCursor(0, 1);
lcd.print (“temperature casa”);
delay(500);
lcd.clear();

}

Thanks for posting,

some tips:

Learn to use arrays and loops so repeating pieces of code can be made easier:

(not tested, but it would become something like this.

``````#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

float temp[4];
char text[4][] = { "T Int. ", "T Est. ", "T Camino ", "Controllo" };

void setup()
{
lcd.begin(20, 4);
}

void loop()
{
for (int i = 0; i< 4; i++)
{
temp[i] -= 0.592;
temp[i] *= 100;
lcd.setCursor(0, i);
lcd.print (text[i]);
lcd.print(temp[i], 1);
lcd.print (" C");
lcd.print((char)223);
}

delay(10000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print ("Controllo" );
lcd.setCursor(0, 1);
lcd.print ("temperature casa");
delay(500);
lcd.clear();

}
``````

I'm more interested in how you control the outdoor temperature.

michinyon wote: I'm more interested in how you control the outdoor temperature

Wow, that would be interesting indeed, just how much of the outdoor temperature do you want to control, please don't tell me the world? Now I think I know where this global warming is coming from . . . . . . Arduino hackers controlling the outdoor climate ]:)

Paul

michinyon: I'm more interested in how you control the outdoor temperature.

Simple!! I live near the Etna volcano ( google 37.695231,15.104799 ). Thru a valves array i drive the lava close or far from my house.

My english is not perfect, in italian language "controllo" means control or to check :roll_eyes:

robtillaart:
Thanks for posting,

some tips:

Learn to use arrays and loops so repeating pieces of code can be made easier:

(not tested, but it would become something like this.

``````#include <LiquidCrystal.h>
``````

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

float temp[4];
char text[4] = { "T Int. ", "T Est. ", "T Camino ", “Controllo” };

void setup()
{
lcd.begin(20, 4);
}

void loop()
{
for (int i = 0; i< 4; i++)
{
temp[i] -= 0.592;
temp[i] *= 100;
lcd.setCursor(0, i);
lcd.print (text[i]);
lcd.print(temp[i], 1);
lcd.print (" C");
lcd.print((char)223);
}

delay(10000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print (“Controllo” );
lcd.setCursor(0, 1);
lcd.print (“temperature casa”);
delay(500);
lcd.clear();

}

You welcome. My job is in the analog electronics, from 20 year. This is my first project with a microcontroller, i’m sure that is not perfect, but it works well and i’m very proud

and i'm very proud

you have all rights to be proud! you finished a working project!

Cammelo wrote: Simple!! I live near the Etna volcano ( google 37.695231,15.104799 ). Thru a valves array i drive the lava close or far from my house.

My english is not perfect, in italian language "controllo" means control or to check

Very interesting idea Cammelo. So my understanding is you use an Arduino to read temperature sensors located in four different areas of your home and then control valves that allow either hot water or hot air to flow to those locations, is that right?

Do you use a heat exchanger to convert heat from the ground to heat the water or air?

Cammelo, you are lucky to have a natural energy source. Maybe you have some photos or diagrams of this project you can share with us?