In some applications relays use the output signal from a sensor to control a system. Note that there are thousands of relays available and multiple sensor output types, so it can be confusing how to hook up the relay to the output of the sensor.

Sensors should be configured as open collectors and not have any internal pull up/pull downs, as the relay will act as the pull up/pull down.

First, you need to determine if the sensor has an NPN (current sinking) or a PNP (current sourcing) output:

If the sensor sinks current (NPN): The relay should be connected between a + power supply (Vcc) and the output (Vout).
If the sensor sources current (PNP): The relay should be connected between the sensor output (Vout) and the ground.

Relay Output Configuration for NPN or PNP

Note the relay operating voltage and current must be chosen to work with the sensor.

Most of our NPN sensors can sink a max of 20mA. To avoid exceeding this, a relay must be selected that has a coil/input resistance that will produce less than 20mA and operate at the sensor Vcc voltage. For 12 volt operation and a sensor that sinks 20mA, the relay would need to have a coil/input resistance greater than 600 ohms. If the relay operating current exceeds the sensor operating voltage and current sink, please contact our engineering department to discuss further possibilities.

Most of our PNP sensors are short-circuit protected and can source a maximum of about 50mA. Using 12 Volts, this coil resistance needs to be greater than 240 ohms.

Since the coil is inductive, there are likely inductive spikes that will exceed the absolute maximum ratings of the sensor even if the coil resistance is great enough not to exceed the steady state maximum currents. The schematics below show recommended external protection devices that can be used to protect the sensors:

Protected Relay Output Configuration for NPN or PNP

Protection for the sensor from relay transients can be added using the above schematic. The diodes will protect the sink transistor of the sensor from transients caused by switching of the relay. RS will limit the current that the transistor has to sink, which is generally 20mA. RS values must be selected that will limit the current into the sinking/sourcing transistor, but still satisfy the pickup voltage of the relay. The power handling of RS should also be considered so that it does not overheat.

Talk to one of our Engineers.  Sensor Solutions' Engineers have years of experience in designing custom magnetic sensors for new applications as well as OEM replacements. Contact out Engineering Department today to discuss your specific needs and to learn more about how to hook up a digital magnetic sensor to a relay.



Click Here to return to the Application Notes Index