Sie sind auf Seite 1von 4

AIM – To Design a Project depicting Hall effect Sensor and its working with Arduino.

BLOCK DIAGRAM-
CODE-

#define DETECT 2 // pin 2 for sensor

#define ACTION 8 // pin 8 for action to do something.

void setup() {

Serial.begin(9600);

Serial.println("Hall Module Test");

pinMode(DETECT, INPUT);//define detect input pin

pinMode(ACTION, OUTPUT);//define ACTION output pin

void loop() {

int detected = digitalRead(DETECT);// read Hall sensor

int detectedAn = analogRead(A0);// read flame analog value

if( detected == LOW)

digitalWrite(ACTION,HIGH);// set the buzzer ON

Serial.println("Detected!");

// Serial.println(detectedAn);// print analog value

else{

digitalWrite(ACTION,LOW); // Set the buzzer OFF

Serial.println("Nothing");

delay(200);

}
Working of the scheme-

The Hall effect sensor works on the principle of the Hall effect, which states that whenever a magnetic
field is applied in a direction perpendicular to the flow of electric current in a conductor, a potential
difference is induced. This voltage can be used to detect whether the sensor is in the proximity of a
magnet or not. The Arduino can detect this voltage change through its interrupt pin and determine
whether the magnet is near the sensor or not. The basic working of the Arduino Hall effect sensor is
shown in the picture below.

Arduino Hall effect sensor working

There are many types of Hall effect sensors, and certain types are better for certain applications. For
applications where the speed of detection is not crucial, ordinary Hall effect sensors like 44E can be
used. However, for applications that involve high-speed detection, like in the case of speedometers,
high-frequency Hall effect sensors like US5881 or US1881 should be used. There are two main types
of Hall effect sensors: latching and non-latching.

The US1881 is a latching Hall effect sensor. The sensor gives out an output HIGH (5V) voltage whenever
the north pole of a magnet is brought close to it. Even when the magnet is removed, the sensor still
outputs a HIGH voltage and does not go LOW (0V) until the south pole of the magnet is brought close
to it. These sensors that latch on to a particular state are called latched Hall effect sensors.

The US5881 is a non-latching Hall effect sensor. The sensor gives an output HIGH voltage whenever
the north pole of a magnet is brought close to it, and switches LOW whenever the magnet is removed.
I personally prefer non-latching Hall effect sensors like the US5881 for my projects.

Hall effect sensors have three pins: VCC(5V), GND, and Vout(Signal). The pinout of a Hall effect sensor
is as shown below:
Arduino Hall effect sensor pinout

RESULTS-

Das könnte Ihnen auch gefallen