Using keychain as power switch

I'm new to the topic of Arduino, so I apologize in advance if this is a beginner question. What I intend to do is quite simple: I want to add some kind of sensor to my keys, which will switch on the power sockets in my house when the keys are present at a specific location. When the keys are not present at this location, the power sockets are to be turned off.

I've found quite a number of tutorials on how to control the power switch, so that's not the problem. However I am struggling with the switch. Initially I thought an RFID keychain could make sense, however as far as I understand, this would control the switch by swiping the keychain over the sensor (right?). This is not the aim though. It should be switched on based on presence, and switched off based on the absence of the keychain.

I also thought about a magnetic switch, however since keys are made out of metal, this isn't a realistic solution either. Any thought on what kind of method I could use to detect the presence of the keys?

There are RFID detectors that will do what you want, and allow a range of a dozen cm or more (so you don't need to swipe anything). A lot of hotels use them -- you put your RFID room key in a wall holder and only then will the room lights turn on.

Another possibility would be to use a little OOK (on/off keying) radio pair. The radio pairs found on ebay are so small that both units would fit on a postage stamp. When you supply 5 v. to the transmit enable pin, it transmits a sine wave. When the receiver is nearby, it can detect the sine wave, and raises its output pin to high. Thus your key set could use nothing but a 555 timer, battery, and the transmitter to send out sine wave pulses. You can control range by power supply voltage to the transmitter, and/or antenna lengths; (only need a length of wire). The receiver signal can be read into an UNO pin and analyzed for the correct structure (pulses/second and pulse length), to be sure the correct signal is present.

I am using some of these for wireless links, using PWM. They are very docile, very simple, and very cheap.

Hope this is useful.

John Doner

@jremington: You're right, that's exactly the use-case I am looking for. What technical specs should I be looking for on the RFID reader? Thanks!

@jrdoner: Thanks a lot for your suggestion. I prefer to use a solution that doesn't need batteries in the keychain. I'm going to go with the RFID solution as suggested above therefore. Thanks anyway!