The PWM frequency is about 10 kHz and does not make a noise in the motor. The 5 K Ohm potentiometer is connected to ADC input channel 0 and is converted to 1024 (10 bit) value, this value is applied to the PWM control and produces very smooth speed control. The HEXFET type IRL1004 has extremely low on resistance (0.009 Ohm) and requires only logic level drive, in this application it does not get warm even when controlling 1 Amp motor current. according the IRL1004 data sheet it can handle much higher motor current.
DC motor speed control using PWM: [Link]