You are on page 1of 6

Temperature Sensor with buzzer and

LED

Fig-1. Breadboard with connections showing temperature sensor


LM35,buzzer, LED.

Fig-3. Circuit diagram showing connections

Fig-2.Interfacing between Breadboard and Arduino

Temperature Sensor LM35

It ranges from -55 degree Celcius and 150 degree


Celcius.

Program code in Arduino Software


float temp;
int tempPin=0;
int buzzer=10;
int led=12;
void setup() {
pinMode(buzzer,OUTPUT);
Serial.begin(9600);
beep(500);

// put your setup code here, to run once:

}
void loop() {
digitalWrite(buzzer,LOW);
// digitalWrite(led,LOW);
temp=analogRead(tempPin);
temp=temp*0.48828125;

if(temp>28)
{beep(50);
beep(50);
digitalWrite(led,HIGH);
}
Serial.print("TEMPERATURE= ");
Serial.print(temp);
Serial.print("Celcius");
Serial.println();
delay(1000);

// put your main code here, to run repeatedly:

}
void beep(unsigned char delayms)
{
digitalWrite(buzzer,HIGH);
delay(delayms);
digitalWrite(buzzer,LOW);
delay(delayms);
}

Screen showing the program in Arduino software.

Fig-4 Snapshot of Serial Communication screen where temperature is


shown

Brief note on Temperature sensor with


buzzer using Arduino Software
This project consists on a temperature sensor using Arduino
Uno microcontroller. There are one LED , a buzzer that turns on
when its corresponding temperature range is reached. It also
consists of a temperature sensor using Arduino Uno
microcontroller and the LM35 temperature sensor which is used
to obtain the temperature. The code is defined in Arduino
Software to receive the analog signal from the LM35 then
accordingly buzzer sounds and LED blinks.

You might also like