homemade encoder issues

we are having some issues while trying to make a single channel encoder using an NTE3100 <http://www.nteinc.com/specs/3100to3199/pdf/nte3100.pdf>. We think we have biased the 3100 thusly (we have tried with and without the 1 meg resistor)… <http://home.pacifier.com/~mcginty/nte3100.htm>

                 |+5VDC     |+5VDC
                 \          \  Both Resistors 
                 /          /  1 K ohm
                 \          \  Brown, Black, Red
                 /          /
                 |          |
                 \|        ---
                  |      &lt;-\ /
                 /|       &lt;-v
                 |         ---
                 |          |

Signal out----±-----+ ±—+
\ |
/ 1 Mega Ohm |
\ Brown, Black |
/ Green |
| |
___ ___
_ _

We get 4.95 V when high (unblocked), but only drop a volt to about 3.8 V, so we never go low.

We are hooked to a “digital sidecar” and cRio. <http://www.usfirst.org/sites/default/files/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2012_Assets/Digital%20Sidecar.pdf> <http://www.ni.com/compactrio/>

Any help would be greatly appreciated.

Thanks, Chuck.

I’m thinking that your grounding resistor of 1M is too high, and so the phototransistor’s leakage current is raising your Voff very high (3.8V). Try 10k or 100k on the bottom and see what happens.

According to the datasheet, the NTE3100 has an NPN phototransistor. If that’s the case, Brian McGinty has connected it very oddly.

Try connecting the “bottom” of the detector to ground (the “-” pin on a Digital Sidecar’s DIO connector) and use the “top” of the detector for the output (the “SIG” pin). The Digital Sidecar’s internal pullup resistor will give you a false reading when the sensor is illuminated, and a true reading when the LED is blocked.