Microbit | Sensor Series 17 – Reed Switch Sensor

01

Introduction

A reed switch, also known as a reed relay, is a type of sensor that controls the opening and closing of a switch through the application of a magnetic field.

It was invented at Bell Labs in 1936, consisting of two ferromagnetic metal strips placed within a glass tube filled with inert gas. When a magnet approaches, the reed switch closes, and when the magnet is removed, the reed switch opens.

Microbit | Sensor Series 17 - Reed Switch SensorMicrobit | Sensor Series 17 - Reed Switch Sensor

02

Principle

The switching mechanism of the reed switch consists of two ferromagnetic blades separated by only a few micrometers. When a magnet approaches these blades, they are drawn together. Upon contact, the blades close the normally open (NO) contacts, allowing current to flow. Some reed switches also include non-ferromagnetic contacts, which form a normally closed (NC) output. When the magnet approaches, the contacts open and pull away from the switch contacts.

The contacts are made from various metals, including tungsten and rhodium. Some types even use mercury, which requires maintaining the correct orientation to achieve the switching function. The reed switch is filled with inert gas (usually nitrogen) and sealed with a glass envelope to protect the contacts. This sealing prevents corrosion and any sparks that may arise from the movement of the contacts.

Reed switches have an extremely high reliability compared to mechanical switches and can operate billions of cycles without failure. Additionally, due to their sealed structure, they can operate in flammable and explosive environments where any spark could have catastrophic consequences. Although reed switches are an older technology, they are far from obsolete.

03

Wiring

  • G: Power negative, connect to GND
  • +: Power positive, connect to 3.3V
  • DO: Digital output, connect to P0
  • AO: Analog output, connect to P1

Below is the data read from pin P0 via serial simulation. When a magnet (either N or S pole) approaches the glass tube, the output value is 1023.

Microbit | Sensor Series 17 - Reed Switch Sensor

04

Program

Microbit | Sensor Series 17 - Reed Switch Sensor Program Explanation: Continuously detects the value of pin P0. When a magnet approaches the glass tube, if the value equals 1023, it indicates that the switch is closed, displaying a check mark.

Microbit | Sensor Series 17 - Reed Switch Sensor

05

Demonstration

Leave a Comment