Friday, July 16, 2021

How to Interface | Use Ultrasonic Sensor with Arduino in Proteus 8

Hi guys, today I'm going to share how to interface or use an ultrasonic sensor with Arduino in Proteus 8 software. In this project, a simple code was created by TEP to measure the distance of any objects from the ultrasonic sensor. Click HERE to add an ultrasonic sensor in Proteus 8.


Components:

  • Ultrasonic sensor
  • Arduino

Steps (Standalone):
  1. Open your Proteus software and add ULTRASONIC SENSOR, POT-HG, ARDUINO UNO R3, POWER, GROUND, VIRTUAL TERMINAL and DC VOLTMETER   to the workspace.


  2. Connect two outer pins of a potentiometer to power and ground. The middle pin is connected to TestPin at the ultrasonic sensor. Then, connect positive (+) pin DC VOLTMETER to the middle pin of the potentiometer and negative (-) pin to the GROUND. Next, connect RX and TX Virtual Terminal to the TX (Pin 1) and RX (Pin 0) of  Arduino UNO R3. Lastly, connect the +5V pin and GND pin to the POWER and GROUND of the ultrasonic sensor board. For Trigger and Echo pin connect to the 7 and 6 of Arduino board.


  3. Double click the ultrasonic sensor and click the folder icon at the Ultrasonic Sensor HEX box. Go to Local Disk (C:) > Program Files (x86) > Labcenter Electronics > Proteus 8 Professional > DATA > LIBRARY > UltraSonicTEP.HEX > Open > OK.



  4. Click HERE to download the Arduino project code. Extract the project code and verify

  5. Copy the Hex file, then paste it into the Proteus Arduino board.



  6. Start the simulation

  7. As you can see, the virtual terminal is showing distance values that depend on the potentiometer attached to the ultrasonic sensor. 

  8. If the resistance value is decreasing, then the voltage and distance value is decreasing.


  9. If the resistance value is increasing, then the voltage and distance value is increasing.


Video:


If you have any suggestions, please write in the comment section. Thank you for your time 👷.

No comments:

Post a Comment