HS-S40A Hall Magnetic Switch - All-Pole Digital Magnetic Detection Sensor for Arduino Projects The HS-S40A All-Pole Hall Magnetic Switch module detects magnetic fields and outputs a digital signal for proximity, position, speed, and limit-switch applications. Because it is described as all-pole, it can respond to either magnetic polarity in typical switch-style use, making it convenient for magnet detection experiments and simple embedded triggers. This module is useful for door sensors, wheel rotation counters, homing switches, contactless controls, and STEM magnetic-field demonstrations. It pairs well with the ELAB Nano V3, UNO R3 Prototype Expansion Board, and visual output modules such as the RGB Full Color LED Module. Use a small permanent magnet for testing, then tune placement and distance in the final mechanical assembly. Magnetic sensors are contactless, but the switching distance depends strongly on magnet strength, orientation, nearby metal, and module mounting. Technical Specifications Parameter Value SKU HS-S40A Product Type All-pole Hall magnetic switch module Sensing Method Hall-effect magnetic field detection Output Digital switch signal Magnetic Polarity All-pole behavior per product title Typical Supply 3.3V / 5V controller systems Interface VCC, GND, signal pin per module label Use Cases Limit switches, door sensors, wheel counters, proximity triggers Host Requirement Digital GPIO input Installation Test magnet distance and orientation in final assembly Board Layout & Label Guide Hall Sensor - Detects nearby magnetic fields. Signal Pin - Digital output to the host GPIO. VCC - Positive supply input. GND - Common ground. Indicator LED - Shows detection state on many Hall modules. Magnet Path - Keep the magnet path aligned with the sensing face. Mounting Area - Secure the module so distance does not drift. Interference Note - Nearby steel or strong magnets can shift trigger behavior. Application Scenarios 1. Arduino Magnetic Switch Turn on an LED when a magnet is detected. const int hallPin = 2; const int ledPin = 13; void setup() { pinMode(hallPin, INPUT); pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, digitalRead(hallPin)); } 2. Wheel Rotation Counter Count pulses from a magnet mounted on a wheel. const int hallPin = 2; volatile unsigned long count = 0; void onPulse() { count++; } void setup() { Serial.begin(115200); pinMode(hallPin, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(hallPin), onPulse, FALLING); } void loop() { Serial.println(count); delay(1000); } 3. MicroPython Door Sensor Read a Hall switch as a contactless door or lid detector. from machine import Pin import time hall = Pin(15, Pin.IN) while True: print("magnet" if hall.value() else "open") time.sleep(0.2) Packing List 1 x HS-S40A All-Pole Hall Magnetic Switch Module FAQ Q: What does this sensor detect?A: It detects nearby magnetic fields. Q: What does all-pole mean?A: It indicates switch behavior that can respond to either magnetic polarity in typical use. Q: Does it measure magnetic field strength?A: No, it is intended as a digital switch sensor. Q: Can I use it as a limit switch?A: Yes, it is useful for contactless limit and home detection. Q: Can it count wheel speed?A: Yes, count pulses from a magnet passing the sensor. Q: What affects trigger distance?A: Magnet strength, orientation, nearby metal, and mounting position. Q: Can I use it with Arduino?A: Yes, connect the signal output to a GPIO input. Q: Why is the signal inverted?A: Some Hall modules use active-low outputs; confirm logic in a bench test.