Temperature Sensor using Arduino

A temperature sensor is an interesting application and I decided to build one using my Arduino. To build this, you’ll need basic understanding of Arduino and you should be familiar with the Arduino IDE as well as some basic electronics concepts.

What is an Arduino?

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs – light on a sensor, a finger on a button, or a Twitter message – and turn it into an output – activating a motor, turning on an LED, publishing something online. Read more about it here.

Arduino Uno or pretty much any other Arduino

Arduino Uno for arduino based temperature sensor
Arduino Uno

LM35DZ Temperature Sensor

LM35DZ Temperature Sensor for arduino based temperature sensor
Temperature Sensor

Jumper Wires

Jumper Wires for arduino based temperature sensor
Jumper Wires

Arduino Proto Shield or a Breadboard

Breadboard for arduino based temperature sensor

Obtaining the necessary software

To build this project, you’ll need to obtain the Arduino IDE. You can use it to write your Arduino applications (commonly known as Sketches). To download the Arduino IDE follow the instructions here.

Step 1: Connect the Arduino to the LM35DZ Temperature Sensor

The LM35 has 3 pins. The Vs, Vout, GND should be connected to the Arduino’s +5v, Analog In 0 and GND pins as shown below.

Wiring diagram for arduino based temperature sensor
Temperature Sensor: Fully assembled

Step 2: Fire up the Arduino IDE and create a new sketch with the following code

Step 3: Verify & Upload the code to your Arduino

Code for arduino based temperature sensor
The Code

You should see this on the serial console. Make sure the baud rate is set to 9600 to view it.

Serial Console for arduino based temperature sensor
Serial Output

After leaving the sensor assembly in my window for a couple minutes. It matched the temperature on Yahoo Weather!

Yahoo Weather
Weather at San Jose, CA

In the near future, I am going to build this on an esp8266 instead of an Arduino so I can collect this data over my WiFi network at home. Stay tuned.



Senior Software Engineer @ Apple | ex-Yahoo Finance Eng | Distributed Computing @ Georgia Tech | Python, Java | Scalability, ML/AI, C* | 🇮🇳 | Opinions mine only

Also published on Medium.

2 Replies to “Temperature Sensor using Arduino”

Leave a Reply