noisy signal from Hall Effect proximty sensor

Hi,

I am reading a Hall Effect Proximity Sensor (NPN, NO) and I am getting some noise (possibly from an AC generator and other sensors) which I want to eliminate.

Noisy signals are few (like one each hour when doing 1 read per second) but they certainly affect the control of the machine I am trying to put together.

I am using this sensor as a tachometer, with a magnet attached to a rotating axle. It works very well for the cost.

Attached is the connection diagram. I am feeding the sensor with 24V which is within sensor's 5-30V input.

I was thinking of using a condenser but I am not sure if it would help, what would be a suitable size, type or connection scheme.

Thanks !

Wrong circuit for an NPN sensor. Transistor is not needed.
Connect sensor output directly to the Arduino pin, and add a 1k resistor between pin and Arduino 5volt.

Make sure it's an NPN sensor, otherwise you will blow things up.

The transistor was inverting that signal, and without the transistor it's not.
Must change your code to fix that.
Leo..

Try shielded cable and a capacitor at the sensor. This should make a big difference. That sensor will also pick up stray magnetics from almost anything that has a coil etc, transmitter. Since it is not operating extremely fast try adding a low pass filter in front of your NPN transistor, that would be a resistor in series with the base and a capacitor from the base to ground. The signal inversion is exactly what is expected.
Good Luck & Have Fun!
Gil

Thanks for your replies.

Wawa, the transistor is inside the sensor so actually the collector is connected to Arduino. I just splited up the components for clarity. So signal cable (black) goes from collector to Arduino pull-up. I suppose there are some diodes inside as well but the unit is so small and tightly packed I can't see inside....The data sheet has almost no information.

Gilshultz, I don't have access to the base, just the signal cable which is the collector side of the NPN transistor. So, should I disassemble the sensor? Shielded cables are a great idea, I am buying them today.

Look forward to your coments. thanks again.

You seem to confuse clarity with confusion! If the NPN was inside the sensor, draw it inside the sensor.

We ask people to always post full details of the hardware they ask about, up front. Please do so - product page or datasheet links are a good approach - dont expect us to google from part numbers, send the link.

gilshultz:
Try shielded cable and a capacitor at the sensor. This should make a big difference. That sensor will also pick up stray magnetics from almost anything that has a coil etc, transmitter. Since it is not operating extremely fast try adding a low pass filter in front of your NPN transistor, that would be a resistor in series with the base and a capacitor from the base to ground. The signal inversion is exactly what is expected.
Good Luck & Have Fun!
Gil
I assumed your drawing was correct. The NPN as an input is good, simply add something in the range of 5.6K pull up to the 5V power supply.

Sorry for the misleading drawing.

Here comes a link to the sensor's data sheet:

https://tronixlabs.com.au/sensors/hall-effect/hall-effect-switch-with-1-2m-lead-and-mount-australia/