Hall effect sensor?
bear_phillips
Posts: 14
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
Comments
Are you using a pull up resister? Take a look at http://www.parallax.com/dl/docs/books/edu/wamv2_2.pdf
Page 79 for some interfacing ideas.
Good Luck
Kevin
detect VAR Word
INPUT 0
DO
irdetect = IN0
DEBUG CR, "Hall detector=",DEC detect
PAUSE 400
LOOP
? ? ?
Is there a way to test the sensor with a meter to make sure I didn't hurt it?
thanks
chad
Post edit:· The fine-print says the bevel is the back.· So, pin1 is on the left with the totally flat side facing you.
Post Edited (PJ Allen) : 5/19/2006 7:32:57 PM GMT
chad