I am using a A1324 hall effect sensor for a distance measuring.

The voltage output keeps changing even if the distance between the magnet and sensor does not change. The output changes +-0.200V and I am trying to measure the distances at steps of 0.01V.

  • What values do you see? What is the range of the changes? Mar 20 '18 at 14:53
  • The output changes +-0.200V and I am trying to measure the distances at steps of 0.01V.
    – Pratyaksh
    Mar 20 '18 at 14:54
  • What variation in Gauss do you expect? What mathematic/design do you have?
    – MatsK
    Mar 20 '18 at 15:28
  • I am not interested in measuring the magnetic flux in my project. The main aim is to measure the distance from a magnet. I am using a voltage divider method to get the voltage output from the hall effect sensor.
    – Pratyaksh
    Mar 23 '18 at 18:26

From https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/


Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit.

It is likely what you are seeing is noise and is to be expected. The source of the noise is likely multiple and could be environmental physical metallic or magnetic objects some distance away that are moving, electrical wiring (mains) nearby, and noise introduced by the power supply to the Arduino.

If you want to get a stable precise reading that close to the minimum step size, you will want to take several readings and average them. The more you read and average, the more you can eliminate the random effect of the noise, but the tradeoff is that it is slower because you are taking tens or hundreds of readings just for one result.

  • I was reading online that I can use filters to reduce the noise. But I have never worked with filters before could you suggest a way to start with that ?
    – Pratyaksh
    Mar 23 '18 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.