Hi kal,
Hope you are well. I see you are working with photo detectors now. Well the good news is that they are quite simple to understand and work with. I am surprised that you have managed to blow some up because, under normal circumstances, that is practically impossible. The problem, I expect is that you have been placing a voltages on parts of the photo detector which has caused a large current to flow and melted the semiconductor material. In general always apply a voltage via a series resistor to limit the current. Incidentally that is a fairly good rule for many situations when you are not certain about what is going on.
Above is an extract from the Omeron EE-SX198 slot opto detector data sheet where I have physically inverted the transmitter LED in the schematic to make the operation clearer; the connections etc are still the same.
How to read a data sheet
One of the most daunting aspects in electronics is understanding component data sheets, but you are lucky; this one is simple, particularly well-written, and clear. This is not the position with certain data sheets, but in the main they are very good. The manufacturer is always keen to get his products specified in a design because that could mean sales of millions if a main line consumer product takes off, so he tries to incorporate all the data a design engineer would need. That is why data sheets are often so complex. Incidentally design engineers are never short of free samples, data, and support.
A data sheet covers various aspects of the components characteristics, physical, and electrical being the broad areas. It also covers Absolute Maximum Ratings and Electrical (and Optical in this case) Characteristics. The former are the limits: temperature, voltage, current, etc, that the device can be exposed to without damage. The latter is the performance of the component when configured as specified on the data sheet.
Photo Detector Operation
Transmissive slot photo detectors, have a light source shining from one side of the slot and a opto detector at the other side. Under normal circumstances, with nothing in the slot, light shines from the transmitter into the receiver and produces a signal at the receiver. But if something opaque is placed in the slot, light cannot reach the receiver so the signal from the receiver stops.
The transmitter is nothing more than a Light Emitting Diode (LED) and the receiver is a light sensitive transistor. Note that you may not be able to see any light from the LED because the light frequency is liable to be outside human eye capabilities, typically infrared, like a TV controller. In this application there are only two bits of information you need to know about the LED:
(1) Forward voltage (VF)
(2) Forward Current (IF)
The opto receiver is a fairly normal bipolar junction transistor (BJT) which has a window built into it. To conduct, normal BJTs require base current, but they will also conduct if light impinges on their junctions. That is what is done here. Incidentally you can convert some BJTs into opto sensors by removing the casing. There are, once again, only two characteristics you need from the data sheet for the opto sensor transistor:
(1) Current flow when light impinges on the opto transistor
(2) Voltage the opto transistor will stand
You can simply forget all the other stuff for your present work
Design
Assume you have a 5V supply line.
To operate the transmitter LED the way that the manufacturer recommends on the data sheet, you need:
(1) IF= 30mA
(2) At an IF of 30ma the VF is 1.2V to 1.4V
Taking the average VF as 1.3V, you can calculate what resistor you need between the 5V supply line and the anode of the transmitting LED by:
5V - 1.3V = 3.7V. To lose 3.7V at 30mA, R = 3.7V/30mA = 123.33 Ohms. A standard 120 Ohm resistor would be fine.
With 5V on the collector of the opto transistor the collector current would be between 500uA and 18mA depending on the particular opto sensor. Note that, in general, you must never connect a voltage to a transistor without some form of current limiting, normally a series resistor. A simple circuit could translate the collector current into a signal suitable for most applications: relay, TTL, CMOS, etc