How to use the S.S.I.R. Sensor?
zhiye
Posts: 2
I am making a simple system with the Parallax S.S.I.R. sensor, and I have been trying to figure out how it works. First I used PULSIN to read the pulse width of the signal from this IR sensor, but the data was not stable at all, even when there's nothing blocking the sensor, the pulse width will still change dramatically. And then I tried to compute the ratio of 1s and 0s of in each second, but the ratio doesn't change much even though I move my hands closer and further in front of the sensor. So have anybody used this IR sensor before? How does it work?
This kind of sensor is called Stephen Swanson Infrared Sensor from Parallax. I am not sure if they still sell this, but I really need some help. Thanks!
Zhiye
This kind of sensor is called Stephen Swanson Infrared Sensor from Parallax. I am not sure if they still sell this, but I really need some help. Thanks!
Zhiye
Comments
There is a piece of paper that came with each of these sensors, but I didn't get enough information from it. On this document, the sample code for this sensor is as follow:
DIR0 = 1
Holdbit VAR BIT
Start:
Freqout 0, 1, 38500
Holdbit = in0
DEBUG 1, "sensor = ", DEC Holdbit, CR
GOTO Start
The code above sends a 1ms burst to the sensor and get a 1bit output immediately, which still confuses me a lot about how this sensor really works.
Post Edited (Steve Joblin) : 12/14/2007 10:12:07 PM GMT
The code you're showing doesn't seem to turn the "zero" pin into an input -- unless the "IN0" name does that for you. Also, I find a 10Kohm 'pull-up' resistor insures there's a nice solid 'one' to read, when the detector isn't "pulling" the signal down.