berkeralpz
Published © GPL3+

Make it Possible with Physics - Ultrasonic Thermometer!

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

BeginnerShowcase (no instructions)12,094
Make it Possible with Physics - Ultrasonic Thermometer!

Things used in this project

Hardware components

HC-SR04 Ultrasonic Sensor
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Sensor connections

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

Code

Main Arduino Sketch

Arduino
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);
}

Credits

berkeralpz

berkeralpz

1 project • 1 follower

Comments