TEP , The Engineering Projects , Author Welcome! Syed Zain Nasir Mechatronics Engineer TEP , The ENgineering Projects , TEP Badge TEP , The Engineering Projects , Ratting Background 7.5 7.5/10
TEP , The Engineering Projects , Rating Percentage Background Reputation Score 55 / 100
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
TEP , The Engineering Projects , Boxes

Ultrasonic Sensor Simulation in Proteus

TEP , THe Engineering Projects , Shares 2.5K Views
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest
Shares: 691
TEP , The Engineering Projects , PCBWAY
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code

Hello friends, a few days ago I posted an Ultrasonic Sensor Library for Proteus, using which one can easily simulate ultrasonic sensor in Proteus. The post was highly praised by the reader and I have received quite good feedback from the followers. So, I thought of sharing some more examples related to it so that users can get a complete understanding of how to use Ultrasonic sensors in Proteus. Today, we are gonna have a look on different Ultrasonic Sensor Simulation in Proteus. If you haven't read the previous post then first have a look at it because without the installation of Ultrasonic Sensor Library in Proteus, you won't be able to use these examples. Ultrasonic Sensor is used widely in Embedded Systems.

Today, I am gonna share three examples of Ultrasonic Sensor Simulation in Proteus, which will be enough for you guys to get the overview of this sensor. I have also attached these simulations below and you can easily download them but as I normally advise, it's better to design these simulations by yourself and write your own code as it will help you understand it more clearly. If you don't make mistakes, you won't learn from it. I am gonna share below three examples of Ultrasonic Sensor:

  • Button
  • Proximity
  • Switch
Note:

Ultrasonic Sensor Simulations in Proteus using Button

  • In this tutorial, we are gonna use three buttons and using these buttons we will control our ultrasonic sensor.
  • Think of these buttons as three obstacles, which are placed at different distances, if we hit the first button then first obstacle is reached, if we hit second then second obstacle and same as for third.
  • So, open your Proteus ISIS and if you have already installed ultrasonic library for Proteus then design your Ultrasonic Sensor Simulation in Proteus as shown in below figure:
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
  • Now open your Arduino software and paste below code in it and get your hex file to upload in this simulation.

Note:

 
const int pingPin = 7; const int echoPin = 6;  void setup() {  Serial.begin(9600);  }  void loop() { long duration, inches, cm; pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(10); digitalWrite(pingPin, LOW); pinMode(echoPin, INPUT); duration = pulseIn(echoPin, HIGH); inches = microsecondsToInches(duration); cm = microsecondsToCentimeters(duration); Serial.print(inches); Serial.print("in, "); Serial.print(cm); Serial.print("cm"); Serial.println();  delay(100); }  long microsecondsToInches(long microseconds) { return microseconds / 74 / 2; }  long microsecondsToCentimeters(long microseconds) { return microseconds / 29 / 2; }
  • After adding the hex file in this simulation, hit the RUN button and if everything goes as expected then you will get a simulation as shown in the below figure:
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
  • You can download this simulation along with Arduino code and the hex file by clicking below button:

Download Ultrasonic Sensor simulation in Proteus Using Button

Ultrasonic Sensor Simulations in Proteus as Proximity Switch

  • I have explained the first example in detail so I am not gonna much explain this one.
  • In this example, we are using the Ultrasonic Sensor as a Proximity Switch, whenever any obstacle comes in the way of ultrasonic sensor, it will automatically give an indication.
  • As you can see from the figure below that we are using a variable voltage source for the analog pin of ultrasonic sensor.
  • So, first of all design a simulation as shown in the below figure:
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
  • Now upload the Arduino hex file for this example, which is attached below along with the code and this simulation.
  • After uploading the hex file, hit the RUN button and if everything is in your favor, then you will see results similar to below figure:
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
  • As you can see in the above figure, we are sending a Ping from Ultrasonic Sensor and in the programming code we have placed an alarm at a specified distance, so whenever any object comes in that range, our program will give us Alarm, you could also use Buzzer in Proteus.
  • You can download this Proteus Simulation along with Arduino Code and hex file by clicking on this below button:

Download Ultrasonic Sensor Simulation in Proteus As Proximity

Ultrasonic Sensor Simulations in Proteus using Switch

  • Here's the third and last example of Ultrasonic Sensor simulation in Proteus.
  • In this simulation, we are using a switch and controlling the Ultrasonic with that Switch.
  • There are total four states for that Switch, which determines what should be the voltage on the analog pin of Ultrasonic Sensor.
  • I have also placed a oscilloscope in this simulation which will give you the voltage state for this switch, to get you an idea what's the voltage pattern coming to ultrasonic sensor, its mainly just for understanding and testing.
Note:
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
  • Now upload your Arduino hex file in it and hit the RUN button and you will see something like this:
