Electronic – arduino – DC motor control using BJT

arduinobjtdc motormicrocontrollermotor controller

Trying to control the speed of a DC Motor (MFA 918D100112/1 found on https://www.rapidonline.com/mfa-918d100112-1-gearbox-motor-100-1-4mm-shaft-12-24v-37-1224) using PWM pin on Arduino connected to the base of an npn BJT (2N3904 https://www.onsemi.com/pub/Collateral/2N3903-D.PDF). This is the proposed circuit:
enter image description here

I am not sure of the resistor values to choose. As I understood correctly R2 is used as a weak pull down resistor for when the base is floating, and R1 is used to ensure a Vbe is 0.7 V for saturation when the Arduino pin supplies 5 V. R3 is used as a current limiting resistor in order not to fry the transistor.

How do I choose the right values for the resistors? I hope I have understood the theory correctly.

Best Answer

Some things you are going to have to resolve.

  1. The motor you linked runs on 12 to 24V. Not the 3V you show in your proposed circuit.
  2. The 2N3904 NPN transistor is unsuitable for this application. They are typically good for up to ~200mA whilst the motor specs a load current of 300mA and that will grow as more load is placed on the motor.
  3. A resistor in series with the motor is not really going to work. You need to let the motor windings limit the current and then pick a transistor (hopefully a MOSFET) that can handle the current.
  4. When driving an inductive load with active switching you surely need a flyback diode across the motor or else the inductive kick at the turn off time will kill your transistor.
  5. Use a MOSFET and you can limit the amount amount of current load on the Arduino output.

Ok @elecstud ... ball is in your court now.