Hi,
You can use a MOSFET like IanP showed, or you can use a BJT, but for MOSFET, a logic-level MOSFET, eg, IRL3303, should be used if you drive the MOSFET directly from the microcontroller. If you use a power MOSFET, eg IRF3205 you should use a MOSFET gate driver, like TC428, IR2110, etc.
Hi,
You have some frequency, eg, 1kHz and you have a variable duty cycle (on time). You have time period of 1ms. So 50% duty cycle (50% on time) = 500us = 50% motor speed.
You can have a variable resistor or switches that set your speed accordingly, by changing the duty cycle.
The output PWM from the PIC goes to a driver and then MOSFET which controls the motor.
MOSFET is the motor driver ..
MOSFET’s gate is directly driven by your PIC, and that’s how you implement pulse-width-modulation ..
Just look at the drawing: mosfet and motor2.gif