This instructable uses a magnetic (reed) switch connected to a door to turn a battery-operated light on when the door is open, and off when the door is closed again.
Step 1: Materials
1 - battery operated LED light
Batteries for said light (rechargeable preferred)
1 - magentic switch, most likely labeled "normally open" (check with the mfg, as some are labeled differently). You want to close the circuit when the magnets are not touching. Internet, local electronics shop, etc.
?' of wire. You will need two conductors, which can be either in the same sheath or seperate, and it doesn't need to support very high amperage (this will depend on the size/quality of your light). I bought 16-gauge cable I believe and it is overkill.
Soldering iron (and everything that would go with a soldering project)
Screwdrivers (whatever is needed to take apart the light)
Step 2: Take It Apart
Remove the battery cover from the light. This should get you access to the remaining screws/clips that hold the light together.
Remove those screws or unhook the clips until you have access to the circuit board with the LEDs on it.
Remove the circuit board. For this model of light, the battery springs were soldered right onto the board, but they easily pulled out of the case with the board.
Step 3: Re-wire the Thing
For example, a cheap dollar store LED I bought to test with had small flimsy wire going from the PCB to the battery spring - no soldering required.
Place the battery spring back into the case and solder the second wire to the spring. Cut or trim as needed to make it fit.
Step 4: Put It Back Together
Screw or snap the PCB back into place, and route the wires out through the hole made in the casing.
It would be a good idea to take the opposite ends of the wires and touch them together to make sure it's put back together correctly. Also, the push button light will normally, for the first time, need to be pushed to turn on.
Snap the covers back onto the light to put it together.
Wire the two leads to the switch. Simply remove some of the sheath, unscrew the screws, and wrap the wires around. Test again to ensure correct installation.
Step 5: Hang It Up
Mounting the switch is probably the most time consuming. I found it best to stand on the other side of the door and place the "wired" end of the switch against the frame. This let me know how far away from the door I could be and open and close the door without issue. After mounting the wired end, mark on the door where the magnet end will be and screw it in. It's important to note that these switches work best - possibly only work - when facing a certain direction. There's an arrow on the switch as a reminder, and it's again a good idea to test before you permanently attach it. The switches need to be within close proximity or it won't work at all.