Pull Chain Switch

What you want to do is very feasible. There are several ways to do this, but rather than design this for you I would like to point you in the right direction. Here are some really great tutorials that should bring you up to speed.

http://opensourcehardwaregroup.com/member-pages/short-course-members/short-course-public/