Photo resistors, code and Piezos! Oh My!

Hey everyone! I was wondering, I wanted to make a project that involves playing a jingle (probably from an old video game) when i turn my light on. I'm planing on doing this with a photo resistor. However, my dwelling has windows... How could I ensure that it only goes off when i turn my light on and not just with the natural light cycles? (I was just gonna disable sunlight but the admin won't let me =D ) If anyone has any tips or similar projects let me know...

(ps) as you can probably tell I'm a noob to both forums and electronics, so tearing apart a lamp is a no/no

If the sun cmoes from the window and the room light comes from a lamp then you need to find a place that one reaches but the other doesn't. I would think inside the lampshade would be pretty dim even with a sunlit room compared to having a bulb turned on. Maybe you'd have to build a little shield to further protect it from the sun. Play around with the sensor and see what you find.

I think your first step is going to be writing a simple program that reads a value from your sensor and just prints it out. That way you can move around and test different positions with the lights on and off and see how you can get the most difference.

Thanks that's a good idea! Anyone else have any?

Doesn't really matter if there's sun or not -- you're looking at the rapidity of the change in light which would denote the light in the room being turned on. The sun doesn't turn on an off instantaneously like room lights so it's pretty easy to tell the difference.