Hall Sensor

These are the hall effect sensor i have tested out. 20140918_235432 Meanwhile, I am playing with my new nano board. But the magnet I have here is not strong enough. It need to be very close to the sensor (like 1cm). Gotto order new rare earth magnet from dx.com then. Simple code to output the analog in reading, and if less then the threshold, light the LED.   This sensor in red board is a linear hall effect sensor. 20140918_235205 Next, I try on the black board one. According to dx.com comment, this is a digital output and 10k resister is required between the 5v & signal pin. 20140919_144354 After placing the resistor in between, i getting reading of 1023 (off magnet) & 15 (with magnet). It is analog but the value only 2 state, so like the comment said, it did behave like digital. I can then use a map function to turn the value into either 0 or 1. Next, I tried another sensor that looks exactly the same like above, except the packaging label with “analog hall sensor”. with the same circuit (with resistor removed) and code, this is what i observed:
  • without magnet, ouput reading at 522
  • with magnet place in direction of the top of board, output reading range between 522- 770
  • with magnet place in direction of the bottom of board, output reading range between 522-413
Interesting! seems like it can tell at which direction the magnet is coming from.