Best way to tell if a lid is open.

I've used a simple contact micro switch. with the pin as input, make sure you add a 10K pull down to ground and make the logic to trigger on the switch going HIGH. That means having a switch that you can wire as normally open. works fine and uses a little less current.