Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Arduino & Ultrasonic Sensor Based Distance Measurement
Just Do Electronics
April 30, 2020
Arduino & Ultrasonic Sensor Based Distance Measurement
Circuit Diagram :-
Code :-
//Prateek //wwww.prateeks.in #include
LiquidCrystal lcd(12,11,10,9,8,7); const int trigPin = 6; const int echoPin = 5; long duration; int distanceCm, distanceInch; void setup() { lcd.begin(16,2); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); } void loop() { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distanceCm= duration*0.034/2; distanceInch = duration * 0.01330 / 2; lcd.setCursor(0,0); lcd.print("Distance: "); // Prints string "Distance" on the LCD lcd.print(distanceCm); // Prints the distance value from the sensor lcd.print(" cm"); delay(10); lcd.setCursor(0,1); lcd.print("Distance: "); lcd.print(distanceInch); lcd.print(" inch"); delay(10); }
Photo :-
0 Comments
Newer
Older
ESP32 Interfacing With LDR Sensor
Smart Street Light Using Arduino
How to Make a Conveyor Belt System | Counter Machine
Esp32 Cam Based Face Unlock
IoT Based Patient Health Monitoring System Using Blynk App
ESP32 And Fingerprint Sensor Based Biometric Door Lock Security System
How To Make RFID & Keypad Based Door Lock
IoT Based Fingerprint Biometric Attendance System Using NodeMCU (Esp8266)
IoT Weight Scale using Load Cell HX711 & ESP8266
ESP32 Led Blink With Push Button
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
0 Comments