1. Initialize the New Project in Proteus and open new schematic file.

  2. Go to the Library to pick up parts in the Device Selection Menu and choose the components mentioned above in the hardware section.

  3. Place the components and wire them together as shown in the schematic diagram.

  4. Now, open the Arduino IDE and open the New File.

  5. Use the code given here and compile it.

  6. Go to sketch option and click on Export Compiled Binary or Press CTRL+ALT+S.

  7. Now, click on the Arduino in the Proteus and upload this .hex file saved in the Program Files.

  8. Also, Upload the .hex file in the component of Ultrasonic Sensor present in the folder of HC-

    SR04 library by double clicking in it.

  9. Click on the Play button to view your simulation running inside the Proteus.