A Bengaluru-based software engineer has turned his restless nights into an innovative home-technology experiment by creating a smart ceiling fan that adjusts speed based on his sleeping posture.
Pankaj, who goes by the handle @the2ndfloorguy on the social media platform X, shared that the idea was born out of frustration. He often found himself waking up in the middle of the night feeling either too hot or too cold.
“I was tired of waking up at 3 am either sweaty or freezing,” he wrote, explaining that the discomfort motivated him to design a system that could interpret his body movements during sleep.
Instead of relying solely on room temperature sensors, he developed an AI-based setup that tracks posture changes throughout the night. If his arms or legs extend outside the blanket, the system interprets it as a sign that he is feeling warm and switches the fan on. Conversely, when his limbs are tucked in, indicating he might be cold, the fan turns off.
The system operates using a MediaPipe pose detection model integrated with a Raspberry Pi home server. A camera captures his sleeping position, and the model analyses joint movements to determine whether cooling is required. Based on this data, signals are sent to control the ceiling fan automatically.
Describing it as his version of a “real smart home,” Pankaj kept the setup simple yet effective. A photo shared with his post showed a modest bedroom arrangement, with digital markers outlining body joints. On-screen text reading “FAN_ON ratio=2.32” demonstrated how posture data is converted into actionable commands.
Despite the minimal hardware involved, the project highlights a practical and personalised application of artificial intelligence in everyday life.
The post quickly gained traction online, drawing praise for its creativity. One user called it the “best use of free will,” while another remarked, “Your AI roommate does more for you than most actual roommates.” A third user expressed disbelief, writing, “No way you built this. This is so cool if this actually works.”





