Playing with Hall effect sensors

Well I like to pass on fun devices when I run across them, so I thought I would pass on two Hall effect items I just got off E-bay. I had heard and read about Hall effect devices before but never really had a need to actually try them, so it was a first for me to play with.

These are both very small devices but with long enough leads (both are 3 lead devices, Vcc, ground and output) to be easy to use. They are pretty cheap and seem very stable and predictable, and don't take much 5vdc current to operate.

The first one, the A3213EUA is a magnetic switch.

http://www.newark.com/allegro-microsystems/a3213eua-t/hall-effect-ic/dp/65K5162

It has a open drain output that you pull up with a 10K or more resistor, or use the Arduino internall soft pull-up. It is high when there is no magnetic field and switches low when either a north or south magnetic field is sensed. In my bread board it could sense a 1/2" square, flat, thin refrigerator magnet about an inch away from it's front face. Nice clean transitions with enough hysteresis to not cause bounce problems. Would be good for hidden alarm switchs, RPM sensor of rotating items and maybe homemade switches using magnets for the buttons and I'm sure a zillion other fun applications.

The second, the A1323LUA-T is a analog output hall effect magnetic sensor.

It has a 0-5vdc analog output that is normally at 2.5vdc with no magnetic field present. If it senses a south magnetic field it increase it's output voltage towards 5vdc. If it senses a north magnetic field it decreases it's output voltage towards ground. It's sensitivity rating is 2.5mv per Gauss, so I think that works out to be a +/- 1,000 guass range. This could be used as a position feedback sensor or some other exotic applications. It too seems stable and it's accuracy spec is worst case +/- 1.5%.

The linked items both have links to data sheets for these devices.

Have fun and remember it's all about the hardware :wink:

Lefty

could you post the schematic you used to test the A3213EUA-T. I am using the same hall effect switch, but am having no luck getting it to work.

I have no schematic drawing software handy, but it was a very easy hook-up:

In the setup portion of the sketch you have to define the pin you are going to use and enable the internal pull-up resistor.

pinMode(2, INPUT); // set pin 2 to read hall detector
digitalWrite(2, HIGH); // turn on pullup resistors

You can then use a If statement in your loop sketch to test if the hall detector is seeing a magnetic field, 0 means yes, 1 means no field.

The hall detector has 3 terminals, one wires to the Arduino ground pin, one wires to the Arduino's +5vdc pin and the third pin wires to the Arduino's digital input pin you select (pin 2 in my setup above).

Here is a link to the data sheet for the hall detector:

http://www.allegromicro.com/en/Products/Part_Numbers/3213/3213.pdf

Here is a link to the Arduino site that explains digital pins and the use of the internal pull-up option.

Hope that helps. They are neat devices and really are easy to use.

Lefty