Sheffield United midfielder Barry Robson will join hometown club Aberdeen when his contract at Bramall Lane expires.