MC-38 Wired Door Window Sensor: Working, Pinout, Specifications and Applications

What Is an MC-38 Wired Door Window Sensor?

The MC-38 Wired Door Window Sensor is a magnetic contact switch used to detect whether a door, window, or similar opening is open or closed. It is commonly used in home security systems, intrusion detection systems, and automatic control applications. The sensor consists of two main parts: a magnetic reed switch and a permanent magnet. One part is installed on the door or window frame, while the other is attached to the moving door or window.

When the two parts are close to each other, the magnet activates the reed switch, changing the electrical contact state. When the door or window opens and the magnet moves away, the switch returns to its normal state. The MC-38 can be connected to a compatible microcontroller, such as an Arduino, to detect door or window movement and trigger an alarm, switch a light, or perform another programmed action.

ADVERTISEMENT

How Does the MC-38 Magnetic Switch Work?

The MC-38 uses a magnetic reed switch, which contains two thin ferromagnetic metal contacts sealed inside a small glass capsule. Its working principle is based on the magnetic field produced by the permanent magnet.

1. When the Door or Window Is Closed

When the magnet is close to the reed switch, the magnetic field causes the internal contacts to connect in a normally open reed-switch arrangement. This completes the electrical circuit. A connected controller can detect this state and interpret it as a closed door or window.

2. When the Door or Window Is Open

When the door or window moves away from the frame, the magnet moves away from the reed switch. The contacts return to their normal open state, interrupting the circuit. The connected controller can detect this change and activate an alarm, send a notification, or switch an electrical device. The exact electrical state depends on the contact configuration and how the sensor is wired. The MC-38 is generally a passive magnetic contact rather than an electronic sensor that generates its own voltage.

Pinout of the MC-38 Sensor

The MC-38 is a simple two-wire magnetic contact switch. Unlike powered electronic sensors, it typically does not require a separate power supply for the reed switch itself.

Connection Function
Wire 1 One side of the magnetic switch contact
Wire 2 Other side of the magnetic switch contact

The two wires are generally interchangeable because the reed switch is a passive contact. Neither wire should automatically be assumed to be ground or signal; their roles depend on the external circuit.

Connecting the MC-38 to an Arduino

The MC-38 can be connected to an Arduino digital input using a pull-up or pull-down arrangement. A common method uses the Arduino’s internal pull-up resistor.

Example Connection Using the Internal Pull-Up

In this configuration, the input normally reads HIGH when the switch is open and LOW when the switch closes the circuit. The program can detect a change in the input state to identify door or window movement.

const int doorSensor = 2;

void setup() {
  pinMode(doorSensor, INPUT_PULLUP);
  Serial.begin(9600);
}

void loop() {
  int state = digitalRead(doorSensor);

  if (state == LOW) {
    Serial.println("Magnetic contact closed");
  } else {
    Serial.println("Magnetic contact open");
  }

  delay(200);
}

**Note:** This example reports the electrical contact state, not necessarily the physical door state. Verify the magnet and switch alignment and test the installed sensor to determine which reading corresponds to an open or closed door.

Specifications of the MC-38 Wired Door Window Sensor

The following specifications are based on the supplied product description. Actual ratings may vary between manufacturers and product versions.

Parameter Specification
Model MC-38
Product type Wired magnetic door/window contact switch
Material Plastic housing
Colour White
Maximum switching current 0.5 A
Voltage rating 100 V, as stated in the supplied description; verify whether this is AC or DC and confirm the manufacturer’s rating
Rated power 10 W, as stated in the supplied description
Operating distance Approximately 15–25 mm, depending on alignment and the product version
Connecting cable length Approximately 30 cm
Length 28 mm
Width 14 mm
Height 8 mm
Weight Approximately 8 g

**Electrical safety:** The voltage and current ratings must be checked against the exact product datasheet. Do not connect the contact directly to mains voltage or a high-current load unless the switch is explicitly rated for that application. For Arduino projects, use it as a low-voltage input switch.

Features of the MC-38 Magnetic Door Sensor

The main features of the MC-38 include:

Applications of the MC-38 Sensor

1. Home Security Systems

The MC-38 can be installed on doors and windows to detect when an opening changes state. When connected to an alarm controller, it can trigger a warning if the system is armed.

2. Intrusion Detection

The sensor can serve as one input in a basic intrusion detection system. A controller monitors the contact and responds when it detects an unexpected change.

3. Automatic Lighting

The switch can be used in a low-voltage control circuit to turn a light on or off when a door or cupboard opens or closes. The required control logic depends on the desired behavior.

4. Office and Commercial Security

It can be installed on suitable doors, windows, cabinets, and storage areas in offices, shops, and other commercial premises.

5. Arduino and IoT Projects

When connected to a microcontroller or a compatible IoT device, the MC-38 can provide door-status information for logging, notifications, or home automation routines.

Advantages of the MC-38 Sensor

Limitations of the MC-38 Sensor

Conclusion

The MC-38 Wired Door Window Sensor is a simple magnetic contact switch used to detect whether a door, window, or similar opening has changed position. It operates using a magnet and an internal reed switch, making it suitable for basic security systems, intrusion detection, automatic lighting, and microcontroller-based home automation. Its two-wire design makes it easy to interface with an Arduino or other compatible controller. For reliable operation, install the magnet and switch with the correct alignment, test the open and closed states, and follow the manufacturer’s electrical ratings.