You are on page 1of 10

January 2022

Arduino and Robotics


From Development to Implementation
Table of Contents

04 CHAPTER - 1 Introduction and a Brief Overview

04 CHAPTER - 2 Arduino Hardware and Interfaces

05 CHAPTER - 3 Shields and Add-on Boards

09 CHAPTER - 4 Programming and Applications

Image Source Front Cover: Pxfuel

2 https://community.element14.com/
Arduino and Robotics

element14 is a Community of over 800,000 makers, professional engineers, electronics enthusiasts, and
everyone in between. Since our beginnings in 2009, we have provided a place to discuss electronics, get
help with your designs and projects, show off your skills by building a new prototype, and much more. We
also offer online learning courses such as our Essentials series, video tutorials from element14 Presents,
and electronics competitions with our Design Challenges.

The Arduino platform is popular both with beginners in the world of electronics and with seasoned
engineers. Arduino has a wide range of options for robotics applications, with a variety of base Arduino
boards available as well as many expansion options to add features and functionality. This eBook will
discuss how to get started in robotics using Arduino, with a discussion of the hardware and interfaces,
programming an Arduino, some example robotics projects, and much more.

element14 Community Team

https://community.element14.com/ 3
CHAPTER - 1 Introduction and a Brief Overview
Arduino boards are open-source electronics There are many different Arduino boards on the
platforms outfitted with microcontrollers, flash market, each suited for specific applications, such
memory, I/O (Input/Output) pins, various ports, and as the Internet of Things (IoT), interactive displays,
other connectors for programming and connecting to remote sensing, and robotics. Arduino’s current
other devices. The first board, the Serial Arduino, was lineup includes the Uno, Leonardo, Nano, Nano Every,
introduced in 2005 by an Italian startup of the same Zero, MKR Zero, Teensy, Due, Mega, and Micro, each
name, and was designed as a low-cost platform to outfitted with a microcontroller, I/O pins, and interfaces.
create devices that can interact with the environment There are also many different add-on boards, known
using sensors and actuators. Some examples of as Shields, that add additional features to the base
devices created using Arduino include handheld boards, including sensors, wireless functionality, and
gaming consoles, soil monitors, home automation relays, among a host of others.
systems, and more.

The Arduino platform is popular both with people


just starting with electronics, as well as engineers
with years of experience. Unlike most previous
programmable circuit boards in decades past, the
Arduino does not need a separate piece of hardware
(called a programmer) to program and upload code
to the board; users simply use a pre-programmed
SD card, or they connect the board to a computer.
Additionally, the Arduino IDE (Integrated Development
Environment), based on a simplified version of C++,
makes it easier to learn to program Arduino hardware. The Arduino Uno Rev 3
The platform also provides a standard form factor that
Image Source: Arduino - It is a popular development board
breaks out the microcontroller’s functions into a more among enthusiasts and can be used for various projects.
accessible package.

CHAPTER - 2 Arduino Hardware and Interfaces

While there are a host of different Arduino boards, they The differences between these memory types are:
all feature some form of similar hardware, connectors,
and interfaces. This includes a microcontroller, which • Flash memory is the program space. It’s where the
allows users to program the Arduino for it to be able program code the runs the Arduino is loaded.
to execute commands and make decisions based on
• SRAM (static random access memory) stores the
input. The chips vary depending on the type of Arduino;
temporary data that is generated during operation.
most are outfitted with Atmel controllers, usually an
Most variables are held here.
ATmega8, ATmega168, ATmega328, ATmega1280,
or ATmega2560. The differences between the chips • EEPROM (electrically erasable programmable
are subtle, but the biggest is typically the amount of read-only memory) is the memory that stores long
onboard memory, including up to 32 Kb of Flash, 2 Kb term information.
of SRAM, and 1 Kb of EEPROM.
SRAM is considered volatile memory, meaning that its

4 https://community.element14.com/
data is cleared when the unit is powered off. Flash and EEPROM are, by contrast, non-volatile; they retain their
data through power cycles.

Arduinos also include a set of I/O pins (usually 14) which can vary from board to board and come in two varieties –
digital pins that can read and write in a single state (on/off), and analog, which can read in a range of values. These
pins are oriented in a specific array for easy connection with add-on boards and other hardware. Most Arduino
boards are also outfitted with a barrel jack to provide power, even to other boards that are connected; however,
some Arduino boards can also be powered by a battery, if needed. Some also include a serial connector, which
is typically implemented via a standard USB port. This connector allows users to communicate to the board from
their computer and load new programs onto the device. Often Arduinos can also be powered through the USB port,
negating the need for a separate power connection altogether. The boards are also outfitted with a variety of other
components, including oscillators, voltage regulators, status LEDs, reset buttons, and more.

