pcbway




Ultrasonic Sensor Library for Proteus, ultrasonic library for proteus,ultrasonic simulation for proteus,ultrasonic library proteus,proteus simulation for ultrasonic,ultrasonic library in proteus,ultrasonic proteus libraryHello friends, hope you all are fine and having good health. In today’s post I am gonna share an Ultrasonic Sensor Library for Proteus. Few days ago I have posted a tutorial on Arduino Library for Proteus which also has the Ultrasonic sensor in it but that’s a quite basic library for Ultrasonic sensor, so here comes the new Ultrasonic Sensor Library for Proteus. Using this library you can perform any kind of function with ultrasonic sensor.

First of all, lets have a brief introduction of ultrasonic sensor. In ultrasonic sensor, there are two nodes in which one is transmitter while the other is receiver. The transmitter sends an ultrasonic wave and this wave strikes to any hindrance present in front of it and then bounces back. This bounced ultrasonic sensor is then captured by the receiver and on the basis of the time taken by this wave to return, the sensor calculates the distance of that obstacle from that sensor. Ultrasonic sensor is usually used for detecting the obstacle in path and also to find the distance between sensor and the obstacle. Ultrasonic sensor normally used is HC-SR04, which is also used here in this library. Let’s get started with Ultrasonic Sensor Library for Proteus, in this library we have used an extra pin on ultrasonic sensor, which is analog pin. The voltage on that pin is used to detect how close object is because its a simulation and we can’t place an actual object in front of our laptop. Moreover, you should also have a look at this Home automation Projects using XBee & Arduino, I have used this ultrasonic sensor in that project.

I hope you are gonna enjoy this library, I have also shared many other libraries which are mentioned below, I hope you are gonna enjoy them too.  These libraries are designed by our team after a lot of effort so its a humble request to all other bloggers that share it as much as you can but do mention our blog post link in the description. 🙂 So, let’s get started with it:

Note:

Ultrasonic Sensor Library For Proteus

  • First of all download this Ultrasonic Sensor Library for Proteus, by clicking on the below button.

Download Ultrasonic Library for Proteus

  • In this ultrasonic sensor library for Proteus, you will find three files which are:
    • UltrasonicTEP.IDX
    • UltrasonicTEP.LIB
    • UltrasonicTEP.HEX
  • Now, place these three files in the library folder of your Proteus software.

Note:

  • If you are using Proteus 7 Professional, then the library folder link will be something like this: C:Program Files (x86)Labcenter ElectronicsProteus 7 ProfessionalLIBRARY
  • If you are using Proteus 8 Professional, then the library folder link will be something like this: C:ProgramDataLabcenter ElectronicsProteus 8 ProfessionalDataLIBRARY
  • Now start your Proteus software and in components list, search for Ultrasonic sensor and place it in your workspace as shown in below figure:

ultrasonic library for proteus,ultrasonic simulation for proteus,ultrasonic library proteus,proteus simulation for ultrasonic,ultrasonic library in proteus,ultrasonic proteus library

  • Now we have our ultrasonic sensor in Proteus but if you run it then it won’t work as we haven’t yet added any functionality in it.
  • So, in order to add the functionality double click this ultrasonic sensor and open its properties.
  • In properties, select the Program File section and browse to UltrasonicTEP.HEX file and upload it as shown in below figure:

ultrasonic library for proteus,ultrasonic simulation for proteus,ultrasonic library proteus,proteus simulation for ultrasonic,ultrasonic library in proteus,ultrasonic proteus library




  • Now our ultrasonic sensor is ready to be used.
  • Now let’s make a simple example for ultrasonic sensor so that you get an idea how to use it in Proteus.

Ultrasonic Simulation in Proteus

  • After adding the Ultrasonic Sensor Library for Proteus, open your Proteus ISIS software or restart it if its already open.
  • Now search for the below components in the Proteus Components Library and add them in your workspace as shown in below figure.

ultrasonic library for proteus,ultrasonic simulation for proteus,ultrasonic library proteus,proteus simulation for ultrasonic,ultrasonic library in proteus,ultrasonic proteus library

  • After adding these components, now design a simulation as shown in below figure:

Ultrasonic Sensor Library for Proteus,ultrasonic library for proteus,ultrasonic simulation for proteus,ultrasonic library proteus,proteus simulation for ultrasonic,ultrasonic library in proteus,ultrasonic proteus library

  • Now in this example, I am receiving data from Ultrasonic Sensor and then printing this data over Virtual Terminal in Proteus, if you are not much familiar with Virtual Terminal, then read How to use Virtual Terminal in Proteus ISIS .
  • Now open your Arduino software and paste the below code in it and compile to get the hex file, read Arduino Library for Proteus to know how to get the Arduino Simulation in Proteus.
  • You must also read How to get the hex file from Arduino Software.




  • Its quite a simple code and is self explanatory, if you still got some trouble then ask in comments and I will reply them. I have simply used the ping example in Arduino Examples and slightly modified it.
  • After getting the hex file, now upload it to Arduino in Proteus by clicking the properties.
  • Click on the Start button and if everything’s gone fine then you will see an output as shown in below figure:

ultrasonic library for proteus,ultrasonic simulation for proteus,ultrasonic library proteus,proteus simulation for ultrasonic,ultrasonic library in proteus,ultrasonic proteus library

  • As you can see in the above figure, the virtual terminal is showing distance values, now this value depends on the variable resistance attached to the ultrasonic sensor.
  • As you change the value of the variable resistance, the voltage on that particular pin will also change and on the basis of that you will get the distance in inches and centimeters on the virtual terminal.
  • Arduino code and hex file along with the Proteus Simulation for this ultrasonic example are attached below. You can download it by clicking on the below button but I would suggest you to design it on your own, it will help you in learning.

Download Code and Simulation

That’s all for today, in the coming post I am gonna share some more examples of how to use ultrasonic sensor in Proteus. Till then take care and have fun.

27 Comments

    • Hi,

      Good to know that it worked for you. Now regarding your project, yeah we can help you in it and can provide you the complete project. Give me a call on my number +92-332-6062060 and we can discuss it in detail.

      Thanks.

  1. hi
    thank u for ur information
    I have a question,can I use ultrasonic sensors with Atmega32 to design a controlling system for example is a smart home?actually I wanna design a controlling system and I search on internet to understand that how I can simulate this controlling system by proteus
    could u please help me?
    thank u

  2. I’m getting a problem in the ultrasonic sensor.. It says the UltraSonicSensor.Hex is not found..
    Where can I get the hex file of the ultrasonic sensor? Not the hex file of the arduino board.. Thanks 😀

  3. Do these libraries only work with the pro version, I have a student edition and I’m getting an error saying product key not found, I only get it when I try to run the above simulation would I need to have a cracked version of proteus for it to work.

  4. Your UltraSonic Sensor is a micro-controller in itself.. Can you please tell me where is the HEX file of that controller.

    It keeps giving error that “UltraSonicSensor.HEX” not found in ../../../../../chipkit/workspace/
    It will be really appreciated if you reply early..

    Thank You

  5. Hi Syed Zain Nasir, I’m a french student and i work on a project which use that Sonar, I followed your instructions to use it. Thanks for all. I have just a little lack of understanding about the Arduino code. So can you explain to me the operating of it ?
    Can you send me an e-mail at : ralec.a@stjolorient.fr
    Usual greeting.

  6. Can you give me any sites that describe how we can define a component for simulation please. I have not seen any good tutorials about how to describe the functionality

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment