Home > Projects > Motor Projects > Arduino Motors and Transistors

Arduino Motors and Transistors

Summary of Arduino Motors and Transistors


This week covers using an Arduino to control a 9V DC motor via an NPN transistor with PWM, and controlling a 180° servo powered from a separate 5V rail via a voltage regulator. It explains motor direction via H-bridges, software filtering for analog inputs, and links to code, schematics, and parts for the project.

Parts used in the Arduino Motors and Transistors Project:

  • Arduino Uno
  • USB Cable
  • Arduino Software
  • Breadboard
  • 0.1uF capacitor
  • 22uF capacitor
  • 5V Regulator
  • 9V Battery Clip
  • NPN Transistor
  • 1k ohm Resistor
  • 1uF Capacitor
  • 1N4004 Diode
  • IR Distance Sensor (Sharp GP2D series referenced)
  • Geared DC Motor
  • Servo Motor (180 degree)
  • Jumper Kit

This week, we’ll finally be using the Arduino to control some motors! First up, we’ll control a standard DC motor running off a 9V battery with the help of an NPN transistor and a PWM (Pulse Width Modulated) signal from the Arduino.

Arduino Motors and Transistors

Attributes
Thanks to Jeremy , for this articles

 

Next, it’s onto 180 degree servo motors, which we will power on an independent 5V rail using a voltage regulator. We’ll control the servo using a PWM signal from the arduino, and I’ll show you how you can turn analog distance readings into precise angles for the servo to turn to!

I mention in the video that you can control DC motor direction using an H-Bridge. If you want to wire that up, take a look through this Wikipedia article, and read through this tutorial.

If you want to learn more about analog input filtering in software, check out this example code.

The Arduino Contest has been extended! So don’t forget to submit your project.

 Arduino Motors and Transistors Schematic

You can download the files associated with this episode here:

 

Major Components in Project
PARTS LIST
1.   Arduino Uno:  http://us.element-14.com/arduino/a000046/arduino-uno -board/dp/13T9285
2.   USB Cable: http://us .element – 14.com/jsp/search/productdetail.jsp?SKU=73H0884
3.   Arduino Software:  http://arduino.cc/en/Main/Software
4.   Breadboard: h ttp://us.element -14.com/jsp/search/productdetail.jsp?SKU=17C6965
5.   .1uF capacitor:  http://us.element-14.com/nichicon/uvz1h0r1mdd1td/capacitor-alum- elec -0- 1%C2%B5f-50v-radial/dp/65R3169
6.   22uF capacitor: http://us.element-14.com/rubycon/50yk22m5x11/capacitor-alum- elect -22uf -50v-radial/dp/38M6812
7.   5V Regulator:  http://us.element-14.com/jsp/search/productdetail.jsp?SKU=89K0746
8.   9V Battery Clip: http://us.element-14.com/bud-industries/hh -3449/battery-clip- 9v -wire -lead/dp/34M2183
9.   NPN Transistor: http://us.element-14.com/jsp/search/productdetail.jsp?SKU=18C9246
10.  1k ohm Resistor:  http://us.element-14.com/multicomp/mcf -0 -25w -1k/resistor-carbon – film -1kohm -250mw/dp/38K0327
11.  1uF Capacitor: http://us.element-14.com/vishay -bc -components/ k105z205ve5th5/capacitor -ceramic-1uf-25v5v-radial/dp/95C0982
12.  1N4004 Diode: http://us.element-14.com/vishay -general- semiconductor/1 n4004 – e3- 54/standard-diode-1a -400v -do-204al/dp/78K2126
13.  IR Distance Sensor: http://us.element- 14.com/sharp/gp20a41sk0f/dp/14N9318
14.  Geared DC Motor:  http://solarbotics.com/products/gm8/
15.  Servo Motor:  http://www.sparkfun.com/products/9064
16.  Jumper Kit:   http://us.element-14.com/3m/923351-i/pcb-accessories/dp/65F2290 

For more detail: Arduino Motors and Transistors

Quick Solutions to Questions related to Arduino Motors and Transistors Project:

  • How do you control a 9V DC motor with an Arduino?
    Use an NPN transistor as a switch and send a PWM signal from the Arduino while powering the motor from a 9V battery.
  • Can you power a servo from the Arduino 5V pin?
    The project powers the servo on an independent 5V rail using a 5V regulator rather than relying on the Arduino 5V pin.
  • Does the project show how to control servo position?
    Yes, the servo is controlled with a PWM signal from the Arduino and analog distance readings can be converted into angles for the servo.
  • What component protects against back EMF from the DC motor?
    A 1N4004 diode is used with the DC motor to protect against back EMF.
  • How is motor direction suggested to be controlled?
    The article mentions using an H-Bridge to control DC motor direction and links to resources about it.
  • Is analog input filtering discussed?
    Yes, the article references example code for learning more about analog input filtering in software.
  • What power source is used for the DC motor?
    The DC motor is powered by a 9V battery connected via a 9V battery clip.
  • Which capacitor values are used in the project?
    The parts list includes 0.1uF, 1uF, and 22uF capacitors.
  • Which resistor value is used for the transistor base?
    A 1k ohm resistor is listed in the parts for the project, typically used for the transistor base.
  • Where can I find the schematics and code for this episode?
    The article provides download links for Episode 05 Arduino Programs, Parts List, and Schematics.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top