You may construct given in the link below to automatically control the light as to swithc on during dusk and switch off during dawn. **broken link removed**
If you meant counting the visitors and controlling the room light accordingly, you may download a similar project using 89S52 microcontroller with source codes from this link http://www.8051projects.net/request119.html