I’m going to be setting up something to control a small motor. I want to make sure I have the right idea for controlling the motor via PWM. I have attached pictures of the circuit and breadboard configuration I’m planning on using. Does this look correct?
@pmd5700, what’s the purpose of R1? How are you powering the Photon? You may want to consider adding a flyback diode across the motor as well.
Please forgive me if any of my terminology is incorrect - I’m very new at this.
I believe R1 is to eliminate any voltage going to the MOSTFET when the PWM is set to 0. I’ve seen a few sample circuits that use it. However, I have realized that I have it shown wrong. I have updated the pictures below. The photon will be powered via the USB connection on the board.
I was thinking about adding a diode. How would I go about selecting one? Would something like this work? The motor is 12V @ ~250mA.
@pmd5700, now that makes more sense! Here is a similar configuration but with a bipolar transistor. You could use a 1N4001 diode as the 1N4007 is overkill in terms of voltage rating.
@peekay123 Thank you! Did you mean to attached something or link something?