Project showcase

# Make it Possible with Physics - Ultrasonic Thermometer! © GPL3+

In this tutorial, I will be giving the basics for an ultrasonic thermometer and the idea behind it.

• 9,779 views
• 14 respects

## Components and supplies

 HC-SR04 Ultrasonic Sensor
×1
 Arduino UNO
×1

## Apps and online services

 Arduino IDE

### Introduction

This simple project is based on the idea that "speed of sound in air strictly depends on the ambient temperature" and this difference can be calculated by a short equation:

``````Speed of sound(meters/second)=331,4 + 0,6 x (ambient temperature in degrees celsius)
``````

### Things to keep in mind:

• Speed of sound also depends on air flow (i.e. wind speed). If the environment you're planning to do this is windy, then do not expect accurate results.
• The sensor module used in the project is quite cheap and low-end. So be aware that the readings are expected to be unstable.

Even so, it's possible to get acceptable readings +/-  2°C

## Code

##### Main Arduino SketchArduino
Calculates the speed of sound and converts it to ambient temperature as mentioned in the description.
```#define echo 7
#define trigger 8
double delaytime, temperature, speedofsound;

void setup(){
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
Serial.begin(9600);
}

void loop(){
digitalWrite(trigger,LOW);
delayMicroseconds(2);         //Standard trigger-echo cycle provided by                              the manufacturer
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);

delaytime=pulseIn(echo,HIGH);
speedofsound=370000/delaytime;
temperature=(speedofsound-331.4)/0.6;
Serial.println(temperature);
delay(500);
}
```

## Schematics

Simple connection between Ardıuino UNO and the rangefinder module.

• 1 project
• 0 followers

August 9, 2016

#### Members who respect this project

and 8 others

See similar projects
you might like

#### Detecting Obstacles and Warning - Arduino and Ultrasonic

Project tutorial by Ammar Atef Ali

• 120,380 views
• 151 respects

#### Ultrasonic Range Finder

Project tutorial by Saaket Poray

• 15,712 views
• 17 respects

#### Arduino Based IR Thermometer with TFT Display and TMP006

Project tutorial by antiElectron

• 3,351 views
• 10 respects

#### One Pixel Thermometer

Project tutorial by Ian Cumming

• 2,651 views
• 8 respects

#### Ultrasonic Map-Maker using an Arduino Yun

Project tutorial by Satyavrat Wagle

• 68,030 views