Running a dc motor with a transistor and arduino uno

Hi guys,

wanna mention im new to the forum, so if i may make misstakes pardon them please.
Ive done some research on this topic and done a schematic of how it should look like for just testing.


The DC motor im using is out of an old cordless bosch drill that was just laying around and after testing the windings the motor looks fine.
The motor is a up to 12v voltage controlled motor that can pull up to 2a at 9.6v with no load.
Heres the motor: https://www.botnroll.com/en/dc-motor/3858-dc-motor-12v-4-5kg-cm-11000rpm-6-24vdc-rs-550.html

The transistor in this blog https://forum.arduino.cc/t/choosing-the-right-transistor-for-12v-dc-motor/1064119 mentions a IRLZ44 NPN transistor. The transistor looks like it should handle the motor pretty easy.

Id like to ask about the capacitor and diode used to smooth out ripple and eliminate backcurrent coming back from the motor.
What value should i use for the cap? Is 100microF enough?
I also like some suggestions for diodes. I currently have these 2 at home:

The 2nd looks underpowered for this situation, the first one "could" technically work but for how long?

Help is appreciated and if there are mistakes ill try to correct them.

Thanks in advance :smile:

I should also mention, external power supply will a labbench powersupply for the time beeing, but i wanna look into alternatives. Ive seen some yt vids on people powering stepper motors with USB-pw. I also have several powersupplys from laptops and other laying around, aswell as a unused pc power supply that could provide enough juice to power everything. Suggestions are appreciated again :slight_smile: .

Ive wanted to build a cnc for myself and just want to lay the foundation, even if it is a bit wonky, so tips on how to convert the speed of the motor into torque (like planetary gears, etc.) would be nice too.

Hi, @greifer500
Welcome to the forum.

Thanks for the info and laying it out to make it easy to read. :+1:

Do you have any code written?
The transistor is an N-CH MOSFET which is ideal for controlling motors like yours.

I haven't looked at any of the specs you have posted, I have to go to an Amateur Radio working bee.

But others will appear to help.

Tom.... :smiley: :+1: :coffee: :australia:

  • Note: Charging current thru C1 could destroy Q1 when Q1 turns ON.
1 Like

The connection of the base resistor to A0 is wrong.

I assume this is because you think an analogWrite function uses an analogue pin, it does not.

The base of this transistor should be connected to any PWM capable pin, and your software changed accordingly. PWM capable pins as shown tith a ~ next to its name.

As Tom said the IRLZ44 is not a NPN transistor, it is a FET. So it needs more drive (voltage) than an Arduino pin can supply, so it needs extra components to boost the voltage. See:-

However if you search for a "Logic level FET" that will work with the signals that an Arduino can supply.

Are you just turning the motor on and off or are you going to try to control the motor speed?

Ill probably want to control the motor speed, but for now i just want to get parts to get it at least to a working state

Should i change the position of c1 to eliminate current or how can i prevent that?

Remove the capacitor.
The FR302 diode is fine.
Make R2 680 ohms
Connect R2 to one of the PWM pins, number 10 for example.

Then write some code

Ive done the schematic yesterday to show how ive connected it. The old pcb used in the drill uses a 555 timer and a variable resistance to create a pwm signal.
Thanks anyway, probably would have forgotten it and wasted some time figuring out why it wont work.

Ive redone the schematic:

Ive looked into the datasheet and found the Gate Threshhold voltage to be 1V-2V:

The arduino should be able to supply that with a resistor in series. Or am i missunderstanding that?

Yes but the IRLZ44N is fine.
You still need to remove the capacitor as I said.
Also R1 should be 680
See post #9

Ive just read it, thank you :slight_smile:

Do you need help with the code?

I dont need any help with the code, im more knowledgeable in that field :smile: . Thanks

New Schematic:

Have fun!

1 Like

Will do ^^

I just seen the new schematic.
Connect the POT to 5V not 3.3V

Could that not be a problem because logic level of IO in the arduino is 3.3V? If the potentimeter has a 0ohm position, that could be a problem. Should i just use one with more resistance at the low end?

Your schematic shows Uno R3 and the I/O is 5V not 3.3V for an Uno