This study presents a low-cost IoT system designed to detect patient head motions and postures using Force Sensing Resistors placed on a pillow. These resistors are connected to a microcontroller that collects patient data during sleep, sends it to the cloud, and makes it accessible to healthcare specialists. The aim of this work is to monitor sleep quality using affordable, easy-to-use pillows in an ambulatory setting. This approach eliminates the need for expensive, dedicated sleeping rooms, which can negatively affect both patient sleep and measurement quality. It is feasible to monitor patients' actions throughout their sleep, which is crucial for identifying factors that could lead to mild head and neck injuries.