CHAPTER - 3 Shields and Add-on Boards


As mentioned earlier, Shields are modular circuit pressure, light, temperature, and humidity, a must for
boards that piggyback onto the Arduino to provide robots working outdoors.
extra functionality. Want to connect your Arduino
to the Internet and post to Twitter? There’s a shield Other beneficial Shields include the Arduino Motor
for that. Want to make your Arduino an autonomous Shield Rev3, a dual-bridge driver able to drive
rover? There are shields for that. There are many inductive loads such as relays and solenoids, along
different shields out there, all of which make your with DC and stepper motors. The Arduino 9 Axis Motion
Arduino more than just a development board. Many Shield packs a triaxial 14-bit accelerometer, a triaxial
Shields are also stackable, allowing users to connect 16-bit gyroscope with a range of ±2000 degrees per
several boards for project-specific applications. For second, and a triaxial geomagnetic sensor with a 32-
example, combining an Arduino Uno with a Voice Box bit microcontroller, which is excellent for robots that
Shield and WiFly Shield would allow users to create a require spatial orientation. Another great board is the
Wi-Fi-enabled Darth Vader voice. Arduino 4 Relays Shield, which allows users to drive
high power loads that Arduino’s digital IOs cannot
Shields also have a compatible format that makes control, due to the current and voltage limits of the
them connect easily to an Arduino using the pin controller. Finally, the Arduino Proto Shield Rev3 is
headers, including pins for power and ground on one a general-purpose board for creating custom circuits
eight (previously six) pin header and analog pins on and prototyping and features SPI signal pads, a 24-
a six-pin header on another. Digital pins cover the pin SMD footprint, and more.
opposite edge on the other side, sometimes with an
eight-pin header separated from a 10-pin by a 0.5-
inch spacing. Some shields also require a connection
to the Arduino’s ICSP header to function correctly.

Since this eBook deals specifically with robotics


projects, some of the best shields for that application
include the Arduino MKR Motor Carrier, which is
outfitted with several outputs for controlling stepper,
servo, and DC motors. It also features several inputs
for encoders and analog sensors, making it ideal for Arduino MKR Motor Carrier
robots to sense their environment. The Arduino MKR Image Source: Arduino - It is designed to control stepper,
ENV Shield Rev2 also provides sensors for atmospheric servo, and DC motors, making it ideal for robotics projects.

https://community.element14.com/ 5
Arduino Self Balancing Robot

Image Source: midhun_s via Instructables - This Self Balancing Robot can remain upright even while stationary and can avoid
obstacles as it moves around.

There are hundreds, if not thousands, of robot projects with micro metal gear motors allows the robot to
online that use the Arduino in one form or another. move. At the same time, a pair of ultrasonic sensors
The same can be said for their levels of complexity, detect the objects within its path to help navigate
which can range from simple rovers to complicated around them.
3D-printed constructs. That said, the following are
several excellent examples of robot projects that take The hardware is situated on three prototype boards
advantage of the Arduino platform. and wired to the Arduino, giving it a WALL-E-like
appearance. The Self Balancing Robot maintains
Midhun_s’ Self Balancing Robot is a great entry-level its balance similar to an upside-down pendulum;
build, and can remain upright even while moving and when the pendulum starts to fall in one direction, the
avoiding obstacles in its path. The tiny 4-inch-tall accelerometer/gyroscope module moves the robot
robot was designed around the Arduino Pro Mini and either forward or backward to compensate and keep
uses an MPU6050 accelerometer-gyroscope module the robot upright.
to maintain balance. A DRV8833 Pololu motor driver

Arduino Controlled Robotic Biped


Technovation’s Arduino Controlled Robotic Biped using Fusion 360 3D modeling software, allowing
is another little robot driven by an Arduino, in this him to incorporate six servo motors, with three
case, the Uno. The build is a great example of in each leg. The brackets for the servo motors
how a bipedal robot is designed and constructed provide a second pivot point opposite to its shaft,
using readily available hardware, except for its which provides stability for the robot and prevents
3D printed legs. Technovation designed the robot any skewing of the legs when under load.

