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 electromagnetic switch that opens and closes in response to a magnetic field. It consists of two ferromagnetic contacts sealed within a glass tube. When a magnetic field is applied, the contacts close, completing the circuit. Once the magnetic field is removed, the contacts return to their open state.

Reed switches are widely used in applications requiring non-contact switching. Common use cases include:

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

Technical Specifications

Below are the key technical details of a typical reed switch. Note that specifications may vary depending on the manufacturer and model.

Parameter Value
Contact Form SPST (Single Pole Single Throw)
Switching Voltage 3V to 250V DC/AC
Switching Current 10mA to 3A
Contact Resistance 50 mΩ to 200 mΩ
Insulation Resistance >10⁹ Ω
Operate Time 0.5 ms to 2 ms
Release Time 0.1 ms to 0.5 ms
Operating Temperature -40°C to +125°C
Glass Tube Dimensions Typically 10mm to 50mm in length

Pin Configuration and Descriptions

Reed switches are simple two-terminal devices. The terminals are the two ferromagnetic contacts sealed within the glass tube. Below is a description of the pins:

Pin Description
Pin 1 One end of the reed switch contact
Pin 2 The other end of the reed switch contact

Usage Instructions

How to Use the Reed Switch in a Circuit

  1. Basic Circuit Connection:

    • Connect one terminal of the reed switch to the positive side of the power supply.
    • Connect the other terminal to the load (e.g., an LED with a current-limiting resistor).
    • Complete the circuit by connecting the load to the negative side of the power supply.
    • When a magnetic field is applied near the reed switch, the circuit will close, and the load will activate.
  2. Interfacing with a Microcontroller (e.g., Arduino UNO):

    • Connect one terminal of the reed switch to a digital input pin on the Arduino.
    • Connect the other terminal to the ground (GND) pin.
    • Use a pull-up resistor (10kΩ) between the digital input pin and the 5V pin to ensure a stable signal.

Example Arduino Code

// Reed Switch Example with Arduino UNO
// This code reads the state of a reed switch and turns on an LED when the switch is closed.

const int reedSwitchPin = 2; // Pin connected to the reed switch
const int ledPin = 13;       // Pin connected to the onboard LED

void setup() {
  pinMode(reedSwitchPin, INPUT_PULLUP); // Set reed switch pin as input with pull-up
  pinMode(ledPin, OUTPUT);             // Set LED pin as output
  Serial.begin(9600);                  // Initialize serial communication
}

void loop() {
  int reedState = digitalRead(reedSwitchPin); // Read the reed switch state

  if (reedState == LOW) { // LOW means the reed switch is closed
    digitalWrite(ledPin, HIGH); // Turn on the LED
    Serial.println("Magnetic field detected!"); // Print message to serial monitor
  } else {
    digitalWrite(ledPin, LOW); // Turn off the LED
    Serial.println("No magnetic field."); // Print message to serial monitor
  }

  delay(100); // Small delay for stability
}

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues and Solutions

  1. Reed Switch Not Activating:

    • Cause: The magnet is too far from the reed switch.
    • Solution: Move the magnet closer or use a stronger magnet.
  2. Switch Stuck in Closed State:

    • Cause: The contacts may have welded together due to excessive current.
    • Solution: Replace the reed switch and ensure the current does not exceed the rated value.
  3. Intermittent Operation:

    • Cause: Electrical noise or poor connections.
    • Solution: Add a pull-up or pull-down resistor, and check all connections for stability.
  4. No Response in Arduino Circuit:

    • Cause: Incorrect wiring or missing pull-up resistor.
    • Solution: Verify the wiring and ensure a pull-up resistor is used.

FAQs

Q: Can a reed switch detect non-magnetic materials?
A: No, reed switches only respond to magnetic fields and cannot detect non-magnetic materials.

Q: Can I use a reed switch in high-vibration environments?
A: Reed switches are sensitive to vibration, which may cause false triggering. Consider using a solid-state alternative like a Hall effect sensor in such cases.

Q: How do I protect the reed switch from voltage spikes?
A: Use a flyback diode across inductive loads (e.g., relays) to suppress voltage spikes and protect the reed switch contacts.

Q: Can I use a reed switch for AC applications?
A: Yes, reed switches can handle both AC and DC currents, provided the voltage and current ratings are not exceeded.