The YL-105 usually comes with a 4-pin header. Looking at the module from the top (with the coil/inductor visible and pins facing down):
void loop() int sensorState = digitalRead(sensorPin); yl-105 datasheet
Remember:
By turning the potentiometer, you set the reference voltage. When the Hall sensor’s output exceeds this reference, the comparator’s output toggles. This allows you to adjust the magnetic threshold distance. The YL-105 usually comes with a 4-pin header
If you bought a multi-pack and they behave differently, check the resistor values on the PCB. Clone variations exist, but the functional principle remains the same. Remember: By turning the potentiometer