Standard operating procedure with amateur circuit designers. I though ADC counted only voltage and thus the R4 was going to the GND through R5. Are you sure you calculated correctly the R1 and there is no minimum voltage in the lamp to light? Also have you connected the ground of the board to the ground of the circuit? Maybe an apropriate resistor between the voltage divider and the ADC pin in my design would do the trick. Through collaboration we advance though. Glad though I gave you the idea to turn on and off the power in the lamp in the PWM rate at the high side even though you used the NPN transistor. Since I am amateur though, I can make out that your design uses the invert of PWM pulse (when high the gate is low and when low the gate is high) so PWM+ would turn into PWM- and the opposite. Am I wrong? Neh, forget it. I just saw you used the P FET.