KY-035 Analog Hall Magnetic Sensor Module

The KY-035 analog magnetic hall sensor is a module that reacts in the presence of a magnet. It can measure the polarity and relative strength of a magnetic field.

When no magnetic field is detected, the output signal is roughly half of the applied input voltage. When a magnetic field is detected, the output signal goes up or down depending on the polarity and proximity of the magnet.

This module offers a more detailed proximity reading than the KY-003, a digital magnetic sensor that looks very similar to this module. It is also functionally similar to the KY-024, a digital/analog magnetic sensor.

Compatible with popular microcontroller boards like Arduino, ESP32 and ESP8266. Rapsberry Pi users will need an external analog-to-digital board to use this module.

KY-035 Specifications

This module is very simple, it consists of a 49E Linear Hall-Effect sensor and 3 male header pins.

Operating Voltage2.7V to 6V
Power Consumption~ 6mA
Sensitivity1.4 to 2.0mV/GS
Operating Temperature-40 °C to 85 °C [-40 °F to 185 °F]
Board Dimensions18.5mm x 15mm [0.728in x 0.591in]

Connection Diagram

Connect the KY-035’s power line (middle) and ground (-) to +5 and GND on the Arduino respectively.

Connect signal (S) to pin A0 on the Arduino.

KY-035Arduino
SPin A0
middle5V
GND

KY-035 Arduino Code

The following Arduino sketch will read values from the module. The output signal starts at an initial value determined by the input voltage.

The value will decrease when a magnetic field with the same polarity is detected, if the polarity is inverted, the value will increase.

int sensorPin = A0;   // interface pin with magnetic sensor
int val;              // variable to store read values

void setup() {
  pinMode(A0, INPUT);   // set analog pin as input
  Serial.begin(9600);   // initialize serial interface
}

void loop() {
  val = analogRead(sensorPin);  // read sensor value
  Serial.println(val);          // print value to serial

  delay(100);  
}

Use Tools > Serial Plotter on the Arduino IDE to visualize changes on intensity and polarity of the magnetic field.

Downloads

Leave a Comment