I have reconsidered this question. I think the motion detecting low voltage light fixture is a safer alternative than the 120V approach I was considering (danger from the dangling cord).

This is an existing closet. I want to add a light that will switch ON when the door is opened and turn OFF when the door is closed. There's a 120V electric outlet available, but maybe there's a battery-powered LED option out there (I couldn't find it.)

Years ago there was a low-tech spring-loaded button on a bracket with an AC power cord and a socket for a light bulb. That's what I've searched for (on Bing and Amazon and Home Depot using "door light switch" as search terms).


2 Answers 2


Since you already have electric outlet, lets use it. No batteries needed.

I got this in my closet, from Amazon for $18


Just plug it in in your outlet, Then you plug any light that suits you in it.

MOTION SENSING LIGHT CONTROL - automatically turns on when you enter a room; never fumble for a light switch in the dark again WIDE RANGE - detects motion in a 100-degree radius and within 25 feet with a selectable 1, 2, 5, 10, or 20 minute auto-off

If you want on/off switch activated by the door, then you better use no more than 24 Volt for safety. I am not worried about the switch, but about wiring it for 120 Volt.

  • 3
    If you want on/off switch activated by the door, then you better use no more then 24 Volt for safety Why? A proper UL/ETL listed switch, installed correctly, is perfectly safe. Jun 20, 2023 at 2:11
  • 1
    I would argue that 24 V is safer at least. Even with a perfect install you are still going to have mains wires that can be yanked and so on. I for sure would be very uncomfortable in wiring such a thing - but perhaps I just do not know from the top of my head of any safe setup. Jun 20, 2023 at 14:42
  • If the switch is installed into a cutout in the door frame and the wires are properly secured and protected as they exit the switch and go to the panel and/or the light fixture, there really is no problem. An awful lot of the electrical code is about how to properly secure and protect wires - because if they are sitting out where they can be yanked and so on then there will be problems. Jun 20, 2023 at 17:32
  • 1
    I agree that your described setup is perfectly safe, if well executed, but realistically who is going to make a cutout in their door frame - and possibly in the side panel? While most of the people answering here are very good tinkerers and/or professionals, the vast majority of the people reading are absolutely not. Jun 21, 2023 at 7:46
  • 1
    @VladimirCravero I think you were talking to manassehkatz-Moving 2 Codidact use the @ symbol than type his name so he will get ti
    – Traveler
    Jun 21, 2023 at 7:53

If you don't need tons of light (like 75 watts or more), then a great option is USB recharchable LED lights that have an motion sensing feature. The best ones have a simple switch that allows for the light to come on even if there is some ambiant light (in other words, it will still come on even when the door is open). They do have to be removed to recharge, but the charge lasts pretty long unless you are using the closet for a long time multiple times per day. I have them in lower kitchen cabinets and unwired closets. If you go with this option, don't use the double sided tape to mount. Instead, screw a metal plate to wherever you want it, (an old metal switch plate works great) and the LED will stick to it magnetically. They are relatively cheap so if you need more light you can add a second one.

Here's an example ($12)


enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.