Make Email Sender Temperature Alert

Hi guys,

First of all many thanks for any help you can bring me. This is my first post and my english is not the best so let's start.

I'm in Informatic course and my final exame to pass it is to do a project. It's not necessary to be a programing project because my course is related to hardware computing, but I'd like to make one.

I already have a code that I'm running in arduino that's have 3 Led´s 1 temperature sensor and 1 buzzer. The sensor measure in real time the temperature and when it pass a stipulated value the buzzer starts and the led turn red and thats it.

My teacher see it and said me that is to basic and probably fail the exame so my idea is:

Try to implant a email notification so when the temperature pass the led turn red the buzzer run and send a email to my School director saying that the servers room are overheating.

So after all of this I think that you understand what I need to do.

The next things/problems are:

  • This is possible?
  • Which ethernet board I buy to connect my arduino uno R3 to the internet
  • Help me to do this because I can't find to much thing.

Last thing is posting my code to you see what I need to implant in the code for all the things work.

One more time thanks for all of you that will help me to finish my course!

int pin = 0; // Pino analogico para ligacao do LM35
const int buzzer = 6; //buzzer no arduino porta 7

// Variaveis que armazenam a temperatura em Celsius e Fahrenheit
int tempc = 0,tempf=0; 
int samples[8]; // Array para precisão na medição

// Variáveis que guardam a temperatura máxima e mínima
int maxtemp = -100,mintemp = 100; 
int i;

void setup()
  Serial.begin(9600);     // Inicializa comunicação serial
  pinMode(11, OUTPUT);    // Define porta 11 como saída (led verde)
  pinMode(12, OUTPUT);    // Define porta 12 como saída (led amarelo)
  pinMode(13, OUTPUT);    // Define porta 13 como saída (led vermelho)
  pinMode(buzzer, OUTPUT); //Define porta 7 como saída (buzzer)

void loop()
  for(i = 0;i<=7;i++){ // Loop que faz a leitura da temperatura 8 vezes
    samples[i] = ( 5.0 /1024.0) * analogRead(pin) * 100.0 - 50;
    //A cada leitura, incrementa o valor da variavel tempc
    tempc = tempc + samples[i]; 

// Divide a variavel tempc por 8, para obter precisão na medição
tempc = tempc/8.0; 
//Converte a temperatura em Fahrenheit e armazena na variável tempf
tempf = (tempc * 9)/ 5 + 32; 
//Armazena a temperatura máxima na variável maxtemp
if(tempc > maxtemp) {maxtemp = tempc;} 
//Armazena a temperatura máxima na vari[avel mintemp
if(tempc < mintemp) {mintemp = tempc;} 

//Se a temperatura estiver abaixo de 25, acende o led verde
if(tempc < 20) 
    digitalWrite(11, HIGH);
    digitalWrite(12, LOW);
    digitalWrite(13, LOW);

  //Se a temperatura estiver acima de 25 e abaixo de 28, acende o led amarelo
if((tempc > 21) && (tempc < 22)) 
    digitalWrite(11, LOW);
    digitalWrite(12, HIGH);
    digitalWrite(13, LOW);

//Se a temperatura estiver acima de 28, acende o led vermelho
if(tempc > 23) 
    digitalWrite(11, LOW);
    digitalWrite(12, LOW);
    digitalWrite(13, HIGH);
    tone(buzzer, 1000); // Envia 1KHz sinal de som
    delay(200);        // 0,2 seg
    noTone(buzzer);     // Para o som
    delay(200);        // 0,2 seg

// As linhas abaixo enviam para o monitor serial a temperatura em 
// Celsius e Fahrenheit,
// e também as temperaturas máxima e mínima registadas

Serial.print(" Cels., ");
Serial.print(" Fahr. -> ");
Serial.print(" Min : ");
Serial.print("  Max: ");

tempc = 0;
delay(1000); // Aguarda 1 segundo e reinicia o processo
  1. Yes this is possible.
  2. Any Ethernet board will work. You may even consider WiFi.
  3. Is Google broken today?

Is not broken but I think that I'm in the best place for helping me.

Can you advice some cheap wifi shield?