Introduction: Making Magnetic Dedector

About: Mechanical engineer, Entrepreneur, Maker, robotic systems expert and founder of Robimek and RobiBot

We do with Arduino using a simple magnetic detector magnetic sensor.As soon as the magnetic field is detected the alarm will be activated and we will understand that that magnetic field.

Study Magnetic Sensor Logic:

Relay closes on magnetic sensors magnetic field and thus entered the data voltage circuit. 0ver the normal state, while the magnetic field 5v give.

This Project:

Step 1: Materials:

  • Arduino
  • Magnetic Sensor
  • LCD (16 × 2)
  • buzzer
  • Jumper cables

Step 2: Electronic Circuits Links:

It is shown in the image sensor that we used in the project.Also available in over 4 pin.He writes the names on the pins.3.dijital A0 pin to pin to the DO pin of the 13 digital pins, we’re connecting 5v to 5v and GND GND pins.Because we use the project Scl LCD serial converter, we insert the Sde pin s standard I2C pins on the Arduino.Using the I2C protocol to communicate with the Arduino software, we realized the LCD.10. We are installing a buzzer signal in the digital pin to pin.

Step 3: Software Part:

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);

int Led = 13 ;

int sinyalpin = 3;

int val ;

int buzzerpin = 10;

void setup ()





pinMode(buzzerpin, OUTPUT);

pinMode (Led, OUTPUT) ;

pinMode (sinyalpin, INPUT) ;



void loop ()


val = digitalRead (sinyalpin ) ;

if (val == HIGH) { lcd.setCursor(0, 1);

lcd.print("Manyetik yok");

digitalWrite (Led, LOW);





lcd.setCursor(0, 1);

lcd.print("Manyetik var");

beep(500); digitalWrite (Led, HIGH);



void beep(unsigned char delayms)


analogWrite(10, 255);


analogWrite(10, 150);



Step 4: Description

We completed our project.Now we had a simple detector can determine whether the magnetic field.

Note: Due to the magnetic sensor can adjust the knob on the magnetic detection sensitivity.

More information:

Epilog Contest VII

Participated in the
Epilog Contest VII