I am trying to use an infrared sensor as a switch to turn on PWM pulses generated by a PIC. I don't have much experience working with PNP transistors. The attached image shows my idea, will that work?