# Hall Effect Sensor to a +24VDC PLC Input

I have a square wave from a hall effect sensor giving between UL 7.7v-8.7v to UH 11.3v to 12.7v from a 13V Supply. I need to pass this into a logic input on a controller which is nominally 24vdc but operates at <5V Logic0 and > 15V Logic 1. My square wave has a frequency of 100Hz. I am not an electronic engineer and people tell me I need to use a zener diode or maybe a Schmitt trigger but I am at a loss. Can anyone help please Many thanks Lee

• Add links to datasheets for the sensor and PLC, please. Welcome to EE.SE. Sep 30 '16 at 14:07
• The output from the Hall sensor is rather unusual unless you are monitoring an analog signal so details would help. For the PLC input we need to know if it is current sourcing or current sinking input type. Sep 30 '16 at 20:11
• Thank you for your reply. I have added a circuit I was given and a photo of what I can see on my scope. The input to the PLC would a source as I am switching 'high' into it. Whilst I could take the signal into an analog input on the PLC, the update rate on the analog channel would not be quick enough to capture the waveform. Oct 3 '16 at 8:27
• Which one? A1212 or A1217? How did you wire it up? (There's a schematic button on the editor toolbar.) The two-wire test circuit may be confusing you. Can you use three wires in your application? (V+, GND and signal.) Oct 3 '16 at 8:48
• it is the A1217 variant. I have 2 wires that come from the device. Oct 3 '16 at 9:24

The A1217 doesn't seem to have a datasheet available anywhere. From your comments it seems to be an automotive cog tooth sensor.

The application note you posted shows the sensor fed from a current limiting resistor Rp = 182 Ω. The Up = 13 V is a 12 V battery average voltage.

• With a 2-wire sensor it needs some current to power it even when "off". That means the only way to signal "on" is to pass more current. We can see this from the test circuit information:

• When the sensor turns off little current will flow so the voltage at (4) will increase (because there will be less voltage dropped across Rp). Taking the average value of UH as 12 V means that 1 V is dropped across Rp and we can work out the current as $I_H = \frac {V_H}{R} = \frac {1}{168} = 6~\mathrm mA$.

• When the sensor turns on the voltage at (4) will drop. Taking the average value of UL as 8.2 V we get 4.8 V dropped across Rp and we can work out the current as $I_L = \frac {V_H}{R} = \frac {4.8}{168} = 29~\mathrm mA$.

Meanwhile, if your PLC input is like this one then you will need < 1 mA (5 V) to guarantee a '0' and > 2.5 mA (15 V) to guarantee a '1'. Given those specs it appears that the PLC has about 5k - 6k input resistance.

simulate this circuit – Schematic created using CircuitLab

Figure 1. Connecting the sensor as a high-side switch directly to the PLC with a shunt resistor just might work.

The idea in Figure 1 is that when the sensor is off it will pass 6 mA. With the PLC input in parallel with 820 Ω you'll get about 700 Ω total load and the voltage at the input will be $V_{IN} = IR = 6m \times 700 = 4.2~\mathrm V$. When the sensor turns on it will pass a higher current.

Assuming 29 mA flows then $V_{IN} = IR = 29m \times 700 = 20.3~\mathrm V$. Now this is unlikely as the sensor voltage would be reduced below the 8.2 V we saw in our earlier calculations. It might, however, pass enough current to reliably exceed the 15 V turn-on point.

Please try it out and report back on the voltages obtained.

• Hello, apologies for the delay in getting back to you, other work got in the way. Just to say I tried the circuit you suggested and it worked perfectly. I used a 680Ohm resistor and got voltage readings of 16V Logic 1 and 2.5V Logic 0. I could then clearly see the same frequency in my PLC register as I was getting on my scope. Many thanks for your help with this matter. Thank you Oct 4 '16 at 13:39
• Also, it might be worth measuring the current through the sensor. Some of the other sensors, A1212, for example, are rated for 25 mA. Oct 4 '16 at 17:30

Simply use a comparator like LM393. Power if from 24V, set Vref to 10V, add some hysteresis and you are done.

• Hello, thank you for your reply. I just 'googled' LM393 circuits and I understand the approach and your suggestion makes sense to me. Would you be able to sketch a sample circuit for me? and would it be able to operate as the waveform does 1t 100Hz. Thank you Oct 3 '16 at 8:29
• I wonder why people down voted this answer... Oct 3 '16 at 13:45
• @BrendanSimpson: For one, it doesn't address the PLC input which turns out to be current sinking. The LM393 is too (as it has an open-collector output) so a pull-up resistor is required to get this arrangement to work. Oct 3 '16 at 17:42
• @Transistor So why not just tell this person that instead of down voting an answer that, in my opinion, "just needed some work". I agree it's not a shining example of a solid answer, but it's not terrible by any means. Down votes are meant for answers that are misleading, wrong, or dangerous. Obviously this is a new user, they probably could have managed with some guidance in the comments. Oct 3 '16 at 17:53
• @BrendanSimpson: I didn't downvote! Oct 3 '16 at 17:55