KY-033: Analog Hall magnetic

Buy this 37 in 1 - kit.

Analog Hall magnetic sensor module

Analog magnetic sensor module and a digital interface, built-in 13 LED build a simple circuit to produce a magnetic flash Makers. Comes with digital interfaces of the LED, the analog magnetic sensor connected to the power board and analog pin 5 of ARDUINO. When analog magnetic sensor to a signal, LED lights, otherwise the lights off.

Example Code

int sensorPin = A5; // select the input pin
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

void setup () {
  pinMode (ledPin, OUTPUT);
  Serial.begin (9600);
}

void loop () {
  sensorValue = analogRead (sensorPin);
  digitalWrite (ledPin, HIGH);
  delay (sensorValue);
  digitalWrite (ledPin, LOW);
  delay (sensorValue);
  Serial.println (sensorValue, DEC);
}