JeremyBlum.com

v3.1

Tutorial 5 for Arduino: Motors and Transistors

| 280 Comments

This tutorial was featured on the official Arduino blog on 3/9/2011

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. 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.


You can download the files associated with this episode here:

GNU GPL License Distributed under the GNU General Public (Open-Source) License.
Please Attribute and Share-Alike.


280 Comments

  1. I have to make a lift with college project and have a big problem of making the lift moving slowly
    i have used a toy car motor
    using 3 volt battery
    swiches to do forward and reverse

    still motor goes up very fast and come down very quick , how to slow down

    pls give a ideas , no time to wait need to send project by friday 19 september 210 14 thanks

    • use stepper motor for more accurate movements. it has high torque and bi-directional control.
      u can use 12v for car motors. use L293D for both speed and direction control.

Leave a Reply

Required fields are marked *.