This paper proposes an obstacle avoidance algorithm for unmanned vehicles in unknown environment by a single sensor. The scan system is composed of an ultrasonic sensor and a servo motor which rotates from 0 to 180 degrees to obtain the distance data, and the profile of the obstacle can be depicted by a histogram which we use to find out the boundary of the obstacle. In this avoidance algorithm we will use the danger zone concept to judge whether the obstacle will cause a possible collision. The danger zone concept surrounds the vehicle by a sphere and uses the relative velocity to calculate the area in which obstacles will collide with the vehicle within a pre-specified time period. Combining the profile of the boundary of the obstacle with the danger zone concept, we can determine the maneuvers to avoid collisions.