The KY-035 is an analog Hall effect sensor manufactured by ESP32. It is designed to detect magnetic fields and output an analog voltage proportional to the strength of the magnetic field. This sensor is widely used in applications such as position sensing, current measurement, speed detection, and proximity sensing. Its compact design and ease of use make it a popular choice for hobbyists and professionals alike.
The KY-035 Hall effect sensor has the following key technical specifications:
Parameter | Value |
---|---|
Manufacturer | ESP32 |
Part ID | KY-035 |
Operating Voltage | 3.3V to 5V |
Output Type | Analog |
Output Voltage Range | 0V to Vcc (proportional to field) |
Sensitivity | High |
Operating Temperature | -40°C to +85°C |
Dimensions | 18mm x 10mm x 7mm |
The KY-035 sensor has three pins, as described in the table below:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply pin (3.3V to 5V) |
2 | GND | Ground pin |
3 | OUT | Analog output pin (voltage proportional to magnetic field) |
Below is an example code snippet to read the analog output of the KY-035 using an Arduino UNO:
// Define the analog pin connected to the KY-035 OUT pin
const int hallSensorPin = A0;
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Read the analog value from the Hall effect sensor
int sensorValue = analogRead(hallSensorPin);
// Convert the analog value to voltage (assuming 5V reference)
float voltage = sensorValue * (5.0 / 1023.0);
// Print the voltage to the Serial Monitor
Serial.print("Magnetic Field Voltage: ");
Serial.print(voltage);
Serial.println(" V");
// Add a small delay for stability
delay(500);
}
If using the KY-035 with an ESP32, connect the OUT pin to one of the ESP32's ADC pins (e.g., GPIO34). Adjust the reference voltage in the code to 3.3V instead of 5V.
No Output Voltage:
Inconsistent Readings:
Output Voltage Stuck at Maximum or Minimum:
Q: Can the KY-035 detect both north and south poles of a magnet?
A: Yes, the KY-035 can detect both poles, but the output voltage will vary depending on the polarity and strength of the magnetic field.
Q: Is the KY-035 compatible with 3.3V microcontrollers like the ESP32?
A: Yes, the KY-035 operates within a voltage range of 3.3V to 5V, making it compatible with both 3.3V and 5V systems.
Q: How can I increase the accuracy of the sensor?
A: Use a stable power supply, minimize external magnetic interference, and calibrate the sensor for your specific application.
Q: Can I use the KY-035 for digital output?
A: The KY-035 is designed for analog output. If you need a digital signal, you can use an external comparator circuit or a microcontroller's ADC to process the analog signal.