KY-003 HALL MAGNETIC SENSOR MODULE

Click Here to View Step by Step

KY-003 HALL MAGNETIC SENSOR MODULE


Short description :

The KY-003 Hall Magnetic Sensor module is a switch that reacts to the presence of a magnetic field, turning itself on or off. .

Working with  (Compatible)

Arduino, ESP32, Nodemcu, ESP8266, Raspberry Pi and ......

ky-003 Hall magentic

ky-003 Hall magentic

ARDUINO IDE CODE 

Example description :

The LED on Arduino pin 13 will flash when the KY-002 is knocked or shaked.

int hallSensorPin = 4;
int hallSensorValue = 0;

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(hallSensorPin,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:

hallSensorValue = digitalRead(hallSensorPin);
Serial.print("hallSensorValue: ");
Serial.println(hallSensorValue);

}