Falling, and the fear of falling, is a serious health problem among the elderly. It often results in physical and mental injuries that have the potential to severely reduce their mobility, independence and overall quality of life. Nevertheless, the consequences of a fall can be largely diminished by providing fast assistance. These facts have lead to the development of several automatic fall detection systems. Recently, many researches have focused particularly on smartphone-based applications. In this paper, we study the capacity of smartphone built-in sensors to differentiate fall events from activities of daily living. We explore, in particular, the information provided by the accelerometer, magnetometer and gyroscope sensors. A collection of features is analyzed and the efficiency of different sensor output combinations is tested using experimental data. Based on these results, a new, simple, and reliable algorithm for fall detection is proposed. The proposed method is a threshold-based algorithm and is designed to require a low battery power consumption. The evaluation of the performance of the algorithm in collected data indicates 100 % for sensitivity and 93 % for specificity. Furthermore, evaluation conducted on a public dataset, for comparison with other existing smartphone-based fall detection algorithms, shows the high potential of the proposed method.