A low cost presence detection system for smart homes