Arduino Tutorials – Lesson 15 -Hall Effect Sensor with Arduino UNO

Creating Hall Effect Sensor program using Arduino UNO

Required Components

  1. Hall effect sensor -1 no
  2. magnets -1 no
  3. Arduino UNO -1 no
  4. Connecting wires -1 set

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect the Hall effect Sensor to the Arduino UNO board.
  3. Connect the Arduino UNO board 2nd pin to the Hall effect Sensor(Analog or Digital).
  4. Connect Hall effect Sensor board VCC, GND to 5V, GND of Arduino Uno Board.
  5. Check the Cicuit Connections.
  6. Check the Arduino program.
  7. Run the Arduino program.

Arduino Program

int hallSensorPin = 2;
int ledPin =  13;
int state = 0;

void setup() 
{
  pinMode(ledPin, OUTPUT);
  pinMode(hallSensorPin, INPUT);
}

void loop( )
{
  state = digitalRead(hallSensorPin);
  if (state == LOW) 
  {
    digitalWrite(ledPin, HIGH);
  }
  else 
  {
    digitalWrite(ledPin, LOW);
  }
}

Usage

  1. Positioning
  2. Speed detection
  3. Current sensing applications
  4. Tachometers
  5. Anti-lock braking systems

Leave a Reply

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