This has me stumped. There are lots of light switches actuated by closet doors. But I have a closet with a double bifold door (two bifolds that close towards the middle).

I can't think of, or find, any switch that can be readily mounted to this. The rail on which the doors travel make it impossible to use top switches. Switches meant for the jamb side of the door won't work because they expect the door to hinge away from the jamb, which it doesn't. Switches made for the leading edge of the door won't work because both leading edges move several feet and there is nothing else in the middle.

Some unwieldy ideas I have, but all of them have implementation issues:

  • Use a motion switch. That doesn't work for my situation because the door is left open much of the time, and I want the light on whenever it's open without any timeout.
  • Put a switch on the leading edge of one door, that butts against the other door when closed. But the wire to the switch would have to travel on a horseshoe-shaped track, like the cables to an elevator or a print head. That seems crazy but maybe it could work? Maybe I could even pillage a broken (but very wide) printer for the carriage?
  • Use a magnetic switch. This would be easy to install! But I can't find a magnetic switch that is pre-packaged and UL approved for 120V use, and they all have exposed terminals leaving the job to me of building a safe electrical enclosure or using a relay.

Of all the above, the most approachable approach for me is the magnetic switch with a relay. The relay would go in a project box or perhaps inside a PVC junction box that I'd mount next to the receptacle where I pick up power. But this seems a bit Rube Goldberg for the purpose


3 Answers 3


I think you have already worked out the solution in your own mind. Good for you! 😆

If you're looking for an opinion on your conclusion, I would say that low voltage magnetic reed switch is your best option. This of course would require the use of a relay, but being a person who uses relays on a mundane daily basis, I would not consider such a solution to be Rube Goldberg. Well, maybe I'm a little bit Dr. Suessian, but I certainly wouldn't consider this a complex design, at least not overly-so.

Functional Devices makes a crazy contraption called a RIB CLC106 closet lighting control. It has the relay and low voltage power supply built in, eliminating the need for a project box and potentially pesky UL listing concerns. It also comes with the magnetic reed switch as a bonus. And the best part: it's dirt cheap!


You could certainly use a low voltage LED light fixture or even LED tape. They produce magnetic reed switches in a variety of voltage and current limitations. Please refer to this PDF for an idea of just how many options you have. You would need to select a switch capable of carrying the current of the load you are expecting to switch. Arcing, due to interrupting the capacitive load of the LED array could shorten the lifespan of the very tiny contacts in the switch. You could implement a small capacitor filter or fuse to protect it, but now we're back into Rube's territory.

  • 1
    It appears your answer covers number three in the question. Nice find.
    – fred_dot_u
    Commented Sep 25, 2021 at 21:02
  • 1
    That's great. Perfect solution. Not Seussian at all.
    – jay613
    Commented Sep 25, 2021 at 21:47
  • Just a comment for anyone who uses this answer in future: Magnetic reed switches come as Normally Open, or Normally Closed, leaving the question of whether "normally" means magnet present or magnet absent. Which one do you buy? The solution is to buy a switch with three terminals providing Closed circuits in either position, that way you can't buy the wrong one.
    – jay613
    Commented Sep 27, 2021 at 16:35
  • After some research, thanks to the linked reed switch data sheet above, it turns out the "do it on the DC side" idea is not so hot. Most reed switches are rated for 0.5A and most LED strip lights consume a lot more than that. Switches capable of, say, 10W at 12V are insanely expensive for a project like this.
    – jay613
    Commented Sep 27, 2021 at 17:19
  • 1
    @DrSparks yes, LED tape. The PSU isn't the issue. The issue is the the supposed "easier" solution of putting the magnetic reed switch on the 12V side is not easier, because 99% of those switches are rated 0.5A or less, not enough for an LED strip light. Higher rated mag switches are very expensive. So I'm going to use the relay suggested in the Answer, which also has the advantage of being designed to achieve separation in a normal junction box. And that in turn will power a 12V PSU, probably a wall wart that comes with the lighting.
    – jay613
    Commented Sep 28, 2021 at 13:48

I've seen something like this, though it was at 12V. There are two magnetic sensors, the kind that need a magnet near them to activate.

The magnets are at the "knee" of both the bifold doors, right at the top, and the sensors are mounted in the lintel or woodwork right above the magnet's at-rest position.

Trick is that the wiring was done in parallel so either door being even a little open is enough to trigger the light. If both sensors are activated by opening both doors, then the light is still on.

Presumably this is for a pantry or some similar kind of space, that is not legally a "room" If this is a room then you'll still need a light switch to be mounted near the doors in a way that conforms with your local building code/requirements.

But even if it was, you could simply parallel the two magnetic sensors with a third switch in a wall plate, where any one of the three switches could power an Ultra Low Voltage relay that turns on 120V to your main lighting.

  • 1
    Yes, it is a laundry and broom closet off the kitchen. Too small to step inside but deep enough that it's dark at the back. I like the idea that an automatic light will make it easier to see things in the back and on the floor, and the lit light will encourage people to close the door when the closet is not in use.
    – jay613
    Commented Sep 26, 2021 at 17:56

Here is my implementation of the Accepted Answer.

At the top of the closet, a two-gang box with a raised ring is just right for the relay, a switched outlet, and two cables. The relay fastens cleverly to a knockout with the sensor leads entirely on the outside. I've ordered a half-blank cover plate to finish this. I had to think carefully about which knockouts to use so that everything would fit. I put the outlet on a pair of long pigtails so I can easily remove and reorient the ring depending on which way the PSU (which I have not yet bought) dangles from the outlet.

Door sensor relay in junction box with switched outlet

On the door, the included magnet is mounted on the door in a way that 1) brings it closer to the switch and 2) Allows the door to open fully (two doors actually parallel). The switch was easy to mount concealed by the rail. And the pair is mounted so not to interfere with opening or removal of the door. I'm waiting for a second reed switch to wire in series on the other door and I guess I'll replace that wooden mounting block with something more subtle and painted if "anyone" complains about it.

Door sensor on bifold door

  • Don't the high (120v) and low (5v/12v) components need to be separated in the box to ensure no mains voltage can hit the LV stuff in case of a short or other accident?
    – FreeMan
    Commented Sep 30, 2021 at 16:55
  • 2
    They are separated. The relay provides separation internally, the relay body sticks out through the knockout and the sensor wires exit there. It's a thoughtful clever design.
    – jay613
    Commented Sep 30, 2021 at 17:21
  • Ah, separated by dint of being inside a plastic box protecting all the LV stuff from wayward HV stuff. Got it.
    – FreeMan
    Commented Sep 30, 2021 at 17:23
  • 2
    That grey plastic baffle at the bottom, is both the locking mechanism for the relay in the knockout, and also if the box were installed inside a wall or ceiling, it is designed to cover the hole in the plaster that you cut to pass the sensor wires through. Really thorough.
    – jay613
    Commented Sep 30, 2021 at 17:25
  • Sweet man. Nice rig!
    – DrSparks
    Commented Sep 30, 2021 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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