measuring distance with hall sensor

hello,

is this possible to measure distance with hall effect 3144?
i wrote a code:

int sensorPin = A1;
int counter = 0;

void setup() 
{
 // setup serial - diagnostics - port
 Serial.begin(9600);
 pinMode(sensorPin, INPUT);
}

void loop() 
{
 counter++;
 int sensorValue = analogRead(sensorPin);
 Serial.print(counter);
 Serial.print(" ");
 Serial.println(sensorValue);
 delay(1000);
}

in output when there is magnet it shows 1023, when magnet is in close distance shows 3 or 4.

Not easy, I asked producers of the magnets - at which distance your magnet has 1nT field strength - no one answered that.
Unless you calibrate sensor manually.

The 3144 is a hall effect switch. It is digital, it is on or off, no in between so analogRead() is not appropriate.

To find information on analog sensors Google "linear hall sensor arduino".

groundFungus:
The 3144 is a hall effect switch. It is digital, it is on or off, no in between so analogRead() is not appropriate.

To find information on analog sensors Google "linear hall sensor arduino".

thanks for the advice

Look at my Magnetic Bounce project in The MagPi 69, free PDF at:-

That does exactly what you want.

Video at Magnetic Bounce - YouTube

Very nice,I played the video 10 times

Mike
What you are using to draw the lines(youtube), it seems it is not a MegunoLink ?

ted:
Mike
What you are using to draw the lines(youtube), it seems it is not a MegunoLink ?

This is a project for the Raspberry Pi and everything is written in Python.

Thanks