Hall Effect Sensor Data Problem

Good day, all
I am starting a new Arduino project where I’ve decided to use a Hall Effect Sensor and magnet attached to a bicycle as a switch to control a speedometer in Unity, but I’m having issues with the data it is outputting into the serial port to Arduino. The device outputs 1023 when the magnet is far away, and 0 when it is in close proximity as it should, but this is not consistent. Sometimes it does not change at all from 1023 to 0 when the magnet is close, and other times it just completely inverts the values (1023 with close magnet, 0 when far).

Any idea what I might be doing wrong? Thank you in advance!

3 Likes

Hey Dan,

Which hall effect sensor were you using? Also making sure that its hooked up to according to the datasheet is also key in debugging why it may not be working. Making sure that the output is tied to a reference voltage (makes sure it will default to a known state).

2 Likes

Hi Dan,

Any chance you could chuck up a quick photo or crude diagram of your wiring for us to have a look at?

While I haven’t actually worked with Hall Effects myself, now would be a great time for me to brush up!

-James

1 Like

Hi all.
I have some documentation re hall effect devices around here somewhere. I will try to dig it up when I get a chance. What I did to find a solution to my circumstance was to simply Google “hall effect”. Lots of info on offer.

From memory (for what it is worth) there seems to be two different main types.

One I think when say 5V is applied will output 2.5V with no magnetic field and will drop toward zero or rise toward 5V in the presence of a field. North pole one way and south pole the other.

Another type has a schmidt trigger built in. Switches when magnetic field present. I don’t know at the moment if magnet polarity matters. I am not sure if they output 5V and 0V or if they are open collector, maybe both available. I know from past experience that hall keyboard switches come in both source and sink types.

I seem to recall an application where a biasing magnet is used behind the sensor and different things happening depending on the polarity of the magnets.

Try it. Do some research. Google hall effect and see what comes up. Some of the web sites from people who manufacture these things have info and application notes. You are pretty sure to find the best method to achieve your goal.

From what you say I think you would be better off forgetting about analog inputs and go for the schmidt trigger switch type and use a digital pin. An open collector (if available) type and a pull up resistor on a digital pin would probable be the best option.
Cheers Bob

2 Likes