Sunday, February 17, 2019

Lab 16 - Ultrasonic Rangefinder and other sensors

2/12/2019

An Ultrasonic sensor uses audio waves to detect structures such as walls blacking a path; hence rangefinder. The audio waves will signal how much open range there is that is in front of the robot. The sensor receives a 10us electrical pulse to signal the sensor to activate and send out a sound at trigger point. The Echo part will receive the audio that bounces back form the wall structure. Depending on the time it takes back for the sensor to receive the feedback, the sensor will calculate the distance away that is in front of the robot.

UltraSonic Sensor Installed

The hard part of the sensor in readings is its out of limits range. If the distance in front of the sensor is more than 6 feet away, the sensor will return a -1 value. The code for that part cant be just x>-6, the sensor for the code must also include a lower bounds limit. The key to this part of the code is to be 0<x>6. That code will ignore the -1 value and allow further distance to tell the robot to keep moving forward.

Wall Avoidance Lab
Code the lab will have the robot keep going forward unless a wall is detected. Make a right turn if a wall is detected. if a wall is detected again, move left form the original orientation; or move 180 degrees after the 2nd right turn.


No comments:

Post a Comment