325Views13Replies

Author Options:

Determine the distance between a magnet and a hall effect sensor? Answered

Hi guys,
As the title say, I am looking for a way to determine / measure the distance between the magnet and the hall effect sensor. What I want to archive is that the trigger (or the switch to LED) only activate if the magnet within ~0.5 cm - 0.3 cm . Any more than that, it wont do anything.
My code right now light up the led whenever it detect if the magnetic field but the distance is way too large ( about 3-4cm ). So anything to reduce that down to 0.5 would be the best. 

Please throw in any suggestion, recommendation , sample code or solution if you have. I am much appreciated . 

Thank you


EDIT 1:  I want to used arduino for this prototype.
          the sensor that I am using is this 
http://www.littelfuse.com/~/media/electronics/datasheets/hall_effect_sensors/littelfuse_hall_effect_sensors_55100_datasheet.pdf.pdf

A little bit more info on what I am working on is that I mount the magnet to a wheel that rotate about 200-500rpm. and whenever the sensor pick up the magnetic field, it light up LED. but since it rotate, it tend to pick up the magnetic field instead at 1 location, it pick up in an arc. So that why I want to narrow down the range of the sensor

UPDATE: NEW QUESTION WITH MORE CLARIFICATION https://www.instructables.com/answers/Create-standstill-effect-with-LED-from-hall-effect/

Discussions

0
None
steveastrouk

2 years ago

All you need to do is trigger on the edge

Square waves.jpg
0
None
iceng

2 years ago

The field strength of different magnets will activate in different parts of the hall corridor. Mount the sensor at a more remote distance to the magnet arc or use an iron flux guide for pin point flux trip detect by containing the widely dispersed magnet flux in a narrow iron channel...

0
None
rickharrisiceng

Answer 2 years ago

+1 on the iron guide.

amazing what a little more information brings isn't it :-)

0
None
rickharris

2 years ago

Your code in what?

What hall effect chip are you using.

What is the end point of this - there may be other ways.

I feel sure you know what your doing but clairvoyant we are not.

0
None
Jack Vurickharris

Answer 2 years ago

sorry. Should have been clear. I already update my question. this is the sensor i am using.

http://www.littelfuse.com/~/media/electronics/data...

A little bit more info on what I am working on is that I mount the magnet to a wheel that rotate about 200-500rpm. and whenever the sensor pick up the magnetic field, it light up LED. but since it rotate, it tend to pick up the magnetic field instead at 1 specific location, it pick up in an arc. So that why I want to narrow down the range of the sensor

0
None
Downunder35mJack Vu

Answer 2 years ago

That is why other people simply use LED's for this...
You can to shield the sensor with some soft iron but it won't help you with the "arc" problem.
If you insist on using a magnetic sensor instead of LED's or a reed contact than you have to program some timing funtions, let's say:
Signal detected, wait 1ms, activate output for 1ms, wit for next cacle until signal is zero again...

0
None
Jack VuDownunder35m

Answer 2 years ago

yeah. That what I have been trying to do. But with the method of timing like that, if the speed of rotation change, it wont work, and if the flashing duration too small, the LED will be very dim.
Is there a way to measure the distance between the magnet and the sensor with coding ? the arc problem can be solve with that since i can program it to lit up the LED when the magnet is 0.5cm away from the sensor.

0
None
Downunder35mJack Vu

Answer 2 years ago

People manage that for over 40 years now without fancy electronics.
Called ignition timing lights - a strobe lamp that flashes every time the rotating part is at a fixed position.
Either through a ignition itself or by use of a reflective sticker and an optical sensor.

0
None
steveastrouk

2 years ago

You only need to see the EDGE of the sensor detecting the field, not the level.

0
None
Downunder35m

2 years ago

Did you consider using a more suitable magnet or to shield the sensor?
Might be too easy and obvious though but I am too lazy to work out complicated algorithms if I can avoid it...

0
None
Jack VuDownunder35m

Answer 2 years ago

Do you know how to shield the sensor ? particularly this one?

http://www.littelfuse.com/~/media/electronics/data...

A little bit more info on what I am working on is that I mount the magnet to a wheel that rotate about 200-500rpm. and whenever the sensor pick up the magnetic field, it light up LED. but since it rotate, it tend to pick up the magnetic field instead at 1 location, it pick up in an arc. So that why I want to narrow down the range of the sensor