• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Magnetic Field Detector Circuit using Hall Sensor And Arduino

Magnetic Field Detector Circuit using Hall Sensor And Arduino

Last updated on 21 November 2025 by Admin-Lavi Leave a Comment

This project show about Magnetic Field Detector Circuit using Hall Sensor And Arduino.

When magnet come near sensor, the buzzer beep and LED glow.

Arduino read sensor output and give alarm when magnet is present.

This project is simple and good for beginners.

Arduino Coding:

void setup() {
pinMode(8, INPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
}

void loop() {
int sensor = digitalRead(8);

if (sensor == 0) {
digitalWrite(7, HIGH);
digitalWrite(6, HIGH);
} else {
digitalWrite(7, LOW);
digitalWrite(6, LOW);
}
}

Code Explanation:

  • pinMode set pin type.
  • Sensor pin is INPUT because Arduino read it.
  • LED and buzzer pins are OUTPUT because Arduino control them.
  • digitalRead read value from Hall sensor.
  • If sensor read 0 then magnet is near.
  • Then Arduino turn LED ON and buzzer ON.
  • If sensor read 1 then there is no magnet.
  • Then Arduino turn OFF LED and buzzer.

Circuit Working:

Magnetic Field Detector Circuit Diagram using Hall Sensor And Arduino

Parts List:

Part NameQuantity
Resistor
220Ω 1/4 watt1
Semiconductors
Arduino UNO1
KY-024 Hall Effect Sensor1
Buzzer1
LED any 5mm1
USB Cable1

The above circuit diagram uses a buzzer and LED that turn ON when the sensor detects any weak or strong magnetic field.

Hall effect sensor give digital signal.

When magnet is close, sensor output go low or high depending on module type.

Arduino read this output pin.

If Arduino see magnet then it turn LED ON and turn buzzer ON.

If magnet is not present then Arduino keep them OFF.

Formulas with Calculation:

LED resistor calculation:

Arduino voltage = 5V

LED forward voltage approx = 2V

LED current needed = 10mA

Resistor = (5 – 2) / 0.01 = 300 ohm

Nearest standard is 220 ohm

So in this circuit we used 220 ohm resistor.

How to Build:

To build a Magnetic Field Detector Circuit using Hall Sensor And Arduino follow the below steps for connection:

  • Take all the parts as shown in circuit diagram.
  • Hall sensor Signal pin goes to Arduino digital pin 8.
  • Middle pin goes VCC to Arduino 5V.
  • GND pin goes Ground to Arduino GND.
  • LED long leg is connected to Arduino pin 7 through 220 ohm resistor.
  • LED short leg goes to GND.
  • Buzzer positive pin goes to Arduino pin 6.
  • Buzzer negative pin goes to GND.

Conclusion:

This Magnetic Field Detector Circuit using Hall Sensor And Arduino is simple and easy to make.

The system detect magnet fast and give sound and light alert.

Good for learning sensor reading, digital pins and simple alarms.

We can use it in door alarms, magnetic switches and robot sensing.

References:

Control and measurement of a magnetic field using Arduino

Filed Under: Arduino Projects, Sensors and Detectors

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Solenoid Valve Control Circuit using Arduino
Next Post: RF Transmitter Receiver Circuit with Arduino Uno »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • Alarm Circuits (45)
  • Amplifier Circuits (67)
  • Arduino Projects (99)
  • Audio Circuits (114)
  • Automobile Circuits (19)
  • Battery Charger Circuits (65)
  • Free Energy (13)
  • Heater and Temperature Controllers (13)
  • High Voltage (1)
  • Indicator Circuits (45)
  • Inverter Circuits (20)
  • IoT projects (1)
  • LDR Circuits (26)
  • LED and Lamps (148)
  • Meters and Testers (30)
  • Motor Controllers (22)
  • Oscillator Circuits (39)
  • Power Supply Circuits (104)
  • Remote Control Circuits (10)
  • Security and Protection (29)
  • Sensors and Detectors (126)
  • Solar Circuits (29)
  • Timer Circuits (41)
  • Transistor Circuits (87)
  • Transmitter Circuit (17)
  • Tutorials (8)
  • Water Level Controller (6)

Recent Posts

  • 12V Battery Low Voltage Alarm Circuit
  • Low Voltage Alert Circuit for 9V Battery
  • Digital Code Lock Circuit using IC 4017
  • Darkness Activated LED Circuit
  • Fan Start 10 Second Delay Timer Circuit

Recent Comments

  1. TDHofstetter on DIY Variable Power Supply Circuit using Arduino
  2. feathbuff on Simple Micro Ampere Meter Circuit
  3. Admin-Lavi on Simple School Project Multimeter Circuit
  4. choke on Simple School Project Multimeter Circuit
  5. Admin-Lavi on Analog to Digital Converter Circuit using IC 555

Copyright © 2026 | New Circuit Ideas