Temperature Sensor Using Arduino Uno
Temperature Sensor Using Arduino Uno
This project is used to detect the temperature of the surroundings. LM35 sensor output is passed to analog pin A2 of Arduino UNO. Finally, the analog voltage is converted to digital form for display.
Components required
Hardware
- Arduino UNO
- LM35 sensor (PIR sensor)
- Jumper/Connecting Wires
- 5 V DC Adapter
Software
- Arduino IDE
Circuit and Working
The circuit is built using Arduino Uno and LM35 sensor
The step-wise working is as follows:
Step1: Upload the sketch in Arduino Uno. A Sample sketch is shown below:
int lm35_sensor = A2;
void setup() {
Serial.begin(9600);
}
void loop() {
int temp_adc_value;
float temp_value;
temp_adc_value = analogRead(lm35_sensor); // Reading temperature from lm35
temp_value = (temp_adc_value * 4.88); // Convert adc value to voltage
temp_val = (temp_val/10);
Serial.print("Temperature is = > ");
Serial.print(temp_value);
Serial.print(" Degree Celsius => \n");
delay(1000);
}
void setup() {
Serial.begin(9600);
}
void loop() {
int temp_adc_value;
float temp_value;
temp_adc_value = analogRead(lm35_sensor); // Reading temperature from lm35
temp_value = (temp_adc_value * 4.88); // Convert adc value to voltage
temp_val = (temp_val/10);
Serial.print("Temperature is = > ");
Serial.print(temp_value);
Serial.print(" Degree Celsius => \n");
delay(1000);
}
Step 2: Connect Temprature sensor with Arduino Uno
Temprature Sensor Adruino Uno
GND > GND
VCC > 5V
Step 3: Power the Adruino Uno (use 5V Adapter)
Comments
Post a Comment