Interfacing an optical encoder

Jan 14, 2015



#1902 Jan 14, 2015

Background:I bought some motors on eBay. . They have built-in optical encoders where a spinning disk with slots interrupts an a light beam. . .The disk fits in the channel of an integrated LED/Phototransisor device..

Here is a link to something like what I have slot_sensor.html.

But this particular sensor is unmarked.. I don't know who made it or even which end is the LED and with is the transistor. .(I'm only assuming there is a transistor.) . The motor's PCB runs the sensor leads out to a cable.. That did give me a good clue because they common connected all the grounds from two sensors.

Problem:I am able to get a 1 volt P-P square wave out of these sensors but .I need interface this to TTL level logic (a 74LS14) . .This SHOULD be easy.. I connected an opamp and tried some other ideas, It's not working.. Perhaps the phototransistor is not fully turning on?. I should be seeing close to zero volts at the bottom of the square wave but I get about 4.5V

I get a nice clean square wave when I used the 10K load resisters.. The two sensors are in perfect quarter. . Seems it is fragile.. Whatever I try (including adding the opamp turns it into some kind of rounded or triangle wave.

Any suggestions.. I attached a link to schematic and waveforms.. What to connect at point A that will drive TTL.

Also this will run in a noisy environment right between two PWM controlled 12V DC motors and I only have +5V and ground available for this. .

Notice the square wave.. It is only pulled down by about 0.6V .and what's up with the triangle "blips".optoswitch.jpg

Here is a photo of the encoder.. As you see there are two sensors you can determine the speed and direction of the motor.. These are very good quality made in Japan with an 80:1 reduction gearbox.encoder end--

Chris AlbertsonRedondo Beach, California

This Site's Privacy Policy
Google's privacy policies