Life expectancy has increased, so the number of people in need of intensive care and attention is also growing. Falls are a major problem for older adult health, mainly because of the consequences they entail. Falls are indeed the second leading cause of unintentional death in the world. The impact on privacy, the cost, low performance, or the need to wear uncomfortable devices are the main causes for the lack of widespread solutions for fall detection and prevention. This work present a solution focused on bedtime that addresses all these causes. Bed exit is one of the most critical moments, especially when the person suffers from a cognitive impairment or has mobility problems. For this reason, this work proposes a system that monitors the position in bed in order to identify risk situations as soon as possible. This system is also combined with an automatic fall detection system. Both systems work together, in real time, offering a comprehensive solution to automatic fall detection and prevention, which is low cost and guarantees user privacy. The proposed system was experimentally validated with young adults. Results show that falls can be detected, in real time, with an accuracy of 93.51%, sensitivity of 92.04% and specificity of 95.45%. Furthermore, risk situations, such as transiting from lying on the bed to sitting on the bed side, are recognized with a 96.60% accuracy, and those where the user exits the bed are recognized with a 100% accuracy.