Skip to main content
1 of 4

connection for hall sensor 4 pin and arduino nano

I'm not electronics background so I don't know what should be the connections. My Hall sensor has 4 pins(AO, GND, +, DO)

So, I have connected hall sensor pins to Arduino nano pins in this order(connection)

AO(Sensor) <-> AO(Arduino)
DO(Sensor) <-> DO(Arduino)
+(Sensor) <-> 5V(Arduino)
GND(Sensor) <-> GND (Arduino)

How do I write code? So that if the magnet passes close to the sensor. Arduino should get the output & I'll blink the led on Arduino