Door reed switch MC-38
Magnetic door and window contact. Closes when the magnet is near.
MeasuresDoor open or closed (magnet near or away)
RangeCloses with the magnet within about 15 to 25 mm
AccuracyOn/off
InterfaceDry contact: wire like a button with INPUT_PULLUP
SensorsReviewedMPN MC-38Used in 27 projects
In short
What is the Door reed switch MC-38 and what is it used for?
Magnetic door and window contact. Closes when the magnet is near. Makers use it for door-open notifier.
Most MC-38 switches are normally open: closed only when the magnet is present.
In the real world
Door and window alarms
How it works
A reed switch has two thin contacts in a glass tube that a magnet pulls together.
Key specifications
| Sensor spec | Value |
|---|---|
| Measures | Door open or closed (magnet near or away) |
| Range | Closes with the magnet within about 15 to 25 mm |
| Accuracy | On/off |
| Interface | Dry contact: wire like a button with INPUT_PULLUP |
| Supply voltage | None needed (passive switch) |
| Operating temperature | −10 to 50 °C typical |
Pinout
Wire 1To the GPIO pin (INPUT_PULLUP)
Wire 2To GND
How to use it
Screw the switch to the frame and the magnet to the door, gaps aligned. With INPUT_PULLUP the pin reads LOW when closed (door shut).
void setup() { Serial.begin(115200); pinMode(27, INPUT_PULLUP); }
void loop() { Serial.println(digitalRead(27) == LOW ? "closed" : "OPEN"); delay(300); }Applications
Door and window alarmsCupboard lightsLid detection
Builds that use it
Guided build
Door open notifier
Guided build
Medicine reminder pill box
Guided build
Wardrobe light that turns on with the door
Guided build
Balcony door child safety alarm
Guided build
Garage car door ajar alarm
Guided build
Alarm with latch memory
Guided build
Cold storage door and temperature alarm
Guided build
Rodent trap alert for godowns
Showing 8 of 27
Alternatives
- Hall Effect Sensor A3144Magnet sensor with no moving contacts
Common questions
What is the Door reed switch MC-38 used for?
In products: door and window alarms. In maker projects: door-open notifier.
How does the Door reed switch MC-38 work?
A reed switch has two thin contacts in a glass tube that a magnet pulls together.
What voltage does the Door reed switch MC-38 need?
None needed (passive switch).
How do I connect the Door reed switch MC-38 to an Arduino or ESP32?
Dry contact: wire like a button with INPUT_PULLUP. Pins: Wire 1 (To the GPIO pin (INPUT_PULLUP)), Wire 2 (To GND).
What can I use instead of the Door reed switch MC-38?
Hall Effect Sensor A3144.
