In this video I will demonstrate how to find out the pin configuration of transmissive optical sensors. The device shown here has four terminals. On one side there is an LED, usually emitting infrared light and on the opposite side there is a light sensitive transistor. First thing to be done is determining the LED side and at the same time detecting the forward configuration of the light emitting diode. All that's needed is a 5V DC power supply, a multimeter dialed to voltage measurement and a resistor with a value somewhere around 10 kohms. The voltage across the pins is recorded while the optical sensor gets connected to the DC voltage through the serious resistor. We get four of our reactions of the pin configuration by what we can read nearly 5V at 3 of them. And finally one configuration with a clearly lower voltage drop, we get a reading of 0.99 volts. That's the LED side of the device in forward configuration. Next thing to be done is figuring out the polarity of the receiver side. We need a second resistor also having a value of approximately 10 kohms. That serious resistor is connected to the photo transistor as well as to plus 5 volts. First the upper pin of the photo transistor is connected to plus 5 volts, the lower pin is connected to ground. With the multimeter the voltage across the photo transistor is detected. As soon as the LED side gets also connected to the voltage source with forward polarity, the reading on the multimeter should drop clearly. As we can see nothing happens thus the polarity on the receiver side has to be swept. Now the voltage drops to 4.76 volts. We have figured out the correct pin configuration but the LED current is still unknown. With the LED turned on the voltage across the receiver should drop clearly below 0.5 volts. The value of the serious resistor on the LED side is lowered. Until we get a reading of 0.15 volts with a 1 kohms resistor. With the 12 kohms resistor on the receiver side and the 1 kohms resistor on the LED side, the device can be operated at a 5 volts DC power source. Whenever the light is blocked by a piece of a tin can, the voltage across the receiver is rising to nearly 4.8 volts, while it falls back to 0.15 volts if the metal sheet is removed. In an old printer I found several optical sensors having just three terminals. We can identify the configuration of the terminals using the same method as before. Connect the optical sensor to the 5 volts line through the 12 kohms resistor using all combinations possible while recording the voltage across the terminals of the device. Once again there is only one configuration with the LED being forward biased and so a voltage reading clearly below 5 volts. With that the ground pin and the LED side are identified. At the bottom of this device you can clearly see that the ground pin of the LED side is joined with the transistor side. If that path is hidden you can dial your multimeter to continue the measurement to determine what pin of the LED and receiver side are joined. The third terminal is joined with the second pin of the receiver side. The polarity of the receiver side is obvious as demonstrated the joint pins are connected to ground. Now the photo transistor is connected to plus 5 volts through a 12 kohms resistor. While the resistance value at the LED side is lowered until we get a reading of less than 0.5 volts across the receiver. That's a safe configuration for this sensor type at 5 volts supply voltage. Using two transmissive optical sensors you can build a rotary encoder as demonstrated in a previous video. Printers and scanners usually use rotary encoders having two receivers in one housing. Thus they are very likely sources of that type of sensors. The receiver side can be easily distinguished from the LED side since only one LED is used to illuminate both receivers. Thus the two pins are running to the light emitting diode. Usually the sensor unit is soldered on a tiny extra board with just a few tracks on it that are easy to follow from the plug to the sensor. Thus you can guess the pin layout. The pins of the sensor outputs are joined directly with the plug. There are no branches nor are additional components soldered on their path. Ground of LED and receiver are usually joined. The remaining terminal is for the positive supply voltage. It's running directly to the receiver side and to the LED through a serious resistor. The sensor units are usually operated at 5 volts but you should try 3.3 volts first to do it the safe way. As you can see it works perfectly. If you don't get clear signals close to 3.3 volts when blocked and close to 0 volts with the metal sheet removed, try 5 volts. If you need 5 volts in your application at all costs, you can try 5 volts even after a successful test at 3.3 volts. We want that a 2 high voltage will destroy your sensor unit immediately. Well, this sensor passed the second test run. You can see the LED shining right at this type of sensor. If there is no clear view on the tracks of the board, you can record the resistance between LED pins and plug. Connect the common terminal of your multimeter with the pins of the LED during measurements. The red probe runs to the OEM input. The lowest values recorded are the tracks running to the cathode and the anode of the LED. The cathode is usually joined directly with ground of the supply voltage. The reading will be very close to 0 ohms. The minimal reading of the second path is 75 ohms, which is caused by the serious resistor between plus of the supply voltage and anode of the LED. The cables left are those of the sensor outputs. As often a wrong wiring of your sensor unit will destroy that device immediately. So be careful and start testing with 3.3 volts. As you can see, the device passed the check. You might have recognized that this is the sensor unit used in the previous test as well. Another sensor unit I found in a printer is mounted on the rear of a DC motor. The yellow and white pair of cables is very likely joined with the terminals of the motor. Which is obviously right. The remaining 4 cables are tested as done before using a multimeter with the LED pins as reference points. We get a minimal resistance of almost 0 ohms for the purple cable. And 100 ohms for the red cable that is very likely designed to be connected to the positive supply voltage. At 3.3 volts, the sensor unit works fine. The voltage output varies clearly when turning the motor shaft by hand. I take the risk and connect the sensor unit to 5 volts and as you can see, it still works fine. That's how we can use transmissive optical sensors to detect motion, mission accomplished. You can learn more about the work and principles of those sensors and see some examples of use in my videos about rotary encoders and some of my CNC machines. Have a look at my project pages. Thanks for watching and I'll be back.