Monitoring Temperature Using Arduino and LM35 Temperature Sensor
by Lisleapex Blog in Circuits > Arduino
6 Views, 0 Favorites, 0 Comments
Monitoring Temperature Using Arduino and LM35 Temperature Sensor
How to use Arduino and LM35 temperature sensor to monitor temperature? Here I will give you a brief introduction
Supplies
Place the Sensor on the Breadboard
Let's connect these things first. Put the sensor on the breadboard, and then connect it to the Arduino according to the schematic below.
Connecting to Arduino
The left pin is the power pin, connected to the 5V power hole of Arduino with a red wire, the rightmost is the ground, connected to the GND hole of Arduino with a black wire, and the middle pin is the temperature data output, which we connect to the analog signal port 0 (A0). Below is the code to read the temperature value from A0. If yours doesn't work, it is likely that the left and right are reversed, just change the direction and reconnect it.
Notice
You may have noticed that there is a red CC3000 WIFI shield expansion board on the Arduino. I use this to connect to the Internet. I won’t use it now, so you can ignore it.
Coding
Now it’s time to write some code. Open the Arduino IDE and enter the following code:
Serial.begin(115200);
Serial.println(F("reading temperature begin. \n"));
Upload the Code to Arduino
After writing the code, you can upload it to the Arduino and execute it. After uploading, open the serial editor and you should be able to see the current temperature output. You can find the "Serial Monitor" in the "Tools" menu of the Arduino IDE. You can choose the baud rate in the lower right corner of the serial monitor. We have to choose 115200 baud because we set it in setup: Serial.begin(115200); Otherwise you may not see the output.
To verify, you can use a hair dryer to heat the sensor to see if the temperature changes. :)