Bengaluru: A Bengaluru-based software engineer has gone viral on social media after sharing how he built an AI-powered “roommate” that automatically adjusts his ceiling fan based on his sleeping posture.
The innovation was posted on X by Pankaj, who goes by the handle @the2ndfloorguy. In his now widely shared post, he explained that the project was born out of a simple but relatable problem — waking up at 3 am either sweating or feeling too cold.
“I was tired of waking up at 3 am either sweaty or freezing,” he wrote, detailing how he trained a system to monitor his sleep posture and control the fan accordingly.
How the AI system works
Bengaluru, known as India’s tech capital, has long been a hub for experimental and practical technology innovations. Pankaj’s home-grown solution adds a quirky yet functional example to that list.
According to his post, the system interprets body posture as an indicator of comfort level. If his arms or legs are sticking out from under the blanket, the AI assumes he is feeling warm and switches the fan on. Conversely, if his arms are curled up or tucked in — suggesting he might be cold — the system turns the fan off.
The setup uses a remote button pusher device that physically presses the fan’s wall switch after receiving signals from the AI system. This means the arrangement does not require a smart fan or rewiring, making it relatively simple to replicate.
At the core of the project is a Raspberry Pi home server running a MediaPipe pose vision model. MediaPipe, an open-source framework developed by Google, enables real-time pose detection by identifying body landmarks from camera input.
The system processes live video feed, detects sleeping posture and calculates a ratio to determine whether the fan should be turned on or off. An image shared in the post showed a modest bedroom setup with a camera overlay marking body joints and a label reading “FAN_ON ratio=2.32”, visually demonstrating the pose detection in action.
“That’s it,” Pankaj wrote, describing it as what a “real smart home” looks like — not just automated gadgets, but personalised, context-aware solutions.
Social media reacts
The post quickly gained traction on social media, with users praising both the creativity and the technical execution of the idea.
One user commented, “You are building solutions every other day like they are a piece of cake! Total out-of-the-box thinking and great use of tech.”
Another quipped, “Your AI roommate does more for you than most actual roommates.”
Several users lauded the project as a practical application of Artificial Intelligence, noting that it went beyond convenience-based automation to deliver personalised comfort. Others jokingly asked for a tutorial or a GitHub link so they could recreate the setup in their own homes.
Practical AI beyond hype
The viral post comes at a time when AI conversations are often centred around large language models, generative art and enterprise automation. However, Pankaj’s project highlights how accessible tools such as Raspberry Pi boards and open-source vision frameworks can be used for everyday problem-solving.
Bengaluru’s thriving tech community has a culture of tinkering and experimentation, with many professionals building side projects that blend hardware and software. From home automation systems to low-cost IoT devices, such innovations often begin as personal hacks before inspiring wider adoption.
While the system’s current version appears to operate on a simple binary logic — fan on or off — it could potentially be expanded to include temperature sensors, humidity tracking or even variable fan speeds.
Conclusion
Though built as a personal comfort solution, the AI-powered fan controller underscores how technology can be meaningfully integrated into daily life. By combining open-source tools, affordable hardware and a bit of ingenuity, the Bengaluru techie has demonstrated that smart living does not always require expensive ecosystems — sometimes, it just takes solving a problem you face at 3 am.
