The KY-024 is a linear Hall effect sensor module designed to detect magnetic fields. It outputs an analog voltage that is proportional to the strength of the magnetic field, making it ideal for applications requiring precise magnetic field measurements. Additionally, the module includes a digital output that can be triggered when the magnetic field strength exceeds a user-defined threshold, adjustable via an onboard potentiometer.
The KY-024 module consists of a linear Hall effect sensor, a comparator, and an onboard potentiometer for sensitivity adjustment. Below are the key technical details:
The KY-024 module has 3 pins for interfacing with external circuits. The table below describes each pin:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.3V to 5V) |
2 | GND | Ground connection |
3 | AOUT | Analog output voltage proportional to the magnetic field strength |
4 | DOUT | Digital output signal (High/Low) based on the magnetic field threshold setting |
Below is an example of how to connect and use the KY-024 with an Arduino UNO:
// KY-024 Hall Effect Sensor Example Code
// Reads analog and digital outputs from the KY-024 module and displays the results.
const int analogPin = A0; // Pin connected to AOUT (analog output)
const int digitalPin = 2; // Pin connected to DOUT (digital output)
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(digitalPin, INPUT); // Set DOUT pin as input
}
void loop() {
int analogValue = analogRead(analogPin); // Read analog value from AOUT
int digitalValue = digitalRead(digitalPin); // Read digital value from DOUT
// Print the analog and digital values to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(analogValue);
Serial.print(" | Digital Value: ");
Serial.println(digitalValue);
delay(500); // Wait for 500ms before the next reading
}
No Output from the Module
Inaccurate Analog Readings
Digital Output Not Triggering
Arduino Not Detecting Signals
Q: Can the KY-024 detect both north and south poles of a magnet?
A: Yes, the KY-024 can detect both poles of a magnet. The analog output voltage will vary depending on the strength and polarity of the magnetic field.
Q: How do I know if the digital output is working?
A: The onboard LED will light up when the digital output is triggered, indicating that the magnetic field strength has exceeded the threshold.
Q: Can I use the KY-024 with a 3.3V microcontroller?
A: Yes, the KY-024 is compatible with 3.3V microcontrollers, but ensure the power supply voltage matches the microcontroller's requirements.
Q: What is the range of the analog output voltage?
A: The analog output voltage typically ranges from 0V to the supply voltage (3.3V or 5V), depending on the magnetic field strength.
By following this documentation, you can effectively integrate the KY-024 Hall effect sensor module into your projects for reliable magnetic field detection and measurement.