Driving a 4.5V motor with PWM from an Arduino

arduinodcmotortransistors

This is a basic question but I would appreciate help. I have:

  1. An Arduino
  2. A 4.5V DC motor
  3. Various transistors, like BC337, 2N7000, 2N2222A

What I'm trying to do is very simple: control the motor with the Arduino. I want to control it with PWM, so I can change the speed.

This is what I tried:

Connect the motor between my 5V power supply (a 500 watt PC power supply) and transistor collector (with protection diode); connect PWM pin of the Arduino to the transistor base, with a 1Kohm resistor; connect the transistor emitter to ground.

The motor doesn't spin, it just makes a little noise! If I connect the motor direct to the power supply it spins.

What might I be doing wrong?

Best Answer

You might need a bigger transistor. For large motors google "darlington" to get more current gain. Also scope the output of your arduino to see if it really works. No scope: add a second 1kohm resistor feeding a capacitor (few uF) to the output of the arduino and measure with a DMM. At 100% dutycycle you should get close to supply voltage of the chip, at 50% half, etc. Check chip hardware and/or code to make sure you don't have inverted logic: ex 80% duty cycle is not 80% LOW and 20% HI as if driving a PNP transistor.

Related Topic