Distance measurement using ultrasonic sensor with arduino proteus simulation | Jeet.org
ฝัง
- เผยแพร่เมื่อ 28 พ.ค. 2019
- #jeetorg
This simulation is ultrasonic sensor interfacing to the arduino in proteus software measurement in the cm.
with 16*2 display also
Arduino code :
include "LiquidCrystal.h" //lcd libary
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //LCD object Parameters: (rs, enable, d4, d5, d6, d7)
const int trigPin = 12; //trig pin connection
const int echoPin = 11; //echopin connection
long duration;
int distanceCm;
float liquid;
void setup() { // setup perameter
lcd.begin(16,2);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
lcd.setCursor(0,0);
lcd.print(" Distance ");
lcd.setCursor(0,1);
lcd.print(" Measurement ");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" Made By ");
lcd.setCursor(0,1);
lcd.print(" Jeet.org ");
delay(2000);
lcd.clear();
}
void loop() { // loop of flow program
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distanceCm= duration*0.034/2;
lcd.setCursor(0,0);
lcd.print("Distance Measur.");
delay(10);
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distanceCm);
lcd.print(" Cm ");
delay(10);
}
Library link:
drive.google.com/drive/folder...
Thanks you for watching📺 this video🎞 ....... :)
Please🙏 Like👍 Share Subscribe 🔴
Our Playlist
1) SCADA - Tutorial
• SCADA - Tutorial
2) PLC - Programming Tutorial
• PLC - Programming Tuto...
3) Proteus and Arduino
• Proteus and Arduino
4) Proteus
• Proteus
5) Fritzing
• Fritzing
6) Start Here to C language Programming
• Start Here to C langua...
7) Just information
• Just information
🏳🌈 #jeetorg
--------------------------------------------------------------------------------------------------------
Music:
Track: Julius Dreisig & Zeus X Crona - Invisible [NCS Release]
Music provided by NoCopyrightSounds.
Watch: • Julius Dreisig & Zeus ...
Free Download / Stream: ncs.io/InvisibleYO
Wow! What a powerful tutorial with a very clear code. The BEST Projectl Ever.
Remain Blessed Sir!
Thanks you
Perfect keep it up👍
Hey dude, how is it going? I'm trying to understand your code (well, what is it that it exactly does), and i don't quite understand how you set the distance. I get that you can change the distance measured by device by using the variable resistor (although, i don't know exactly why nor how, i don't have any idea what the test pin should supposedly be doing hahahahahaha), however it would seem as the range of measured distance is always between 4cm and 1116cm. why is it? is it because of the device's charachteristics? Idk, i thought this device's range went up to 400cm? idk, i'm just confused. Also, the part where you use the delayMicrosecond() function, what is it for? I thought you may be using it to set the pulse's time duration? but after changing it, i didn't see much change in the measured values (except for when i set said delay at a value below like 5. Below this, it wouldn't measure anything), so I'd like to understand a little better what it is used for. Have you got another video that I'm not aware of where you explain the code maybe? hahahaha I'm sorry if this is too long, my bad. However, some explainning would be very much appreciated. Have a good one ;)
Thank you support me
This is a virtual project in Proteus Simulation software here i check a hardware as well as my code is properly work or not so make this project
if you need customize your in range in cm meter inch. etc.
second question is why use in delayMicrosecond() ?
> Answer is any sensor have taken to few micro second complete this one loop so this function is use in code.
if any query in future please contact me in my official mail it mention in about page.
thank you
Hi, I need a help how to convert the Nodered for this project
Good one dear keep growing 👍
Thank you 4 appreciate
@@jeet_e_n_e hope you also support me back by subscribing my channel
Thanks for sharing it is working well
Most welcome @electronicshub
@@jeet_e_n_e please sharing more Proteus based simple project like this!
Appreciated ❤️
Please I’m currently having the potentiometer increment issue, the reading is not changing
What a sound ..big sound polution
We will improve in next video
can you plz tell code of the ultrasonic sensor as the code you have written down is for the Arduino right?
Yes, Arduino IDE
why when I try to run it's stuck at 4cm min
thanks for this project, but my proteus is not finding Arduino and Ultrasonic sensor in the librari. WHY?
First check your license and second library path of given to in Proteus folder in c drive
Thanks for asking this question :)
Bro distance does not change when I increase or decrease the potentiometer resistance. It is always fixed to 4cm. Please help.
Re uploaded program and restart your Proteus software
Yeah its the same for me. Did u fixed it??
Bro can u pls send me code and connection to my mail I'd I'm in trouble as in my old project in the last step I'm get 507 unable to connect to bluetooth device
Why is pot used also at value should I keep it constant
Port is use because this is simulation so no need to change in ultrasound output signal
So port resistor value is set 1k and make connection same in video
Im increasing and decreasing through pot hg but distance remains 4cm
Check your programs first
Or hex file also is updated or not in Proteus software
Thanks for asking me 😊
Aoa mere Waly arduino me reset k beechy 2 wires wala option hi ni h VCC or hbd.what should I do ?
Do same thing, once your power supply gone your Arduino is reset, no problem
I am not getting Vcc pin on arduino. It only shows Reset pin. What to do?? TIA
No problem just other connection and run simulation
Some library is not given this pin it's fetch internally
Thanks for asking this question :)
Ram Chandra Rout Arduino
could anyone please tell me roll of pot hg here and how it works...please and as soon as possible..
thank you...
sorry i can't understand "pot hg" ????
thank for reply me
we cannot put obstacle in simulation so he used potentiometer to show it. If potentiometer is at high then the obstacle is near , if it's low obstacle is far away .Hoping this is helpful
Bro if we want to replace arduino by atmega 328p ... Than how we can do... Please help me bro... Is there change in code
Code is changed
Sir ...4cm distance shown in lcd display is constant and not changing .y?
Just click on input terminal and change it to 5v.
Tnku sir 🙏🙏
Thanks for supporting to our YT family
Which app you are using?
Proteus and Arduino
Can i put on the distance measurement? For example 0cm to 100cm?
Yes you can set value in program
How can we set the values in program please help!!
bro how to get library for the arduino used in this video....please help
Which you need
I using "liquidCrystal.h" is also Available in Arduino software
If you get it please contact me on my office email address
Thanks you
Error reading HEX file '..\Desktop\sketch_jul3a\arduino .HEX' at line 1: Colon expected at start of line.. [ARD1]
i am getting this message.
and also real time error
This error is display in Arduino ide or Proteus ...
I wnt same o/p.. Only by using 3 ultrasonic sensor!!!!
It's possible
Define other digital pin to you added sensor
And copy this same code in void loop
When I run the simulation it says " Invalid opcode 0xFFFF at PC=0x3802
" pls help :(
It's May be your license issue if is not so re-upload your code in .hex file in Proteus
I have problem on LCD panel
Is showing access violation in module
What can I do
Please check your LCD library not more ...
@@jeet_e_n_e yes thank you it's very helpful
hi! where can i get ultrasonicTEP file?
Read in discription
Available in Google drive link
can you make arduino proteus project for me using 7 sensors? if yes please reply i can give you money for that.
Contact to me in business email
Please check channel description
why my simulation doesnt work? the LCD display not changing after i adjust the potentiometer. it keeps display 4cm
Solution : double click on the power input. Set the voltage to 5V
yeah, me too
@@iqbalpermana7413 double click on the power input. Set the voltage to 5v
Check the Programming in trig pin and connection to this pin
Ex. me use 12 no pin in this example
code is description
thank for reply me
@@firhanrizani96 Yes @Firhan Rizani is Right
Me too :(
Sir showed no error, but the distance did not change, why? Can you help sir?
Yes same problem with me also
Please if you know that please help me
How to vary the distance Range..I'n code?
Yes, you using "map" function can done ✅
@@jeet_e_n_e thank you
Duration was not declare ka error aaya hai sir
hello could you send the ultrasonicTEP file?
Contact to our emails is mention in about of channel
Thank you
can we do this same simulation in tinkercad?
Yes do this
I make it but start in series of Arduino tutorial from scratch
@@jeet_e_n_e how to measure distance in feet?
The HC-SR04 ultrasonic sensor readings in an easy-to-use package from 2 cm to 400 cm or 1” to 13 feet.
so you simple change in your code
1cm = 0.0328084 foot
Feet = cm / 0.0328084
# include "LiquidCrystal.h" //lcd libary
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //LCD object Parameters: (rs, enable, d4, d5, d6, d7)
const int trigPin = 12; //trig pin connection
const int echoPin = 11; //echopin connection
long duration;
int distanceCm;
int distancefoot;
float liquid;
void setup() { // setup perameter
lcd.begin(16,2);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
lcd.setCursor(0,0);
lcd.print(" Distance ");
lcd.setCursor(0,1);
lcd.print(" Measurement ");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" Made By ");
lcd.setCursor(0,1);
lcd.print(" Jeet.org ");
delay(2000);
lcd.clear();
}
void loop() { // loop of flow program
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distanceCm= duration*0.034/2;
distancefoot= distanceCm/0.0328084;
lcd.setCursor(0,0);
lcd.print("Distance Measur.");
delay(10);
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distancefoot);
lcd.print(" Foot ");
delay(10);
}
How much distance is measured for this device
Ultrasonic sensor HC-SR04 is used here to measure distance in range of 2cm-400cm with accuracy of 3mm.
In proteus, my uno board doesn't have VCC pin.. Then what would I do?
It's good thing, your library is up-to-date so no need to VCC pin connection it is connected by default
Ignore it and do practical all the best
@@jeet_e_n_e then where I will connect the +5 V pin of ultrasonic sensor with? And also how I'll connect the potentiometer and UNO board?
Please sir tell me... All setup is done except this connection... So I can't stimulate... Please tell me... 😟😟😟😟
External +5V DC supply in Proteus tools
@@jeet_e_n_e
What's the connection among ultrasonic sensor, potentiometer and uno board??
@@jeet_e_n_e I have added this... I'm asking how I'll connect this DC with arduino UNO board??
Bro can you do the project using microcontroller
Yes, why not
Thank you bro. When?
please give me the arduino library
find in google search easy to download
thank for reply me
iski labiray kidhr pari hai IMO16 OR ultrasonic sensor wali
Inside the Proteus software
If is not available download manual in Google
It work 💯%
@@jeet_e_n_e sir can you contact me at wattsapp
Please contact me my email
@@jeet_e_n_e SEND EMAIL
where can i get ultrasonic.tpe?
I will send you :)
@@jeet_e_n_e thank you so much☺️
@@jeet_e_n_e Plz send the ultrasonic.tpe file to my email : devanneymar10@gmail.com
how it can be done in Raspberry pi??
Library changed & some sentences changing.
Raspberry Pi is work on python language so this is changing
@@jeet_e_n_e is the code is same for raspberry pi? If no then what are the changes have to do??
Not same code to use, totally code is changing Raspberry Pi is Base language is python and Arduino base Language is c++ so u can't use as Raspberry Pi
Find some other tutorial in YT
Thanks for contacting me :)
from where i can get that ultrasonic.tep ?
I will provide you in email
Please contact to my official e-mail address
Thanks you for asking
@@jeet_e_n_e Thank you for replying ..I have downloaded it from a source ...
Ok
@@ShirjeelAliHaider bro where did you download it from?
@@akshatrajsharma Bro I forgot what was Ultrasonic .tep
Is it a file ? Or a library ?
I think I downloaded it from somewhere on google
Sorry I don't remember exactly now
Can you tell the code ultrasonic ?
Hamza.mahassine.03@gmail.com
See in discription all details is available
phone nomber
Contact me on email
mention in about of my channel
Thank you
How about removing the stupid music and add some explanations next time?
Put your volume in mute mode otherwise pressure 'M' key in laptop/PC