this circuit is simply a switch. when the sensor senses the ir radiations it sends a current to the base of microcontroller, thus turning the transistor on and hence
their is zero volts at the ‘o/p to 8051’ pin. similarly when their is no current coming from the sensor then the transistor is off and the o/p is high at 5v.
The 10k resistor is choosen in such a way to keep the transistor in the saturation region if a current is applied at the base i-e Vce<0.7v.
because for transistor to be operated as a switch, it should be operated in cutoff and saturation region.
The other resistor is used for proper biasing of transistor.