Puzzled over PWM with NPN transistor

It's worth noting that PWM outputs don't show up well (or as expected) on voltage meters unless you first smooth the square wave signal into a steady(ish) voltage.