Analog Sensor Advice

Hello! I\m new to Arduino I need to choose a analog sensor to give analog input to Arduino based on change in distant. I’ve attached this simple illustration. I was thinking about analog hall effect magnetic module, any better Ideas? Thanks

Adnan

Have you considered a sensor that was actually meant to sense distance? Like an ultrasonic or one of the IR distance sensors?

Delta_G:
Have you considered a sensor that was actually meant to sense distance? Like an ultrasonic or one of the IR distance sensors?

I will see how those two sensors work, I don't know them. Thank you

adnan86:
I will see how those two sensors work, I don't know them. Thank you

Google is your friend. You'd already be a lot further ahead if you'd just googled "Measure distance with arduino"

Hi,
A hall effect device will not be able to give you reliable values as the metal plate will have to be magnetised to produce a magnetic field.

The response will not be linear and will depend on the level of mag-field emanating from the plate.

Ultrasonic or IR would be a better way.

Thanks.. Tom.. :slight_smile:

It also depends on the distance you want to measure.

A millimeter range requires very different sensors than meter range, for example.

Hi,
OPs diagram.


Tom... :slight_smile:

1/ A vernier gauge.

2/ If you can attach a linear potentiometer it would be reasonably good.

3/ How accurately do you want to measure that spacing? Over what max/min range?

magnetics, sound or IR won't work.

Allan

Image is unfortunately ambiguous, I assume this means that the distance between A and B will always be 4-5 cm. The text may also mean that the movement itself is 4-5 cm, but that leaves me guessing the actual distance between the plates.

So at 4-5 cm distance:

Ultrasound may or may not work - it's on the low end of the range of an HC-SR04, the thickness of the sensor may become an issue (as it brings down the effective distance to about 3 cm, while the minimum it can range is 2 cm) and the 1 cm difference is close to the typical error you see in measurements. It being steel plates should give really clean echoes though, which is why it may work.

IR/laser: too close, their minimum distance is about 1 meter.

Magnetic: you should be able to make this work with two metal plates, the distance is not too much but your sensitivity will have to be very high - to the extent that if you breath over it (increase humidity/temperature of the air) you will detect it. You'll also detect your hands getting within about 10 cm of the device. You'll detect just about anything that's placed in between the plates. So environmental factors are such that you may not be able to do a reliable measurement.

So indeed at a 4-5 cm range we're down to mechanical options.

Magnetic: you should be able to make this work with two metal plates, the distance is not too much but your sensitivity will have to be very high - to the extent that if you breath over it (increase humidity/temperature of the air) you will detect it. You'll also detect your hands getting within about 10 cm of the device. You'll detect just about anything that's placed in between the plates. So environmental factors are such that you may not be able to do a reliable measurement.

If using eg a linear hall sensor and magnet it would be extremely immune to anything except ferromagnetic materials - that's not the problem. The response would be very non-linear and 4cm is a long way.

Allan

Non-linear is easy to calculate for (it's going to be a third-power drop-off, right?) - the difference in signal strength is the real issue.

But before we speculate more, best have OP clarify the actual distance between the plates. Based on the image it could be a lot more than 4 cm...

Maybe a VL53L0X or similar?

Or a VL6180X...

nifty gagets - didn't know they existed.

Allan