Existing methods for measuring sleep postures primarily involve installing cameras above the bed to photograph and analyze sleep postures, or attaching sensors directly to the body to measure changes in sleep postures. However, these methods typically require a visit to a hospital and attaching sensors to the body for sleep analysis, hence, to overcome these issues, a new method of measuring sleep postures was devised using pressure sensors in mattresses. But placing over 50 pressure sensors across the entire mattress led to increased production costs and the need for substantial computing resources to handle complex data processing. To solve these problems, this study proposes a smart sensor and an improved algorithm that concentrates 13 pressure sensors in the upper body area of the mattress for measuring sleep postures. The smart pressure sensors are strategically placed in areas where body weight is primarily concentrated, such as the shoulders, chest, and elbows, to collect data. The data is then processed by the sleep posture classification algorithm, effectively categorizing the user