Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

Make: Projects

Control a 5V Motor with the Arduino

This guide will introduce motor control using the Arduino.

Control a 5V Motor with the Arduino

All required parts are included in the Maker Shed’s Ultimate Microcontroller Pack.

Steps

Step #1:

PrevNext
Control a 5V Motor with the ArduinoControl a 5V Motor with the ArduinoControl a 5V Motor with the ArduinoControl a 5V Motor with the Arduino
  • Make sure you have all the required parts before starting. Everything you need is included in the Ultimate Microcontroller Pack.
  • First, install the transistor. With the flat part of the transistor facing away from you, the leftmost leg should be inserted into E20 on the breadboard, followed by the other two legs in E21 and E22.
  • Next, install the diode. Polarity matters here, so make sure the side with the white stripe is in C16 and the other side is in C20.
  • And now, the resistor. Plug it into pins C21 and C26 (polarity doesn't matter here).

Step #2:

PrevNext
Control a 5V Motor with the ArduinoControl a 5V Motor with the ArduinoControl a 5V Motor with the ArduinoControl a 5V Motor with the Arduino
  • We need to power the circuit with 5V from the Arduino. Use a jumper here, and plug into pin E16 on the breadboard.
  • And of course we need ground as well - use another jumper to go from the Arduino GND pin to A22 on the breadboard.
  • To control the speed of the motor through the transistor, use another jumper wire to go from Digital Pin 3 on the Arduin to pin A26 on the breadboard.

Step #3:

PrevNext
Control a 5V Motor with the Arduino
  • Finally, it's time for the motor! Plug the power (red) wire into A16 and the ground (blue) into A20.
  • That's it, you're done! Head over to GitHub to download (or copy-paste) the sample code, and have fun!
blog comments powered by Disqus

Featured Products from the MakerShed

Follow

Get every new post delivered to your Inbox.

Join 25,745 other followers