Repository navigation
Hall Effect Sensor
kento-bushey edited this page Apr 3, 2026
·
7 revisions
- Linear Hall effect sensor
- Both sides are magnetically sensitive
- Round side exhibits higher sensitivity than flat side
Link to product: A1302 Linear Hall Effect Sensors Chip
| Pin Position | Wire Color | Function |
|---|---|---|
| Left | Green | Signal |
| Middle | Black | Ground |
| Right | Red | VCC |
/*
----- Power
Flatt side of sensor ----- Ground
----- Output
*/
/*
Round side is more sensitive to magnets (Both sides are sensitive).
*/
const int hallPin = A0;
const int LEDPin = 2;
const int center = 125;
void setup() {
Serial.begin(9600);
pinMode(LEDPin, OUTPUT);
}
void loop() {
int raw = analogRead(hallPin) >> 2;
int val = raw - center;
val = constrain(val * 100 / 125, -100, 100);
Serial.println(val);
if (val>35){
digitalWrite(LEDPin,HIGH);
Serial.print("ON");
}else{digitalWrite(LEDPin,LOW);}
delay(50);
}
Using two-part epoxy resin, fill a 'coffin' with the resin and leave overnight.
Video link of testing https://youtube.com/shorts/SlB_8biHOKQ