Hall effect sensor help Allegro 3144 [Solved]

Hi All,

Beginner with hardware I need some help with a Hall Effect switch. I am planning to use it to control the speed of two motors of a very simple robot design (turns out one of the motors is faster than the other but that's another story)

I got some Allegro MicroSystems 3144 switches

Dunno which one I got, it says 3144 OH 09 on mine

So the vendor said I can directly plug it in and the datasheet says it can be used with suitable pull-up resistor

With suitable output pull-up, they can be used with bipolar or CMOS logic circuits

(first page)

I don't know how to plug it in, I tried directly and the input I read is 0 when I get a magnet really close but when no magnet is nearby, it just varies a lot between 0 and 1 (or 0 and n on a analog input)

What am I doing wrong (apart from plugging in things without knowing better :-[)?

Datasheet

(was not allowed to include in my first post)

According to Allegro, the 3144 has been out of production for a while, but does have a replacement...

Anyhow, I assume by the directly plugging in refers to something like a motor controller with hall effect sensor inputs. That's not what you have. When the output of this sensor turns on, it will pull the output pin to ground. Otherwise, it will tend to float. That's why you need the pull-up. That's just a resistor to the Arduino's 5V pin; I usually use 1K but it's probably not critical.

Arduino pins have built-in pullups that are under program control. You turn them on by setting the pinMode to INPUT and then writing the pin HIGH.

Should be pretty simple to wire up. Wire supply and ground terminals of the sensor to Arduino +5v and ground pins respectively. Wire the signal terminal to your desired digital pin. You will then need to either wire an external resistor (10k ohms is fine) from the Arduino digital input pin and +5vdc, or by software command enable the internal pull-up resistor for that digital input pin. A reading of zero means magnet sensed and reading a one means no magnetic field sensed.

Info on enabling internal pull-up resistors: http://www.arduino.cc/en/Tutorial/DigitalPins

Lefty

Thanks a lot to both of you, the internal pull-up resistor did the job for me.

This is a lot of fun :smiley: