I bought these (magnetic?) switches from China that open and close the circuit when they touch each other or are close.

close door switch

My problem is that they work in the current setup in the picture in the opposite. Right now the lights would be on when the door is opened.

I guess I need to wire led to batter directly, but between then I need some kind of component that blocks the circuit when the switch is touching each other.

Am I missing something, is there any other way to build what I want to? I was trying all sort of keywords but I don't know what component I need.

  • \$\begingroup\$ I'm sorry I'm having so much trouble with your wording. Is it that the switches are "closed" when near each other, or "open" when near each other? And do you want the light to go ON when near each other? Or OFF when near each other? I can't tell what you actually have and what you actually want to have and how they are different from each other. I'm sorry. Also, what kind of light is to be controlled? \$\endgroup\$
    – jonk
    Commented Nov 13, 2017 at 6:51
  • \$\begingroup\$ I'm sorry for my English. I want to control 3 bright little LEDs with a 9V battery. I want the light to be ON when they DON'T touch each other. Right now the light is ON when they are close, meaning exactly the opposite what I'm planning to do. \$\endgroup\$
    – Badr Hari
    Commented Nov 13, 2017 at 11:38

1 Answer 1


Doesn’t the switch part have 3 terminals: common and “no” & “nc” ie normally open & normally closed.

So once the switch is fitted with the door closed the magnet holds the contacts open ie off and when the door is open the contacts are closed ie on.

  • \$\begingroup\$ It has only NC and COM. Meaning when the two plastic things in the picture touch each other, it is opened. But for my project, it does exactly the opposite thing. It would light up when I close the cabinet door. \$\endgroup\$
    – Badr Hari
    Commented Nov 13, 2017 at 11:36
  • \$\begingroup\$ Then it sounds like you have bought a contact type switch - you need a "push to open" type switch : when the plunger or lever is pushed it opens ie turns "off" the circuit. \$\endgroup\$
    – Solar Mike
    Commented Nov 13, 2017 at 12:42
  • \$\begingroup\$ I have realized that. But can't I make use of the same switch so if it is ON, it gives a signal to stop the circuit. I would power the LEDs from the same source. Basically is there some sort of component that I can use if it is "powered on", it will cut the electrcity from flowing to the LED. \$\endgroup\$
    – Badr Hari
    Commented Nov 13, 2017 at 13:44
  • 1
    \$\begingroup\$ yes, use a relay, but realise that the relay coil will draw power in the "off" position... \$\endgroup\$
    – Solar Mike
    Commented Nov 13, 2017 at 13:48
  • \$\begingroup\$ I think then the only good way would do it mechanically, meaning they make contact only when the door is opened. it's a bit difficult but it can be done. Or just buy new ones that are normally closed. \$\endgroup\$
    – Badr Hari
    Commented Nov 13, 2017 at 13:54

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.