Ultrasonic Distance Sensor

 

Download Project

 

This example project demonstrates how to measure distance of an object with ultrasonic distance sensor using CASP.

 

Target

Vega Aries V2.0 board is used in this project. However, any supported micro-controller board can be used.

 

Description

An ultrasonic distance sensor module HC-SR04 is connected to the target board as shown in the circuit diagram. A model is developed to measure the distance of the target object from the sensor and vary the brightness of the on-board LED such that as the object comes closer to the sensor LED brightness increases. The measured data is also send to the serial port. User can see the measured data from the ‘Configure Simulation Hardware’ interface window by clicking on Simulation->Configure Simulation IO menu item from the CASP main tool bar. Please go through the individual block parameters used in the model along with respective documentation for better understanding.

 

Circuit Diagram

 

Model

Screen shot of the Configure Simulation Hardware window

 

References

Please go through our video tutorials, tutorial projects and CASP main documentation for getting started with CASP.