Welcome to Standex Detect

Standex Detect is the new name for our precision reed switches, sensors, and relays business.

English
Home Resources Hall Effect Academy How to Hook Up an LED to a Magnetic Sensor

How to Hook Up an LED to a Magnetic Sensor

Using LEDs with Magnetic Sensors

LEDs can provide a visual indication of the output state from a digital switching magnetic field sensor. LEDs provide a significant amount of light using a small amount of current, so they are nicely suited for use with magnetic sensors. Most LEDs are highly visible with 10mA. Our Hall Effect sensors are typically rated to sink or source at least 20mA, so this will not exceed their capability.

It can be confusing how to connect an LED to a sensor output. LEDs require current to flow in a specific direction, and the amount of current must be limited to prevent damage to both the LED and sensor. The correct wiring method depends on the sensor output type, such as NPN (current sinking), PNP (current sourcing), open collector, or TTL (0 to 5V) outputs.

Understanding LED Polarity and Current Flow

Determining the Direction of Current Flow

LEDs have an anode and a cathode, sometimes labeled with a + and symbol. For the LED to illuminate, current must flow from the positive anode (+) to the negative cathode (−).

Diagram showing a diode with labeled anode and cathode, direction of current flow, and an LED symbol with anode (long lead) and cathode (short lead, flat side or spot) labeled. Also illustrates why either pole Hall switches may produce 3 pulses from a single magnet when interpreting magnetic field changes. by Standex Detect

Selecting a Current-Limiting Resistor

Why LEDs Require a Series Resistor

The current flowing through an LED must be limited using a series resistor. Without proper current limiting, excessive current can damage the LED and potentially the sensor output.

Most LEDs are quite bright at currents between 5 mA and 10 mA. At these current levels, the voltage drop across a typical LED is approximately 2 volts.

Calculating the Correct Resistor Value

The current through the resistor can be calculated using Ohm’s Law:

Current = Voltage ÷ Resistance

For LEDs without a built-in resistor, use the appropriate supply voltage and desired LED current to determine the correct resistor value. Use the formulas to the right to determine the appropriate resistor size.

Circuit with resistor and LED, plus formulas: For 5mA LED, R = (V-2)/0.005; for 10mA LED, R = (V-2)/0.010. Example calculations: R = 2kΩ for V=12V at 5mA and R = 2.2kΩ for V=12V at. by Standex Detect

Using LEDs with Built-In Resistors

Some LEDs are available with integrated series resistors. These products are typically specified by their operating voltage range, eliminating the need for external resistor calculations.


Application Notes

Sensor Selection Application Notes

What are Hall Effect Sensors?

Custom Speed Sensors & Direction Dependent Speed Switches

Custom Magnetic Sensor Design and Manufacturing

Guide to Replacing a Speed Sensor

Selecting the Appropriate Hall Effect Sensor and Target Magnet

Why do I need to provide the gear pitch when ordering a Speed and Direction Gear Tooth Sensor?

Target Selection Application Notes

Selection or Design of Sensor Targets

Selecting the Appropriate Hall Effect Sensor and Target Magnet

Sensor Behavior Application Notes

Chopper Stabilization and Gear Tooth Sensors

The Effect of Mounting A Ferrous Metal Sensor in a Steel Sleeve

Understanding Duty Cycle and Phase Angle in Quadrature Sensors

Why Either Pole Hall Switches May Produce 3 Pulses from a Single Magnet

Sensor Output Monitoring Application Notes

How to Hook Up an LED to a Magnetic Sensor

Understanding Duty Cycle and Phase Angle in Quadrature Sensors

Meters and Signal Conditioners

How To Hook Up a Digital Magnetic Sensor to a Relay

Custom Hall Sensor Application Notes

PCBA Manufacturing & Design – Printed Circuit Board Prototyping Services

Thief Hatch Latch Detection Systems

Special Considerations for -RT Output Sensors

It is not recommended to use an LED with the -RT option unless the LED is the only load connected to the output.

The -RT sensor requires the LED to sink current to ground. Note that a 499-ohm resistor is already present in the circuit, and the supply voltage is 5 volts. LED current can be calculated as:

I LED = (5-2) / (499 + R)

For approximately 5mA of LED current, usa a 100-ohm resistor.

Three circuit diagrams compare NPN open collector, PNP open collector, and regulated TTL sensor outputs, each showing wiring connections for voltage, load, and ground—helping illustrate why either pole Hall switches may produce 3 pulses from a single magnet. by Standex Detect

Click here to return the Hall Effect Application Notes page

Contact Standex Detect