Phone : +8801676998099         Email : zeronebd16@gmail.com
support 24/7

How To Make a Distance Meter.

How To Make a Distance Meter.

Project Fee:Negotiable

Project Discount:0

Project Duration:One Month

[ Distance Meter ]


 Introduction:

This is a very simple and workable project. To measure the distance of an object, we can measure it with this distance meter. An interesting and workable project that you can create very easily by following the rules given by us.

Block Diagram:


 Circuit Diagram:


Advantages:

·       The distance can be easily measured.

·       Small in size so easy to carry.

·       Rechargeable System. 

 Applications:

·       It can be used very well to measure the length of an object.

 

Required Instrument:

1.     Arduino Nano.

2.     Ultrasonic Sensor.

3.     OLED Display.

4.     Battery.

5.     Charger Socket.

6.     Switch.


 Code:

//*****************************ZerOne BD*************************

//*********************ZerOne Project Solutions******************

//*********************ZerOne Tech******************

//            Code Developed By...

//            Engr.Md.Nazmuzzaman Jomadder

//            ZerOne BD

//            Contact:01676998099

//            E-mail:sumonj.eee@gmail.com

     

//            Office:

//            ZerOne BD

//            Plot#03(1st Floor),Road#04,Sec#6/ka.

//            Mirpur, Dhaka-1216

//            Contact:01676998099

//            E-mail:

//            projects.zeronebd@gmail.com

//            zeronebd16@gmail.com

//            zeronetechbd.01@gmail.com

//            Web:

//            www.zeronebd.com

//            www.zeronetechbd.com

//.................................................................

#include <SPI.h>

#include <Wire.h>

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

#define trigPin 9

#define echoPin 8

#define OLED_RESET 4

Adafruit_SSD1306 display(OLED_RESET);

void setup() {

Serial.begin (9600);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr 0x3C (128x64)

display.clearDisplay();

 

}

void loop() {

float duration;

float distance_cm;

float distance_in;

digitalWrite(trigPin, LOW); //PULSE ___|---|___

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance_cm = (duration/2) / 29.1;

distance_in = (duration/2) / 73.914;

display.setCursor(25,0); //oled display

display.setTextSize(1);

display.setTextColor(WHITE);

display.println("Distance Meter");

display.setCursor(10,10); //oled display

display.setTextSize(1.8);

display.setTextColor(WHITE);

display.println(distance_cm);

display.setCursor(90,10);

display.setTextSize(1.8);

display.println("cm");

display.setCursor(10,20); //oled display

display.setTextSize(1.8);

display.setTextColor(WHITE);

display.println(distance_in);

display.setCursor(90,20);

display.setTextSize(1.8);

display.println("in");

display.display();

delay(500);

display.clearDisplay();

Serial.println(distance_cm);

Serial.println(distance_in);

}

 

Summary:

This project is truly interesting and workable. By following the rules given to us, it will work for 100%. You can make it for your own use as it has very high accuracy.

 

 

 


N.B: If you have any problems working, please contact us and we will assist you.in-shaa-allah.