Nick Koumaris
Published © CC BY

DIY Distance Meter with Arduino and a Nokia 5110 Display

In this tutorial, we are going to see how to build a very useful distance meter with a big Nokia 5110 LCD display using Arduino.

BeginnerFull instructions provided1 hour10,152
DIY Distance Meter with Arduino and a Nokia 5110 Display

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Code snippet #1

Plain text
<p>String readSensor()<br>{
  String distanceS = "0";
 digitalWrite(trigPin, LOW); 
 delayMicroseconds(2); </p><p> digitalWrite(trigPin, HIGH);
 delayMicroseconds(10); 
 
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 
 distance = duration/58.2;
 distanceS = String(distance);
</p><p>if(distance>maximumRange || distance <minimumRange</p><p> {
   distanceS = "---";
 }
 
 delay(50);
 return distanceS;
}</p>

Credits

Nick Koumaris

Nick Koumaris

13 projects • 224 followers
My name is Nick Koumaris and I am a software engineer from Sparta, Greece. I love building projects and share them with the world!

Comments