Here we will use 2 Ultrasonic sensors. An ultrasonic sensor is a great tool for all kinds of projects that need distance measurements. Obstacle avoidance is one of the examples. Ultrasonic sensor HC-SR04 is used in this lab to measure distance in the range of 2 cm to 400 cm with an accuracy of 3 mm. The sensor module consists of the control circuit and two ultrasonic sensors — one is the transmitter, another is the receiver. The HC-SR04 sensor uses two signal pins, one is for trigger PA3-PA2 and another is for receiving echo signal PB2-PB0. The "trigger" pin is connected to the output pin of GPIO, and the "echo" pin is attached to the Input Capture pin of Timer in the Tiva LaunchPad. The HC-SR04 sensor must be "triggered" in order to enable pulsing. Therefore, you need to set the GPIO output pin high and then low. The sensor documentation discusses how long the trigger pulse should be. The echo signal received from the sensor will rise and then fall on the "echo" pin. The distance between these two edges is directly proportional to the round-trip distance between the sensor and the object. Input capture when properly configured to Edge-Time mode will identify the edges of the signal and set TIMERn_TAR_R to the current counter value when the events/edges are detected. The difference in counter values represents the signal's pulse width as time. The actual amount of time can be determined when the system clock frequency is used to compute the amount of time each counter value represents.
-
Notifications
You must be signed in to change notification settings - Fork 0
An ultrasonic sensor is a great tool for all kinds of projects that need distance measurements. Obstacle avoidance is one of the examples. Ultrasonic sensor HC-SR04 is used in this lab to measure distance in the range of 2 cm to 400 cm with an accuracy of 3 mm. The sensor module consists of the control circuit and two ultrasonic sensors — one is…
AhmedIsmail02/Interfacing-UltraSonic-Sensor-with-TIVA-C
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
An ultrasonic sensor is a great tool for all kinds of projects that need distance measurements. Obstacle avoidance is one of the examples. Ultrasonic sensor HC-SR04 is used in this lab to measure distance in the range of 2 cm to 400 cm with an accuracy of 3 mm. The sensor module consists of the control circuit and two ultrasonic sensors — one is…
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published