Build it step by step
0 of 7 doneCheck the sensor pin order
Flat face towards you: pin 1, 2, 3 left to right.
Wire it to 5V, GND and D2
Add the LED on D8 with 220 ohms.
Upload and open the serial monitor at 9600
It says No pole.
Bring one end of a magnet to the flat face
The LED may light.
Turn the magnet round
The other end should do nothing.
Check with a compass and mark the south pole
The tape goes on the end that lights the LED.
Measure the switching distance
Compare two magnets.
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
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 220 Ω × 1
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| A3144 pin 1 (VCC) | Nano 5V | Power |
| A3144 pin 2 (GND) | Nano GND | Common ground |
| A3144 pin 3 (output) | Nano D2 | Pulls to ground when the right pole is near |
| LED long leg | Nano D8 through a 220 ohm resistor | Indicator output |
| LED short leg | Nano GND | Return 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.
| Check | Expected |
|---|---|
| One magnet end | LED on, Pole detected prints |
| Opposite end | LED stays off |
| Magnet far away | No pole |
| Bigger magnet | Switches from further away |
| Magnet removed | LED 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 →
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.
