Build Your Robot Without Arduino Shield R3, and the DC or Stepper Motors are not Controlled

Among the tons of components that robots require, a motor shield designed to control DC or stepper motors plays a big role in robotics and for anyone who wants to have a full control over the speed and the direction of the electric motors positioned inside the robot.

Arduino and its products are very popular among hackers, makers, or engineers, and a motor shield such as R3 is able to extend the functionality of Arduino boards by adding additional hardware.

With Arduino Motor Shield R3 you can drive two DC motors or one stepper motor.

Choosing the wrong motor shield can greatly affect the design of the robot in a negative way, and that’s why in this post, I will explain a series of features, techniques, tutorials, and explore a few examples so that you can start the physical work with the Arduino Shield R3 and find inspiration for your DIY robot.

A few things to know before drive your motors with R3 shield

  • the Arduino R3 should be powered with an external power supply;
  • the motor shield is designed to control the speed and direction of each motor independently;
  • the shield can be used to measure the current absorption of each motor separately;
  • the R3 is engineered to drive two DC motors or one stepper motor with your Arduino board;

Getting Started with Motor Shield R3

The Arduino as a smart card microcontroller has zero value without additional components and the power to control these. Like any of the Arduino boards, Arduino shields are available worldwide at an affordable price. On the market are available several hundred Arduino shields including here shields for wireless communication, navigation, or the shields to control electric motors.

R3 Specifications

  • Motor controller: L298P;
  • Operating voltage: 5V to 12V;
  • External power supply: 2A/channel or 4A max. ;
  • Curent sensing: 1.65V/A;
  • Functions: run, stop, and break;

 

Buy Arduino Motor Shield R3 from here

As a motor driver board, the R3 is a motor shield based on the L298P dual full bridge motor driver and it’s engineered to drive small relays, solenoids, DC and stepping motors with features that not exceed 12V and up to 2A.

With simple words, yes, it’s possible to drive a motor with Arduino and without a motor shield. The electric motor must meet several criteria including here a small magnitude of the current (somewhere less than 500 milliamps), and the electric motor should be a small DC motor.

Installation
The motor shield R3 is designed to be mounted directly on the top of the Arduino microcontroller and connected to the Arduino via pin headers. The motor shield R3 is not compatible with all Arduino boards. Its pins are aligned to work only with Arduino Uno R3.

To make it work with older versions of the Arduino boards, you have to trim few pins off the motor shield, which is not recommended.

R3 Features
With 2 channels that lets you to control two DC motors or only one stepper motor, the motor shield has additional 6 headers for inputs, outputs, and communication lines.

The motor shield R3 includes additional logic features that make easier to drive DC motors.

Connected to Arduino, you can refer pins of the shield to specify the motor spin direction, to set the speed of the motor, to start or stop the motor, or to monitor the current absorption of each motor separately.

How the pins of the shield are divided by the channel:
Function

  • Channel A
  • Channel B

Direction

  • Digital 12
  • Digital 13

Speed

  • Digital 3
  • Digital 11

Break

  • Digital 9
  • Digital 8

Current Sensing

  • Analog 0
  • Analog 1

Programming
Thanks to a very active community of hackers and hobbyists on forums and blogs, you can find a lot of code to drive almost any electric motor that can fit in the motor shield specifications.

Before starting to write code, you have to plug the Arduino board into your computer’s USB port and install the Arduino IDE.

The whole process of controlling an electric motor could be split up into four parts.

First part: initiate the motor pins in the “setup()” function

Second part: brake the motor

Third part: setup the spin direction of the motor

Fourth part: change the speed of the motor

Tutorials

Below you’ll find tutorials that teach you how to control DC motors and stepper motors using the Uno R3 together with Arduino motor shield R3.

Control DC Motors

You can control two DC motors in the same time using the Arduino R3 shield. One motor is controlled via channel A, while the second motor is controlled via channel B.

Arduino Motor Shield Tutorial
Comprehensive tutorial from where you can learn how to control DC motors as well as a stepper motor using the Uno and the Arduino motor shield R3.

Arduinounomas
Simple tutorial with code able to control a DC motor in one direction and then in the opposite direction.

Control Stepper Motors

Driving a stepper motor using the Arduino motor shield is not a complicated task. Below you’ll find several tutorials from where you can start and learn how to control stepper motors with R3 shield.

Mercury Motor: Driving a stepper with the Arduino Motor Shield[link removed]

Simple tutorial from where you can get started to control a stepper motor.

Arduino and the official motor shield R3
This tutorial explains you how to use the Stepper library provided by Arduino and start working with stepper motors.

Arduino Motor Shield R3 Current Sensing

The motor shield designed in the Arduino lab is a wonderful device that lets you control the motors of the robot and in the same time let you monitor the current of the motor.
You can display the voltage of the motor with the following code:

Examples

If you want to play more with the Arduino, a motor shield and electric motors, you can find some inspiration in the below examples.

Floor vacuum cleaner robot – controlled by Arduino with motor shield, with printed motor-wheels

Arduino project: Hacking the Attacknid

RC Car to Robot

There are a lot of reasons to have in your Arduino arsenal an motor shield able to control electric motors. I hope that these techniques, tutorials and examples will introduce and help you shape the motor control with Uno R3 and the motor shield R3.

Robotics community only grows by sharing.

Share:

Related Posts

Don't Miss Out!

Get the latest news, tutorials, reviews and more direct to your inbox when you subscribe!