Reed Switch Interfacing with Arduino

Reed switch is used in many of the real-life applications such as magnetic door switch, laptops, smartphones etc. In this article, we learn about Reed Switch and guide you to Interface a Reed Switch with Arduino.

Reed Switch Interfacing with Arduino

Reed Switch

Reed switch is basically an electrical switch which is operated when a magnetic field is brought near to it. It was invented by W. B. Ellwood in 1936 at bell laboratories. It is made up of two small metal pieces kept inside a glass tube under vacuum. In a typical reed switch two metal pieces will be made of a ferromagnetic material and covered with rhodium or ruthenium to give them long life. The switch will be activated when there is a presence of magnetic field around the switch.

The glass enclosure of the two metal pieces protect them from dirt, dust and other particles. Reed switch can be operated in any environment such as environment where flammable gas is present or environment where corrosion would affect open switch contacts.

There are two types of reed switch.

  1. Normally open reed switch
  2. Normally closed reed switch

In normally open reed switch, switch is open in the absence of magnetic field and it is closed in the presence of magnetic field. Under the presence of magnetic field, two metal contacts inside the glass tube attract each other to make contact.

In normally closed reed switch, switch is closed in the absence of magnetic field and it is open in the presence of magnetic field.

Applications of Reed switch

  • Used in telephone exchange
  • In laptops to put the screen on sleep if the lid is closed
  • Used in window and door sensors in burglar alarm system
READ  Simple negative resistance oscillators

Components Required

  • Arduino Uno
  • Reed switch
  • Resistors
  • LED
  • Magnet
  • Connecting wires

Arduino Reed Switch Circuit Diagram

Reed Switch Interfacing with Arduino schematics

Working of Reed Switch with Arduino

Arduino Uno is a open source microcontroller board based on ATmega328p microcontroller. It has 14 digital pins (out of which 6 pins can be used as PWM outputs), 6 analog inputs, on board voltage regulators etc. Arduino Uno has 32KB of flash memory, 2KB of SRAM and 1KB of EEPROM. It operates at the clock frequency of 16MHz. Arduino Uno supports Serial, I2C, SPI communication for communicating with other devices. The table below shows the technical specification of Arduino Uno.

Microcontroller ATmega328p
Operating voltage 5V
Input Voltage 7-12V (recommended)
Digital I/O pins 14
Analog pins 6
Flash memory 32KB
Clock speed 16MHz


To interface reed switch with Arduino we need to build a voltage divider circuit as shown in the figure below. Vo is +5V when the switch is open and 0V when the switch is closed. We are using a normally open reed switch in this project. Switch is closed in the presence of magnetic field and it is open in the absence of magnetic field.

Read more: Reed Switch Interfacing with Arduino

This Post / Project can also be found using search terms:

  • ARDUINO reed switch
  • reed sensor projects
  • arduino sketch reed switch
  • SWITCH interfacing with arduino

Leave a Comment

= 4 + 8

(Spamcheck Enabled)

Read previous post:
Tiny Precision Digital Humidity sensor
Tiny Precision Digital Humidity sensor

The new digital SHT3x humidity sensor series takes sensor technology to a new level. As the successor of the SHT2x series...

Scroll to top