As far as I know, TM4C123 LaunchPad safely accepts voltages values up to 3.3V . I got a CNY70 reflective optical sensor and want to connect it to one of the analog input ports safely as in the attachment. (each of +5V comes from 5V AC to DC adapter)
The main problem is that I don't understand much from the CNY70's datasheet. (I couldn't find anything about the ON state resistance of the transistor, which could make things much easier for me)
Could you please explain what calculations should I do, or which figures should I check in the data sheet in order to calculate the X resistance value for safe operation.
P.S: Please keep in mind that, I'm quite a newbie in electronics
The transistor does not behave like a resistor. It's more like a current source until Vce drops to below a volt or so. The relevant curves from the datasheet (specified with a known reflectance) are below:
You have about 20mA going through the LED (a bit much for my liking), so the typical CTR is about 5% (Figure 7). That means that a typical unit will pass about 1mA through the transistor. If your resistor X is high enough (more than 4K or so, typically) then the CTR will be much lower (Figure 8). The transistor will bottom out at 100mV or so. The voltage will be If * CTR/100 * Rx.
If your application does not have the 0.3mm spacing then Figure 11 comes into play- so the voltage will be If * CTR/100 * Rx * Icrel