Projects / Magnet pole finder

Magnet pole finder

Beginner40 minGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANO

    Check the sensor pin order

    Flat face towards you: pin 1, 2, 3 left to right.

  2. NANO14.1 mA

    Wire it to 5V, GND and D2

    Add the LED on D8 with 220 ohms.

  3. NANO

    Upload and open the serial monitor at 9600

    It says No pole.

  4. NANO14.1 mA

    Bring one end of a magnet to the flat face

    The LED may light.

  5. NANO

    Turn the magnet round

    The other end should do nothing.

  6. NANO14.1 mA

    Check with a compass and mark the south pole

    The tape goes on the end that lights the LED.

  7. NANO

    Measure the switching distance

    Compare two magnets.

In short

How do you build a magnet pole finder?

A Hall sensor lights an LED when it feels one pole of a magnet and stays dark for the other, so you can mark the poles of a small magnet. Use small magnets only, and keep them away from phones, cards and anyone with a pacemaker. You need Arduino Nano, Hall Effect Sensor A3144, LED 5 mm red, Resistor 220 Ω, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 40 minutes.

Level
Beginner
Time
About 40 min
Parts
6

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
A3144 pin 1 (VCC)Nano 5VPower
A3144 pin 2 (GND)Nano GNDCommon ground
A3144 pin 3 (output)Nano D2Pulls to ground when the right pole is near
LED long legNano D8 through a 220 ohm resistorIndicator output
LED short legNano GNDReturn path

Code

The A3144 is a Hall sensor that switches when the magnetic field through it passes a set strength, and it only responds to one direction of field. Hold the flat, marked face of the sensor towards a small magnet and one end should make the LED light while the other end does nothing. The end that lights the LED is the south pole by the usual rule, and you can confirm this with a compass, because the north end of a compass needle points to a magnet's south pole. Mark that end of the magnet with a dot of tape. Then slowly bring the magnet from far away and note the distance at which the LED switches on, and the slightly shorter distance at which it switches off again. Try two magnets of different sizes and compare. Use small magnets only. Keep them well away from phones, bank cards and pacemakers, and keep fingers clear when magnets can snap together. Check the pin order of your own sensor against its datasheet, because a wrong power connection can ruin it.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const uint8_t HALL_PIN = 2;
const uint8_t LED_PIN = 8;

bool lastNear = false;

void setup() {
  pinMode(HALL_PIN, INPUT_PULLUP);        // the A3144 output pulls low when triggered
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  bool near = (digitalRead(HALL_PIN) == LOW);
  digitalWrite(LED_PIN, near ? HIGH : LOW);
  if (near != lastNear) {
    lastNear = near;
    Serial.println(near ? "Pole detected" : "No pole");
  }
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
One magnet endLED on, Pole detected prints
Opposite endLED stays off
Magnet far awayNo pole
Bigger magnetSwitches from further away
Magnet removedLED goes off

If it does not work

Neither end lights the LED

Try the other face of the sensor or a stronger magnet.

LED always on

Check the output is on D2 and the pin order is right.

Sensor gets hot

Disconnect, the power pins may be swapped.

Both ends seem to work

Your sensor may be a latching or bipolar type.

No serial text

Set 9600 baud.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the magnet pole finder?

Arduino Nano, Hall Effect Sensor A3144, LED 5 mm red, Resistor 220 Ω, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the magnet pole finder take to build?

About 40 minutes for a beginner maker, in 7 steps.

How do I know the magnet pole finder works?

One magnet end: LED on, Pole detected prints. Opposite end: LED stays off. Magnet far away: No pole.

Neither end lights the LED: what should I check?

Try the other face of the sensor or a stronger magnet.

LED always on: what should I check?

Check the output is on D2 and the pin order is right.

Sensor gets hot: what should I check?

Disconnect, the power pins may be swapped.

Both ends seem to work: what should I check?

Your sensor may be a latching or bipolar type.