Skip to product information
1 of 1

Blue PCB Electronics

2D27 MC-38 Wired Door Window Sensor Magnetic Switch

2D27 MC-38 Wired Door Window Sensor Magnetic Switch

Regular price Dhs. 25.00
Regular price Sale price Dhs. 25.00
Sale Sold out
View full details

Description

The MC-38 is a white-wired small magnetic switch sensor for home alarm security systems and consists of a magnet and a reed switch. It works as a security alarm sensor to monitor and detect whether the door/window is opened or closed. The white-wired part of the sensor is a reed switch that comes with two output wires/cables such as the ground wire and the signal wire. As this is a non-polar sensor, the wires can be connected in any order. This magnetic switch sensor is used to trigger an alarm or turn a light ON or OFF on a wardrobe sliding door. It is triggered and generates the signal when the magnet is close to the switch (the circuit switch is conductive and the door/window is closed) or away from the switch (the circuit switch is non-conductive and the door/window is opened).

It can be connected to the Arduino or microcontroller unit to perform the required action in home security, residential and commercial security applications. It is available in normally open and normally closed switches.

Specifications and Features

The following are the technical specifications and features of the MC38 magnetic switch sensor for home alarm systems,

  • It is the most reliable and absorption-proof non-polar sensor.
  • Available in normally open and normally closed magnetic switches.
  • Mode of connection is Normally Closed (N.C).
  • The power rating is 3W.
  • The rated current is 100mA.
  • The operating distance range is 15-25mm.
  • The output of the sensor is N. C (Normally closed when the magnet and switch are together)
  • The rated voltage is 200 VDC.
  • The length of the cable is 30.5cm ± 12mm.
  • Dimensions: 28x15x0.9cm.
  • Controls the circuit’s switch with a magnet and works as a magnetic sensor alarm.
  • Installation is simple and easy.

Pin Configuration of MC-38:

The MC38 magnetic switch sensor is designed with a reed switch and a magnet. It is encased in a plastic shield as shown in the figure below.

The two cables/wires that come from the reed switch represent the signal wire and the ground wire. As this is a non-polar sensor, these wires are connected to the Arduino or MCU in any order. You can further read below to know how to connect MC-38 to a Arduino or any microcontroller.

 

MC-38 Pin Configuration

 


Working of MC-38:

The MC-38 is a simple magnetic switch sensor in a plastic case designed to install on a door or window frame very easily. It is operated as a contact switch sensor, door sensor, window sensor, security alarm, and entry sensor to detect and monitor the entry of intruders.

Basic Circuit of MC-38

 

It is very easy to install and hide and can be easily used in places such as homes, hotels, and offices. The working of the MC-38 is explained in the diagram shown above. The output signal is generated when the magnet moves away from the reed switch. Switch control of the entire circuit is controlled through the in-built magnet.

Consider the magnet is fixed to the moving part of the door/window and the reed switch is fixed to the frame of the door/window. As shown in the above fig (a), when the magnet is placed at a distance or far away from the reed switch, the switch circuit is disconnected and opened. This means the door/window is opened and the alarm is triggered (ON).

From the above fig (b), when the magnet is close to the reed switch and connected, the switch circuit is closed and conductive. This means that the door/window is closed and the alarm is OFF. The generated output in both cases is determined through the sensor module.

Interfacing MC-38 Magnetic Switch Sensor with Arduino UNO:

The MC-38 magnetic switch sensor for home alarm systems works as a door sensor, window sensor, and anti-theft alarm system/security alarm system. It can be interfaced with the microcontroller or Arduino UNO very easy to detect whether the door/window is opened or closed for security purposes. These are also called magnetic switches. T


Let’s know how to interface an MC-38 magnetic switch sensor with Arduino UNO to work as a door sensor. These sensors are available as in normally closed and normally opened switches. Here, MC-38 normally open magnet switch is considered. The interfacing diagram is shown in the figure below. The components required are;

Interfacing MC-38 with Arduino UNO

Interfacing MC-38 with Arduino UNO

  • MC-38 Magnet Switch for home alarm system
  • Arduino UNO
  • Power supply
  • Connecting wires.

As this MC38 is a non-polar magnetic switch sensor, the wires can be plugged in anyway. From the above diagram, the GND pin of the Arduino UNO is connected to the GND wire of MC-38. The digital pin 2 of the Arduino UNO is connected to the signal wire of the MC-38. Upload the following code to the Arduino to display the switch status.

Code:

const int DOOR_SENSOR_PIN = 13; // Arduino pin connected to door sensor’s pin

int doorState;

void setup() {
Serial.begin(9600); // initialize serial
pinMode(DOOR_SENSOR_PIN, INPUT_PULLUP); // set Arduino pin to input pull-up mode
}

void loop() {
doorState = digitalRead(DOOR_SENSOR_PIN); // read state

if (doorState == HIGH) {
Serial.println(“The door is open”);
} else {
Serial.println(“The door is closed”);
}
}

Working:

The output is triggered when the magnet is very close or moves away from the sensor. If the magnetic switch is closed, then the door or window is closed and the output is LOW. If the magnetic switch is opened, which means the door is opened and the output is HIGH. Run the code to observe the result on the serial monitor. Move the magnet closer or away from the reed switch to check the state of the door (open or close) on the serial monitor. The pull-up/pull-down resistor can be used to avoid floating values. Note that the reed switch will be in either an open or closed state.

Applications of MC-38:

A few applications/uses of MC38 magnet switch sensor are given below,

  • Used as window or door sensors.
  • To detect activities of intruders.
  • As home alarm systems
  • Anti-theft alarm systems
  • Triggered alarms.