Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Reed Switch: Examples, Pinouts, and Specs

Image of Reed SwitchDesign with Reed Switch in Cirkit Designer

Introduction

A reed switch is an electromechanical device that operates when exposed to a magnetic field. It consists of two ferromagnetic metal contacts (reeds) in a hermetically sealed glass envelope. The contacts are normally open and close when a magnetic field is applied. Reed switches are used in various applications such as proximity sensing, security systems, and switching circuits.

Explore Projects Built with Reed Switch

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Reed Switch-Activated Water Pump Circuit: A project utilizing Reed Switch in a practical application
Reed Switch-Activated Water Pump Circuit

This circuit is designed to control a water pump using a DC power source and a reed switch. The reed switch acts as a sensor that, when triggered, allows current to flow from the DC jack to the water pump, turning it on. There is no microcontroller or additional control logic, indicating that the pump operates directly in response to the state of the reed switch.

Open Project in Cirkit Designer
Image of Arduino UNO Reed Switch Sensor with LED Indicator: A project utilizing Reed Switch in a practical application
Arduino UNO Reed Switch Sensor with LED Indicator

This circuit uses an Arduino UNO to monitor the state of a reed switch. When the reed switch is activated by a magnetic field, the Arduino turns on an onboard LED and outputs a message to the serial monitor. The reed switch is connected to the Arduino with an internal pull-up resistor on digital pin D2, and the LED is controlled via pin D13.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Description
1 Reed contact 1 (NC)
2 Reed contact 2 (NO)

Note: NC (Normally Closed), NO (Normally Open)

Usage Instructions

How to Use the Reed Switch in a Circuit

  1. Positioning: Place the reed switch at the desired location where magnetic field presence will be detected.
  2. Magnet Placement: Position a magnet so that it will come close to the reed switch when the desired event occurs (e.g., a door opening).
  3. Circuit Integration: Connect the reed switch in series with the load and power source. Ensure that the current and voltage ratings are within the specifications of the reed switch.
  4. Testing: Test the switch operation by bringing the magnet close to ensure the contacts close.

Important Considerations and Best Practices

Example Circuit with Arduino UNO

// Example code for using a reed switch with an Arduino UNO

const int reedPin = 2; // Reed switch connected to digital pin 2
const int ledPin = 13; // Onboard LED connected to digital pin 13

void setup() {
  pinMode(reedPin, INPUT_PULLUP); // Initialize reed switch pin as input with internal pull-up
  pinMode(ledPin, OUTPUT); // Initialize LED pin as an output
}

void loop() {
  if (digitalRead(reedPin) == LOW) { // Check if reed switch is closed by magnet
    digitalWrite(ledPin, HIGH); // Turn on LED
  } else {
    digitalWrite(ledPin, LOW); // Turn off LED
  }
}

Note: The internal pull-up resistor is used to ensure a stable state when the switch is open.

Troubleshooting and FAQs

Common Issues

Solutions and Tips

FAQs

Q: Can I use a reed switch with AC voltage? A: Yes, but ensure the specifications are within the limits for AC voltage and current.

Q: How can I extend the life of my reed switch? A: Use contact protection circuits, avoid excessive force on the glass envelope, and select a switch with a higher rating than your application requires.

Q: Is there a polarity to a reed switch? A: No, reed switches do not have polarity and can be connected in any direction.