Arduino limit PWM voltage
The arduino has an analogWrite(pin, level) function that takes care of the details of the on-chip PWM hardware. Programmatically, you just give analogWrite the pin number you're writing to, and a value 0 to 255 to control the duty cycle. If the hardware is such that the transistor saturates at one logic level from the PWM pin, and cuts off at the other, it should deliver proper PWM controlled power to your load. Be aware that the RMS value of PWM goes by the square of the duty cycle; 70% on 30% off equates to half power.