Ultrasonic Sensor in Proteus,Ultrasonic Sensor Library for Proteus,ultrasonic proteus simulation,ultrasonic sensor code
  • As you can see above, the virtual terminal is showing the distances while the oscilloscope is giving us state of switch, play with it and you will learn more and if still confused then ask in comments.
  • You can download the Proteus simulation of this example along with Arduino hex file and code by clicking on the below button.

Download Ultrasonic Sensor Simulation in Proteus Using Switch

That's all for today, hope you guys have learn something today, if you have any problem or question, do ask in comments and I will try my best to resolve them. Take care :)

TEP , The Engineering Projects , Tags
Ultrasonic Sensor in Proteus
Ultrasonic Sensor Library for Proteus
ultrasonic proteus simulation
ultrasonic sensor code
TEP , The Engineering Projects , Comments

Write a Comment

TEP , The Engineering Projects , WordPress TEP , The Engineering Projects , Google TEP , The Engineering Projects , Twitter TEP , The Engineering Projects , Facebook TEP , The Engineering Projects , User
TEP , The Engineering Projects , Robot
TEP , The Engineering Projects , Comments Comments on ‘’ Ultrasonic Sensor Simulation in Proteus ‘’ (17)
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
I have explained the function of SimPin in my previous post, in simulation you can't place any object in front of this ultrasonic sensor so using this pin you can do this virtually, The output of ultrasonic will depend on the voltage at this pin.
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
You can design the complete simulation, but instead of placing some parking object in front of the sensor you have to change voltages on the SIMPin and it will work the same.
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
Am simulating the circuit and am geting an eeror " Internal Exception access violation in module 'UNKNOWN'(00000000). What may be a broblem.? Is there anything I have to do in the ultrasonic sensor like pasting a file or other spesfications
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
Sir, could you learn me about your C language that you insert to Ultrasonic sensor ( C language of Ultrasonic sensor.hex) every your example Thanks very much, before I am Siswanto
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
Sir, could you learn me about your C code that you insert to Ultrasonic sensor ( C code of Ultrasonic sensor.hex) every your example Thanks very much, before I am
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
hello, thank for your contribution toward those that want to follow your footstep in the field of programming. I tried to simulate the ultrasonic sensor with atemga16 using the library you post. but i'am unable to. but the program work correctly when it was implemented in the hardware. pls help. thank you.
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
hello, pls is it possible to simulate ultrasonic sensor with avr instead of using arduino board? if yes pls how? because i have been trying but i have never achieved it.
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
Asalam O Alaikum Syed Zain Nasir Bhai, Hope you are doing well and prayers for your hardworking upon sharing the knowledge to mankind. I am in search of a simple Ultrasonic Sensor Used to detect Only and Only ultrasonic sounds not made by PIC, Can you guide me about it please? Hope for a favorable action. Thanks!
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
hi, I have a problem, I typed the same code and I did the same schematic, but when I run the simulation on isis a message "External DLL model" picEX16 "not found GLE = 0 * 0000007E "can anyone help me please
TEP , The Engineering Projects , Comment
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
I tried simulating the first one "Ultrasonic Sensor with Buttons", but when i Simulate I get the error - "External module DLL "PIC16EX.DLL" not found. GLE=0x00000007E". But when I enable the option of "Attach hierarchy module" the Ultrasonic sensor then it runs, but the Virtual Terminal always says 0cm, 0inch. Would be great if you could solve this, even Google doesn't help ;-) info: I'm using Proteus 7.6 Thanks in Advance!
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Top PCB Design Service

PCBA
TEP , The Engineering Projects , JLCPCB
PCB
TEP , The Engineering Projects , JLCPCB
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Embedded Tools

ARDINO TEP , The Engineering Projects , JLCPCB
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Subscribe Now !!!

Learn Free Pro Tricks

TEP , The Engineering Projects , Mail Receive Quality Tutorials Straight in your Inbox by Submitting your Email ID Below
TEP , The Engineering Projects , Mail TEP , The Engineering Projects , Mail Shadow
TEP , The Engineering Projects , Mail Robot TEP , The Engineering Projects , Mail Robot Shadow TEP , The Engineering Projects , Mail Robot Shadow
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Engineering Books

TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for arduino $20
TEP , The Engineering Projects , Rating Stars (5.0)
TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for Raspberry Pi $20
TEP , The Engineering Projects , Rating Stars (3.0)
TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for arduino $20
TEP , The Engineering Projects , Rating Stars (4.7)
TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for Raspberry Pi $20
TEP , The Engineering Projects , Rating Stars (5.0)
TEP , The Engineering Projects , TEP Robot TEP , The Engineering Projects , TEP Robot Shadow TEP , The Engineering Projects , TEP Robot Shadow
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Categories

TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K