Bed sensor to help elderly and immobile patients