automatic lighting

I want to make my lights in my house come on automatically when I walk into a room and to go off when I leave to save electricity I want some advise on how to do this I could use something like motion sensors but I want this to work in my bedroom but I want the lights to go off when I am asleep

Part of your answer is at...

http://www.arunet.co.uk/tkboyd/ec/ec1mains1.htm

but I want this to work in my bedroom but I want the lights to go off when I am asleep

How is the system to know you're asleep and not just reading quietly? EEG?

i could just have a switch the i can flick when i goo to bed and it will tern off the lights

must be pretty easy using PIR sensors, couple of them if ur room is big, and a normal switch hooked up to arduino to let it know u are asleep...

also a light sensor so that they dont turn on during the morning or when ur room lit by sunlight

flexy force senser need a little force to go a high output place it under you pellow so that it can be little force when you go to your bed it will give high input to the pin and then programe for you light