I'm trying to switch (just on/off) a 3.7V motor (coil resistance 2.2 ohm) and a 6V motor (coil resistance 8 ohm) with an Arduino Mini. I have trouble finding a universal way to do so.

What I know so far:

  1. there has to be a fly-back diode (D1 in the schematic diagram.)

  2. There are 4 possibilities for the switch.

    a) relay (simplest, Arduino Uno with 12V pump: transistor or optocoupler+12V relay?)

    b) NPN transtor https://electronicsclub.info/transistorcircuits.htm

    c) low gate voltage MOSFET How to drive low impedance load with arduino and transistor

    d) optocoupler (see the relay link)

  3. A low side switch is better than a high side switch. High side switch and Low side switch

  4. All grounds have to be connected together (unless using an optocoupler) Does signal ground have to be connected to actual ground?

I would like to keep the component count and price to a minimum. Relays are big and expensive so I hoped a transistor would do.


  1. What components I can safely remove from the circuit?
  2. What is the most important thing to get right?

I understand I need R1 to prevent a floating pin What does pulldown resistor from Arduino's output pin to ground do? Is it necessary?

I'm trying different motors to see which one works best.

Edit 2019:

In the end (after reading replies) have built the following circuit:

Transistor switch schema

The moral is points 3 and 4 are extremely important.

Edit 2022:

A new answer has appeared and makes good points!

  • 2
    \$\begingroup\$ I'd say this schematic is an example of the most convoluted way to draw it. If drawing it the logical left-to-right way, the errors in the design would have been more obvious, Can you possible remove that abomination, and replace it with the schematic you ended up using, to prevent harm to the mind of innocent aspiring electronic tinkerers :;-) \$\endgroup\$
    – Lenne
    Commented May 7, 2020 at 7:17
  • \$\begingroup\$ I think it the final schematic was something like this schematic \$\endgroup\$
    – Richard
    Commented May 18, 2020 at 11:35

2 Answers 2


No room for a comment. I am taking a SWAG as a lot of the needed information is missing.

This should eventually get you to a working solution.

I hope you have a big box of 1N4148s. With your current configuration and voltage you will be blowing them regularly. With an inductor what goes in comes out.

You are losing about about a volt through the transistor and it will get hot. Measure your terminal voltage of the 9V battery with the motor on.

After you take that measurement you will find it is not big enough to drive a motor.

R1 should go between GPIO pin 10 and ground especially if you use a MOSFET. In your current configuration it also acts as a voltage divider.

How are you powering the microcontroler? How are you getting the voltages you mention for the motors or am I assuming correctly they are driven from the 9V battery? I would recommend using an avalanche rated logic level N-channel MOSFET.

  • \$\begingroup\$ You are right, the transistor got hot and burned down occasionally. I think I powered the arduino from a different source as when the motor started the arduino lost power. I've abandoned the project few years back (and not done any other projects) so can't really be sure. \$\endgroup\$
    – Richard
    Commented Nov 6, 2022 at 11:08

A circuit is needed for current to flow into Q5 base and return. The return path is missing.

To fix this Connect Q5 emitter to arduino GND.

R1 is not needed, but does no harm.

  • \$\begingroup\$ thank you for the suggestion. I tried connecting Q5 emitter to arduino GND and indeed it opened the transistor but the current flowing to the motor was not enough to start it. My uneducated guess is that most of the current from the motor power supply was flowing to arduino GND and hence not through the motor. If this is right I should have connected the arduino GND to power supply - \$\endgroup\$
    – Richard
    Commented Mar 27, 2019 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.