- Resource Categories
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. Sensor Solutions 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 hook up the LED to the output of the sensor. An LED needs the current to travel in a specific direction between the correct wires to work and the current needs also to be limited to prevent damage to the sensor. There are 2 different types of magnetic sensor outputs: NPN - current sinking and PNP current sourcing. Some sensors have internal pull-up or pull-down resistors. Others have open collector outputs. There are also sensors with 'TTL' or 0 to 5V outputs. The sensor output type will determine where the LED wiring needs to be connected.
DETERMINING THE DIRECTION OF CURRENT FLOW
LEDs have an anode and a cathode, sometimes labeled with a + and -. Note that the current must flow from the (+) Anode to the (-) Cathode.
CALCULATING THE SIZE OF THE CURRENT LIMITING SERIES RESISTOR
The current must be limited by the use of a series resistor. Most LEDs are quite bright at 5 to 10mA. At these currents, the voltage drop across most LEDs is about 2V. The current through the resistor = Volts / Resistance.
LEDs can be purchased with a built in series resistor, in which cases the description will indicate voltage rating. For LEDs without a built in resistor, use the formulas to the right to determine the appropriate resistor size.
SCHEMATICS FOR WIRING LEDS TO SENSOR OUTPUTS
It is not recommended to use an LED with the -RT option, unless the LED is the only load.The -RT sensor needs to have the LED sink current to ground. Note that there is already a 499-ohm resistor in the circuit, and the V is 5 volts. The LED current is: I LED = (5-2) / (499 + R). So, for 5mA, use a 100-ohm resistor. In this case, Voh will be much lower than 5V, so it may not drive any other load. In this case, the LED will be ON when the output is OFF.