This paper presents a novel obstacle avoidance scheme for UAVs. This scheme is based on the use of a technique recently developed by one of the authors, which is based on a transformation of a variable constraint into an input saturation. In the case of obstacle avoidance, this saturation is designed so as to ensure a safe trajectory around the obstacles, offering a proof of this desired behavior. A low-cost RGB-D sensor has been used to detect obstacles as its output measurements of the environment are effortlessly interpreted even with a low power embedded processor. Experimental results are provided, together with a simulation, to prove the efficiency of the approach.