bear_phillips
05-19-2006, 06:37 AM
I am trying to get a Hall effect sensor to work with my BS2. The datasheet for the sensor is at
http://www.datasheet4u.com/html/O/H/0/OH090U_ETC.pdf.html
I connected pin 1 to vdd, pin 2 to vss and pin 3 to Pin 0 of the BS2. My code is:
detect VAR Word
INPUT 0
DO
irdetect = IN0
DEBUG CR, "Hall detector=",DEC detect
PAUSE 400
LOOP
If I read the datasheet correctly the pin should go high when the sensor is near the south pole of a magnet, but that doesn't seem to be working.
Any thoughts I what I may be doing wrong? Do I have the wrong type of hall effect sensor? I just want to be able to detect when the magnet is near the sensor. Like to detect when a door opens.
thanks
chad
http://www.datasheet4u.com/html/O/H/0/OH090U_ETC.pdf.html
I connected pin 1 to vdd, pin 2 to vss and pin 3 to Pin 0 of the BS2. My code is:
detect VAR Word
INPUT 0
DO
irdetect = IN0
DEBUG CR, "Hall detector=",DEC detect
PAUSE 400
LOOP
If I read the datasheet correctly the pin should go high when the sensor is near the south pole of a magnet, but that doesn't seem to be working.
Any thoughts I what I may be doing wrong? Do I have the wrong type of hall effect sensor? I just want to be able to detect when the magnet is near the sensor. Like to detect when a door opens.
thanks
chad