Quadrature optical interrupt pinout

Hello all.

I've been trying to interface this optical interrupt that I have salvaged from a printer

I've checked the pins on diode test across the bottom two pins (at the sensor not the plug) where I expect the diode to be and don't get anything. I have a few of the same printer and I've got the same result for all.
Testing it powered up there's ~1.5v across where I think the diode is and 3.2V on the direction outputs. I've marked the 3V and 0V from this.
Wiring it up to my sketch I get nothing. I have tried to see the IR diode with my phone camera also.
I've proved the sketch with this photo interrupt .



It has the same pins on the sensor but 4 cables instead of 6 as the 0V and 3V are combined on the board with current limiting resistor and cap.

I will upload the sketch when I find it again.

Any thoughts why the diode doesn't show up when tested or the possible pinouts?

Thanks

There is nothing there to work with, just pictures of green and brown circuit boards with black blobs and wires. Consider reverse engineering the sensor and generating a schematic, by then it should become obvious. You can purchase them for less then a buck and get all the information and a lot less greaf. A lot more information is needed such as component part numbers, assembly part numbers and who made it?

Hi all.

Follow up for anyone in the same position.

I couldn't get the diode to show up with diode test function, my camera or in my test sketch with suspected pinouts

I have quite a few of these I'd like to use so I really wanted to figure this out.

In a last ditch effort I checked it in pitch black and caught a red glow.
I tested the pins of one that was turned on and found the polarity and voltages.

The pin outs are the same as most other 6 pin optical interrupters except its 1.5V at the IR diode:

After checking a few datasheets I've put an 100ohm @ 1.5V for the diode and everything is working now!

Sketch I've been using to test the encoder below
Encoder test


#define encoderDT 2 
#define encoderCLK 3 // Interrupt
#define encoderSW 4

int previousDT;
int previousCLK;
int previousSW;

void setup()
{
Serial.begin(9600);
pinMode(encoderDT, INPUT_PULLUP);
pinMode(encoderCLK, INPUT_PULLUP);
pinMode(encoderSW, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(encoderCLK), doEncoder, CHANGE);
previousDT = digitalRead(encoderDT);
previousCLK = digitalRead(encoderCLK);
previousSW = digitalRead(encoderSW);
}

int encoderPos = 0;
int previousEncoderPos = 0;

void loop()
{
int actualSW = digitalRead(encoderSW); // Without debouncing

if (actualSW != previousSW)
{
Serial.print("SW= ");
Serial.println(actualSW);
previousSW = actualSW;
}

if(encoderPos > previousEncoderPos)
{
Serial.print(actualSW);
Serial.print(" ");
Serial.print(encoderPos);
Serial.println(" CW");
}

if(encoderPos < previousEncoderPos)
{
Serial.print(actualSW);
Serial.print(" ");
Serial.print(encoderPos);
Serial.println(" CCW");
}

previousEncoderPos = encoderPos;

// delay(1000);
delay(40);
}

void doEncoder()
{
int actualCLK = digitalRead(encoderCLK);
int actualEncoderDT = digitalRead(encoderDT);

if ((actualCLK == 1) and (previousCLK == 0))
{
if (actualEncoderDT == 1)
encoderPos--;
else
encoderPos++;
}

if ((actualCLK == 0) and (previousCLK == 1))
{
if (actualEncoderDT == 1)
encoderPos++;
else
encoderPos--;
}

previousCLK = actualCLK;
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.