Reed Switches

A reed switch is an electromagnetic switch operated by an applied magnetic field.

Sensors6 blocksMicroPythonC++
Reed Switch

At a glance

Pins and properties exactly as the circuit editor and simulator define this part. The text below explains how to use them.

Pinout

Pinout of the Reed Switch, drawn as in the circuit editor. Select a label to see that pin in the table below.

Pins

Pins of this part
PinLabelType
AASignal in
BBSignal in

Properties

What you can change in the Property Inspector.

Properties of this part
PropertyRange or choicesDefault
Magnet Distance0 to 40 mm40 mm

A reed switch is an electromagnetic switch operated by an applied magnetic field. It consists of a pair of flexible, magnetizable metal contacts (reeds) hermetically sealed inside a protective glass envelope. In Open Maker Studio, reed switches are commonly used to detect doors opening/closing, wind speed anemometers, and proximity sensing.


1. Schematic Symbol

A normally-open switch sealed inside a glass envelope, actuated by an external magnet (not part of the schematic symbol itself — shown here for context, since OMS's own component draws the magnet right on the canvas rather than as a separate part):

N S A B

2. Normally Open (NO) vs. Normally Closed (NC) Mechanics

  • Normally Open (NO — the only type OMS models):
    • The contacts remain physically separated in the absence of a magnetic field.
    • When a magnet is brought close, the reeds magnetize with opposing poles and pull together, closing the circuit.
  • Normally Closed (NC): real reed switches exist in this variant too, but OMS's component is NO-only — there's no prop or variant to model NC behavior, so don't wire a circuit expecting NC-style logic to work in the simulator.

3. Wiring & Pin Configuration

A reed switch has two non-polarized terminals:

  • Pin A and Pin B: Wire one pin to a microcontroller digital input GPIO, and the other to VCC (3.3V or 5V).
  • Logic Pull-Down Requirement: OMS's reed switch blocks are wired for pull-down logic, not pull-up — the GPIO idles LOW via an internal pull-down resistor, and reads HIGH once the reed contacts close and bridge the pin to VCC. On ESP32/ESP8266/Pico this is INPUT_PULLDOWN (real hardware support); Arduino Uno/Nano has no hardware pull-down at all, so OMS falls back to plain INPUT and expects a physical pull-down resistor to GND on that board instead (see the board note in Section 5).

4. Component Properties (Property Inspector)

When you select a Reed Switch on the canvas, you can modify the following parameter in the Property Inspector panel:

  • Magnet Distance (magnetDistance): A range slider that simulates dragging the activation magnet closer or further from the glass tube.
    • Default: 40 mm (contacts open — the farthest setting)
    • Range: 0 mm (magnet touching the glass) to 40 mm (step size 1 mm)
    • Contacts snap shut once the magnet comes within 15mm — a single hard distance cutoff, not a gradual sensor reading. There's no separate "Detection Radius" prop; 15mm is a fixed internal constant (TRIGGER_DIST_MM), not user-adjustable. This is a known, deliberate simplification — real reed switches have a pull-in/drop-out hysteresis gap (they close and open at slightly different distances); OMS models one single threshold for both directions.

5. Supported Blockly Blocks

Drawing the blocks…

6. Simulator Behavior

  • The magnet is built into the component itself — there is no separate "Virtual Magnet" part. Drag the red/blue bar magnet drawn directly on the Reed Switch's own canvas graphic closer to or farther from the glass envelope — this is the same magnetDistance prop from Section 4, just manipulated by dragging instead of the Property Inspector slider. There's nothing to add from the Parts Library; the interaction lives entirely on this one component.
  • Snap Behavior: Once the magnet's distance drops to 15mm or less, the contacts visually snap shut (with a small spark highlight) and the SPICE model switches to a near-zero-resistance connection between A and B; dragging back out beyond 15mm reopens them. As noted in Section 4, this is a single hard threshold in both directions — no pull-in/drop-out hysteresis gap like a real reed switch has.
Reed Switches — OMS Parts