I have an [encoder][2], the circuit is in the image below: [![Datasheet][3]][3] The one that I’m interested in is the PNP one. I want to use a 0-5 V digital voltage, the datasheet says this: 1. Applied voltage: 30 VDC max. 2. Source current: 35 mA max 3. Residual voltage: 0.4 V max. (at source current of 35 mA) By my calculations with basic kirchhoff law I cannot obtain 5 V because the 35 mA max, the pulldown resistor should be very low, because the emitter resistor is very low. Am I missing something, how can I dimension the correct resistor? [![enter image description here][1]][1] This was the calculations that I made, what was wrong I'm very tired: [1]: https://i.sstatic.net/c6P29.jpg [2]: https://files.valinonline.com/userfiles/documents/omron-e6b2-c-series-rotary-encoder-datasheet.pdf [3]: https://i.sstatic.net/x0M82.png