6 https://community.element14.com/
The Arduino Uno is responsible for computing the motion paths of the robot’s various gaits, and it
instructs the actuators to move to precise angles and speeds to create a smooth walking motion. While
it’s not totally necessary, Technovation incorporated a perf board with pin headers to keep the wiring
from the servo motors to the Arduino neat and out of the way. He also left space to eventually add
ultrasonic sensors and an IMU (Inertial Measurement Unit) for enhanced motion processing and fall
detection capability.

Image Source: Technovation via Instructables - This Arduino Controlled Robotic Biped can walk using 3D printed legs outfitted
with six servo motors.making it ideal for robotics projects.

Petoi’s OpenCat
Petoi took an interest in Boston Dynamic’s Spot Mini 13 MG92B servos and a single MG91 servo.
robotic dog and thought it was a great accomplishment,
but way too expensive for the public to enjoy, so he The OpenCat is also equipped with a Pi noir fisheye
decided to build a less expensive alternative with camera, a GY-521 MPU-6050 3-axis gyroscope/
the OpenCat. The OpenCat robotic cat is one of accelerometer, and a 3D printed body with torque
the more complex builds to take advantage of the and tension springs that act as muscles. The robotic
Arduino. In its current form (there have been seven cat is designed for STEM education and AI-enhanced
revisions), the OpenCat uses a Raspberry Pi 3 Model services, and has a top speed of three body lengths
B to control the robot’s higher functions and sensing per second. While it lacks the agility of living felines,
capabilities, including sonic sensors and LiDAR for the OpenCat is programmed with multiple gates,
navigation. The Pi is paired with an Arduino Pro Mini object detection/avoidance, motion tracking, and
tasked to control the cat’s motion, which is driven by facial recognition. It can even purr when it’s pet!

https://community.element14.com/ 7
Image Source: Petoi via Arduino - Petoi’s OpenCat uses an Arduino, Raspberry Pi, and motion algorithm to perform multiple
gaits and has a top speed of three body lengths per second.

CHAPTER - 4 Programming and Applications

Programming robots can be done using various apps, Another popular software platform for robotics
including the Arduino IDE (Integrated Development projects is the Robotics Operating System (ROS),
Environment), which is open-source and written in and although it may sound like a traditional operating
Java (C++). The IDE allows users to write code in system, it isn’t. Instead, the Robotics Operating
a unique environment, with syntax highlighting and System is an open-source framework with libraries
other features designed to make coding easier. The and a set of tools that provide the functionality
app includes a code editor with features such as text of an OS on a heterogeneous computer cluster.
cutting and pasting, text searching and replacement, The platform provides services such as hardware
automatic indenting, brace matching, and it also abstraction, low-level device control, implementation
provides simple one-click mechanisms to compile of commonly-used functionality, message-passing
and upload programs, known as “sketches,” to an between processes, and package management.
Arduino board. It also provides a message area, a
text console, a toolbar with buttons for standard ROS is based on a graph architecture where
functions, and operation menus. processing occurs in nodes that may receive, post,
and multiplex sensor, control, state, planning,
Users will often upload the sketches they created for actuator, and other messages. In other words, it
specific project builds to sites that host open-source connects hardware with software to allow for an
content, allowing others to download and apply them advanced programming environment for controlling
to their builds. This makes it easy for beginners to low-level hardware. Users can even simulate their
complete their projects and learn how to code within processes and visualize them in 3D to see how the
the IDE environment. robot will function. Although the Robotic Operating

8 https://community.element14.com/
System seems too far advanced for some users, there are many tutorials and walkthroughs that make it easy
to understand.

This eBook is just a brief overview of the Arduino platform and how it can be applied to robotics projects – it
only scratches the surface of what can be accomplished with a bit of hardware and imagination. The amount
of information available could fill volumes, and that information will continue to grow as new development
boards are introduced and as hardware continues to become more affordable. If you’ve ever wanted to try
your hand at building robots, now is a great time to take that first step into a wonderful world using Arduino!

Image Source: Arduino - The Arduino IDE allows users to program their builds using sketches written in a text editor or
downloaded from third-party sources.

https://community.element14.com/ 9
For more information about Arduino and Robotics
check out our dedicated web pages.

300 S. Riverside Plaza, Suite 2200 Facebook.com/e14Community


Chicago, IL 60606 Twitter.com/e14Community
https://community.element14.com/

© 2022 by Newark Corporation, Chicago, IL 60606. All rights reserved. No portion of this publication, whether in whole or in part, can be reproduced without the express written consent of
Newark Corporation. Newark® is a registered trademark of Farnell Corp. All other registered and/or unregistered trademarks displayed in this publication constitute the intellectual property of
their respective holders. Printed in the U.S.A. WF-2745321

You might also like