0% found this document useful (0 votes)
226 views81 pages

Make An Arduino Controlled Robot 1st Edition Margolis 2025 Scribd Download

The document promotes various robotics-related ebooks available for download on ebookgate.com, including titles on Arduino and Raspberry Pi controlled robots. It highlights the features of the ebook 'Make an Arduino Controlled Robot' by Michael Margolis, which covers building electronics, mobile platforms, and programming basics. Additional resources and tutorials are also mentioned to enhance the reader's experience.

Uploaded by

gehrikener8c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views81 pages

Make An Arduino Controlled Robot 1st Edition Margolis 2025 Scribd Download

The document promotes various robotics-related ebooks available for download on ebookgate.com, including titles on Arduino and Raspberry Pi controlled robots. It highlights the features of the ebook 'Make an Arduino Controlled Robot' by Michael Margolis, which covers building electronics, mobile platforms, and programming basics. Additional resources and tutorials are also mentioned to enhance the reader's experience.

Uploaded by

gehrikener8c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Get the full ebook with Bonus Features for a Better Reading Experience on ebookgate.

com

Make an Arduino Controlled Robot 1st Edition


Margolis

https://ebookgate.com/product/make-an-arduino-controlled-
robot-1st-edition-margolis/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookgate.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Make a Raspberry Pi controlled robot building a Rover with


Python Linux Motors and Sensors 1. ed Edition Donat

https://ebookgate.com/product/make-a-raspberry-pi-controlled-robot-
building-a-rover-with-python-linux-motors-and-sensors-1-ed-edition-
donat/
ebookgate.com

Make Getting Started with Arduino 3rd Edition The Open


Source Electronics Prototyping Platform Massimo Banzi

https://ebookgate.com/product/make-getting-started-with-arduino-3rd-
edition-the-open-source-electronics-prototyping-platform-massimo-
banzi/
ebookgate.com

Robot Grippers 1st Edition Gareth J. Monkman

https://ebookgate.com/product/robot-grippers-1st-edition-gareth-j-
monkman/

ebookgate.com

Arduino Wearable Projects 1st Edition Olsson

https://ebookgate.com/product/arduino-wearable-projects-1st-edition-
olsson/

ebookgate.com
Robot mechanisms and mechanical devices illustrated 1st
Edition Paul Sandin

https://ebookgate.com/product/robot-mechanisms-and-mechanical-devices-
illustrated-1st-edition-paul-sandin/

ebookgate.com

Robot Spacecraft Frontiers in Space 1st Edition Joseph A.


Angelo

https://ebookgate.com/product/robot-spacecraft-frontiers-in-space-1st-
edition-joseph-a-angelo/

ebookgate.com

Beginning Arduino 2nd Edition Michael Mcroberts

https://ebookgate.com/product/beginning-arduino-2nd-edition-michael-
mcroberts/

ebookgate.com

C Programming for Arduino 1st Edition Julien Bayle

https://ebookgate.com/product/c-programming-for-arduino-1st-edition-
julien-bayle/

ebookgate.com

Arduino Made Simple With Interactive Projects 1st Edition


Pajankar

https://ebookgate.com/product/arduino-made-simple-with-interactive-
projects-1st-edition-pajankar/

ebookgate.com
Make an Arduino-
Controlled Robot

Michael Margolis
Make an Arduino-Controlled Robot
by Michael Margolis
Copyright © 2013 Michael Margolis. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://my.safaribooksonline.com). For more information, contact our corpo-
rate/institutional sales department: 800-998-9938 or [email protected].
Editor: Brian Jepson Production Editor: Rachel Steely
Interior Designers: Nellie McKesson and Edie
Freedman

October 2012: First Edition


Revision History for the First Edition:
2012-09-12 First release

2012-10-03 Second release


See http://oreilly.com/catalog/errata.csp?isbn=9781449344375 for release details.

While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.

ISBN: 978-1-449-34437-5
[LSI]
Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

1. Introduction to Robot Building . . . . . . . . . . . . . . . . . 1


Why Build a Robot? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
How Robots Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2. Building the Electronics . . . . . . . . . . . . . . . . . . . . . . . . 9


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Construction Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Soldering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Building the Motor Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Soldering the Reflectance Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Making a Line Sensor Mount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3. Building the Two-Wheeled Mobile Platform . . 21


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Mechanical Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Lay Out the Chassis Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Motor Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Assemble the Chassis Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Attaching the Control Electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Mounting the IR sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Mounting the IR Sensors for Edge Detection . . . . . . . . . . . . . . . . . . . 39
Mounting the IR Sensors for Line Following . . . . . . . . . . . . . . . . . . . . 41

iii
Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

4. Building the Four-Wheeled Mobile Platform . . . 45


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Mechanical Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Lay Out the Chassis Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Motor Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Assemble the Chassis Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Solder the Power and Motor Connections . . . . . . . . . . . . . . . . . . . . . . 54
Connecting the Battery Pack and Power Switch . . . . . . . . . . . . . . . . . 55
Building the Optional Trickle Charger . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Assemble the Chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Mounting Arduino and Connecting Wires to the Shield . . . . . . . . . 58
Mounting the IR sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Mounting the IR Sensors for Edge Detection . . . . . . . . . . . . . . . . . . . . 65
Mounting the IR Sensors for Line Following . . . . . . . . . . . . . . . . . . . . . 67
Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

5. Tutorial: Getting Started with Arduino . . . . . . . . 71


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Arduino Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Arduino Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Installing the Integrated Development Environment (IDE) . . . . . . . . 74
Installing Arduino on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Installing Arduino on OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Installing Arduino on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Driver Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Connecting the Arduino Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Using the IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Uploading and Running the Blink Sketch . . . . . . . . . . . . . . . . . . . . . . . . . 81
Using Tabs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Installing Third-Party Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

6. Testing the Robot’s Basic Functions . . . . . . . . . . . 85


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Software Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Sketches Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Load and Run helloRobot.ino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
About the Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Making the Sketch Easy to Enhance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

7. Controlling Speed and Direction . . . . . . . . . . . . . 103


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

iv Make an Arduino-Controlled Robot


Sketches Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Types of Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Motor Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Controlling Motor Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
How Motor Speed Is Controlled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Code for Motor Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Calibrating Rotation and Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Software Architecture for Robot Mobility . . . . . . . . . . . . . . . . . . . . . . . . 119
Functions to Encapsulate Robot Movements . . . . . . . . . . . . . . . . . . . . 123
Core Movement Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Additional Core Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Functions to Rotate the Robot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Higher-Level Movement Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

8. Tutorial: Introduction to Sensors . . . . . . . . . . . . . 133


Hardware Discussed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Infrared Reflectance Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Sonar Distance Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Maxbotix EZ1 Sonar Distance Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Sharp IR Distance Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Proximity Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Sound Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Arduino Cookbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

9. Modifying the Robot to React to Edges and Lines


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Sketches Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
The Look Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Edge Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Line Following . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Seeing Sketch Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

10. Autonomous Movement . . . . . . . . . . . . . . . . . . . . . . . 163


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Sketches Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Mounting a Ping Distance Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Making a Mount for the Ping Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Mounting the Ping Sensor in a Fixed Position . . . . . . . . . . . . . . . . . . 168
Mounting the Ping Sensor on a Servo . . . . . . . . . . . . . . . . . . . . . . . . . 168
Letting the Robot Wander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Table of Contents v
Adding Scanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

11. Remote Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185


Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Sketches Used in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Design of the Remote Control Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Controlling the Robot with a TV Type IR Remote . . . . . . . . . . . . . . . . . 190
Installing the IR Decoder Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
The IR Remote Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192

Appendix A. Enhancing Your Robot . . . . . . . . . . . . . . . . 201

Appendix B. Using Other Hardware with Your Robot 205

Appendix C. Debugging Your Robot . . . . . . . . . . . . . . . . 211

Appendix D. Power Sources . . . . . . . . . . . . . . . . . . . . . . . . 221

Appendix E. Programming Constructs . . . . . . . . . . . . . 231

Appendix F. Arduino Pin and Timer Usage . . . . . . . . . 235

vi Make an Arduino-Controlled Robot


Preface

Building a robot and enabling it to sense its environment is a wonderful way to


take your Arduino knowledge to the next level. In writing this book, I have brought
together my love for invention and my experience with electronics, robotics and
microcontrollers. I hope you have as much pleasure building and enhancing your
robot as I did developing the techniques contained in this book.
Arduino is a family of microcontrollers (tiny computers) and a software creation
environment that makes it easy for you to create programs (called sketches)
that can interact with the physical world. Arduino enables your robot to sense
the environment and respond in a rich variety of ways. This book helps you to
build a robot that is capable of performing a wide variety of tasks. It explains
how to assemble two of the most popular mobile platforms, a robot with two
wheels and a caster (for stability, since it’s hard to balance on two wheels), and
a robot with four wheels and motors. If you want your robot up and running
quickly, choosing one of the kits detailed in this book should speed you
through the build process and get you going with the robot projects. But
whether you prefer to design and build a platform of your own construction
or build from a kit, you will find the projects that comprise the core of this book
a practical and fun introduction to Arduino robots.

Who This Book Is For


This book is for people who want to explore robotics concepts like: movement,
obstacle detection, handling sensors, remote control, and all kinds of real world
physical computing challenges. It is for people who want to understand how
these concepts can be used to build, expand and customize your robot. See
“What Was Left Out” (page xi) for some general references for those with limited
programming or electronics experience.

vii
How This Book Is Organized
The book contains information that covers a broad range of robotics tasks. The
hardware and software is built up stage by stage, with each chapter using
concepts explained in earlier chapters. A simple “Hello Robot” sketch is intro­
duced in Chapter 6, Testing the Robot’s Basic Functions and extended in subse­
quent chapters. Each chapter introduces sketches that add new capabilities to
the robot. Experienced users can skip directly to the chapters of interest—full
source code for every sketch in this book is available online. However, users
who want to learn all about the techniques covered will benefit and hopefully
enjoy working with all the sketches presented in the book, as each sketch
enables the robot to perform increasingly complex tasks.
The sketches are built using functional modules. The modules are stored using
Arduino IDE tabs (see Chapter 5). Modules described in early chapters are
reused later and to avoid printing the same code over and over in the book,
only code that is new or changed is printed. Figure P-1 illustrates how the code
is enhanced from sketch to sketch. The horizontal bars represent the sketches,
the vertical bars represent functional modules that are included in the sketch­
es. The initial ‘helloRobot’ sketch is transformed into the ‘myRobot’ sketch by
the moving the code for program definitions into a module named robotDe
fines.ino and reflectance sensors into a module named IrSensors.ino. These
module are included as tabs in the ‘myRobot’ sketch. Each subsequent sketch
is enhanced by adding code to an existing module or creating a new module
as a tab.

viii Make an Arduino-Controlled Robot


Figure P-1. Sketch and module family tree

All code for every sketch is available in the download for this book and you can
load the sketch being discussed into your IDE if you want a complete view of
all the code.
Chapter 1, Introduction to Robot Building provides a brief introduction to robot
hardware and software.
Chapter 2, Building the Electronics describes how to prepare the electronics for
use with the robot.
Chapter 3, Building the Two-Wheeled Mobile Platform describes how to assem­
ble the 2 Wheel Drive (2WD) mobile platform.
Chapter 4, Building the Four-Wheeled Mobile Platform describes how to assem­
ble the 4 Wheel Drive (4WD) mobile platform.

Preface ix
Chapter 5, Tutorial: Getting Started with Arduino introduces the Arduino envi­
ronment and provides help getting the development environment and hard­
ware installed and working.
Chapter 6, Testing the Robot’s Basic Functions explains the first robotics sketch.
It is used to test the robot. The code covered in this chapter is the basis of all
other sketches in the book:

• HelloRobot.ino (Arduino sketch) — Brings the robot to life so you can test
your build.
• myRobot.ino — Same functionality as above but structured into modules
to make it easy to enhance.

Chapter 7, Controlling Speed and Direction explains how you make the robot
move:

• myRobotMove.ino — Adds higher level movement capability.


• myRobotCalibrateRotation.ino — A sketch for running the robot through
a range of speeds to calibrate the robot.

Chapter 8, Tutorial: Introduction to Sensors introduces the most popular sensors


used with the 2WD and 4WD robots.
Chapter 9, Modifying the Robot to React to Edges and Lines describes techniques
for using reflectance sensors to enable your robot to gain awareness of its
environment. The robot will be able to follow lines or to avoid edges.

• myRobotEdge.ino — The robot will move about in an area bound by a non-


reflective surface (a large sheet of white paper placed on a non-reflective
surface).
• myRobotLine.ino — Repositions the sensors used above to allow the robot
to follow black lines painted or taped to a white surface. A variant of this
sketch that sends data over serial for display on an external serial device
is named myRobotLineDisplay and is included in the download code.

Chapter 10, Autonomous Movement describes how to use distance sensors to


enable the robot to see and avoid obstacles encountered as it moves around.

• myRobotWander.ino — Adds ‘eyes’ to give the robot the ability to look


around and avoid obstacles.
• myRobotScan.ino — Adds a servo so robot ‘eyes’ can scan independent of
robot movement.

x Make an Arduino-Controlled Robot


Chapter 11, Remote Control describes techniques for remotely controlling the
robot. Wired and wireless serial commands and using a TV type infrared remote
control are covered.

• myRobotSerialRemote.ino — Controls the robot using serial commands.


• myRobotRemote.ino — Controls the robot using an IR remote controller.
• LearningRemote.ino — Captures key codes from your remote control to
enable these to be added to the myRobotRemote sketch.
• myRobotWanderRemote.ino — Combines remote control with autono­
mous movement.

Appendix A, Enhancing Your Robot provides tips and techniques for designing
and building complex projects.
Appendix B, Using Other Hardware with Your Robot describes some alternative
solutions for motor control.
Appendix C, Debugging Your Robot has hardware and software debugging tips.
This sections includes Arduino and Processing source code to enable real time
graphical display of robot parameters on a computer screen.

• myRobotDebug.ino — Arduino example showing how to send data to your


computer.
• ArduinoDataDisplay.pde (Processing sketch) — graphs data received from
Arduino in real time.

Appendix D, Power Sources introduces some alternatives for powering your


robot.
Appendix E, Programming Constructs provides a brief introduction to some of
the programming constructs used in the sketches for this book that may not
be familiar to some Arduino users.
Appendix F, Arduino Pin and Timer Usage summarizes the pins and Arduino
resources used by the robot.

What Was Left Out


This book explains all the code used for the robot, but it is not an introduction
to programming. If you want to learn more about programming with Arduino,
you may want to refer to the Internet or to one of the following books:

• Getting Started with Arduino, 2nd Edition by Massimo Banzi (O’Reilly)


• Arduino Cookbook, 2nd Edition by Michael Margolis (O’Reilly)

Preface xi
A good book for inspiration on more robotics projects is:

• Make: Arduino Bots and Gadgets by Tero Karvinen, Kimmo Karvinen (O’Reil­
ly)

Code Style (About the Code)


The code used throughout this book has been tailored to clearly illustrate the
topic covered in each chapter. As a consequence, some common coding short­
cuts have been avoided. Experienced C programmers often use rich but terse
expressions that are efficient but can be a little difficult for beginners to read.
For example, code that returns boolean values uses the somewhat verbose
explicit expressions because they are easier for beginner programmers to read,
see the example that follows, which returns true if no reflection was detected
by the robot’s sensor:

return irSensorDetect(sensor) == false;

Here is the terse version that returns the same thing (note the negation oper­
ator before the function call):

return !irSensorDetect(sensor);

Feel free to substitute your preferred style. Beginners should be reassured that
there is no benefit in performance or code size in using the terse form.
One or two more advanced programming concepts have been used where
this makes the code easier to enhance. For example, long lists of sequential
constants use the enum declaration.
The enum keyword creates an enumeration; a list of constant integer values. All
the enums in this book start from 0 and increase sequentially by one.
For example, the list of constants associated with movement directions could
be expressed as:
const int MOV_LEFT = 0
const int MOV_RIGHT = 1;
const int MOV_FORWARD = 2;
const int MOV_BACK = 3;
const int MOV_ROTATE = 4;
const int MOV_STOP = 5;

The following declares the same constants with the identical values:
enum {MOV_LEFT, MOV_RIGHT, MOV_FORWARD,
MOV_BACK, MOV_ROTATE, MOV_STOP};

xii Make an Arduino-Controlled Robot


In addition to brevity, there are many advantages to the enum version of the
code. If you want to know more about enum, an online search for c++ enum
should tell you all you need to know and more.
Good programming practice involves ensuring that values used are valid
(garbage in equals garbage out) by checking them before using them in cal­
culations. However, to keep the code focused on the topic, error-checking code
has been kept to a minimum. If you expand the code, you are encouraged to
add error-checking where needed.

Arduino Hardware and Software


The examples in this book were built using the Arduino Leonardo and Uno
boards (see Chapter 5). The code has been tested with Arduino release 1.0.1
(the first release that fully supports the Leonardo board). Although many of
the sketches will run on earlier Arduino releases, this has not been tested. If
you really want to use a release older than 1.0, you need to change the exten­
sion from .ino to .pde to load the sketch into a pre-1.0 IDE.
There is a website for this book where you can download code for this book;
see “How to Contact Us” (page xv).
There is also a link to errata on that site. Errata give readers a way to let us know
about typos, errors, and other problems with the book. Errata will be visible
on the page immediately, and we’ll confirm them after checking them out.
O’Reilly can also fix errata in future printings of the book in electronic books,
and on Safari® Books Online, making for a better reader experience pretty
quickly.
If you have problems getting the code to work, check the web link to see if the
code has been updated. The Arduino forum is a good place to post a question
if you need more help: http://www.arduino.cc.
If you like—or don’t like—this book, by all means, please let people know.
Amazon reviews are one popular way to share your happiness or other com­
ments. You can also leave reviews at the O’Reilly site for the book.

Conventions Used in This Book


The following font conventions are used in this book:
Italic
Indicates pathnames, filenames, and program names; Internet addresses,
such as domain names and URLs; and new items where they are defined

Preface xiii
Constant width
Indicates command lines and options that should be typed verbatim;
names and keywords in programs, including method names, variable
names, and class names; and HTML element tags
Constant width bold
Indicates emphasis in program code lines
Constant width italic
Indicates text that should be replaced with user-supplied values

This icon signifies a tip, suggestion, or general note.

Using Code Examples


This book is here to help you make things with Arduino. In general, you may
use the code in this book in your programs and documentation. You do not
need to contact us for permission unless you’re reproducing a significant por­
tion of the code. For example, writing a program that uses several chunks of
code from this book does not require permission. Selling or distributing a CD-
ROM of examples from this book does require permission. Answering a ques­
tion by citing this book and quoting example code does not require permis­
sion. Incorporating a significant amount of example code from this book into
your product’s documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes
the title, author, publisher, and ISBN. For example: “Make an Arduino Controlled
Robot by Michael Margolis (O’Reilly). Copyright 2013 Michael Margolis, ISBN
(978-1-4493-4437-5).”
If you feel your use of code examples falls outside fair use or the permission
given here, feel free to contact us at [email protected].

Safari® Books Online


Safari Books Online is an on-demand digital library that lets you easily search
over 7,500 technology and creative reference books and videos to find the
answers you need quickly.
With a subscription, you can read any page and watch any video from our
library online. Read books on your cell phone and mobile devices. Access new

xiv Make an Arduino-Controlled Robot


titles before they are available for print, and get exclusive access to manuscripts
in development and post feedback for the authors. Copy and paste code sam­
ples, organize your favorites, download chapters, bookmark key sections, cre­
ate notes, print out pages, and benefit from tons of other time-saving features.
O’Reilly Media has uploaded this book to the Safari Books Online service. To
have full digital access to this book and others on similar topics from O’Reilly
and other publishers, sign up for free at http://my.safaribooksonline.com.

How to Contact Us
We have tested and verified the information in this book to the best of our
ability, but you may find that features have changed (or even that we have
made a few mistakes!). Please let us know about any errors you find, as well as
your suggestions for future editions, by writing to:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international/local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, example code, and any
additional information. You can access this page at:
http://shop.oreilly.com/product/0636920028024.do

To comment or ask technical questions about this book, send email to:
[email protected]

For more information about our books, courses, conferences, and news, see
our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments
Rob DeMartin, the business manager at Maker Media, was the driving force
behind the botkits, which inspired the writing of this book. Isaac Alexander
and Eric Weinhoffer at Maker Media ran with the concept to make it a product.
I thank them for testing the content of the book to ensure that the projects
and the hardware worked well together.

Preface xv
I am grateful to the Arduino community for contributing a wealth of free soft­
ware, in particular, the IrRemote library from Ken Sherriff that is used in the
remote control chapter. I would also like to express my appreciation to Limor
Fried (Ladyada) for creating the hardware, software and online build notes for
the motor shield used in this book.
Thanks also to DFRobot, the innovative company that designed the robot
platforms and provided the exploded view drawings used in the build chap­
ters.
Mat Fordy at Cool Components (coolcomponents.co.uk) organized the robot­
ics workshop that provided a testing ground for the book’s projects. It was
helpful and rewarding to work with the participants, each with a different level
of experience, to build the robots and see their pleasure in bringing their cre­
ations to life. Their feedback helped make the book content clear, practical and
fun.
If I have achieved my goal of making the rich variety of technical topics in this
book accessible to readers with limited electronics or programming experi­
ence, then much of the credit goes to Brian Jepson. Brian, who was also my
editor for the Arduino Cookbook, was with me every step of the way. I thank
him for his guidance: from his support and passion in beginning the project,
to his editorial expertise and application of his masterful communications skills
right through to using his technical knowledge to test all the projects in the
book.
I would like to thank my entire family for listening to me explain the finer points
of robotics during a week- long vacation in the early stages of preparing this
book. Four generations of my family were patient and constructive at times
when they would have preferred to be boating on the lake or walking in the
woods.
Finally, this book would not be what it is without the contributions made by
my wife, Barbara Faden. Her feedback on early drafts of the manuscript helped
shape the content. I am especially grateful for her support and patience in the
wake of disruption created as I wrangled with these two little robots to meet
the book’s deadline.

xvi Make an Arduino-Controlled Robot


1
Introduction to Robot
Building

This book takes you through the steps needed to build a robot capable of
autonomous movement and remote control. Build instructions are provided
for 2WD (two wheel drive) and 4WD (four wheel drive) platforms. The platforms
shown in Figure 1-1 and Figure 1-2 will make the construction a snap, but you
can build your own robot chassis if you prefer. The connection and use of the
control electronics and sensors are fully explained and the source code is in­
cluded in the book and available for download online (see “How to Contact
Us” (page xv) for more information on downloading the sample code).

Figure 1-1. The assembled two wheeled robot chassis

1
Introduction to Robot Building

Figure 1-2. The assembled four wheeled robot chassis

Here is a preview of the projects you can build:

• Controlling speed and direction by adding high level movement capabil­


ity.
• Enabling the robot to see the ground—using IR sensors for line and edge
detection (see Figure 1-3 and Figure 1-4).
• Enabling the robot to look around—scanning using a servo so the robot
can choose the best direction to move, as shown in Figure 1-5.
• Adding remote control using a TV remote control or a wired or wireless
serial connection.

2 Make an Arduino-Controlled Robot


Introduction to Robot Building

Figure 1-3. Robot moves around but remains within the white area

Figure 1-4. Robot follows black line

Chapter 1 3
Why Build a Robot?

Figure 1-5. Two wheeled and four wheeled robots with distance scanners

Why Build a Robot?


Building a robot is different from any other project you can make with a mi­
crocontroller. A robot can move and respond to its environment and exhibit
behaviors that mimic living creatures. Even though these behaviors may be
simple, they convey a sense that your creation has a will and intent of its own.
Building a machine that appears to have some spark of life has fascinated
people throughout the ages. The robots built over 60 years ago by neuro­
physiologist W. Grey Walter (see http://www.extremenxt.com/walter.htm) ex­
plored ways that the rich connections between a small number of brain cells
give rise to complex behaviors.

4 Make an Arduino-Controlled Robot


How Robots Move

There are many different kinds of robots, some can crawl, or walk, or slither.
The robots described in this book are the easiest and most popular; they use
two or four wheels driven by motors.

Choosing Your Robot


The projects in this book can use either a two or four Four Wheeled Robot
wheeled platform, but if you are still deciding which This robot’s four wheel drive makes this a good
is right for you, here are some factors that will help choice if you want it to roam over rougher sur­
you choose: faces. This platform has a large top plate that can
Two Wheeled Robot be used to carry small objects. The robot is heav­
Light and very maneuverable, this is a good ier and draws more current than the 2WD robot,
choice if you want to experiment with tasks such so battery life is shorter.
as line-following that require dexterous move­
ment. However, the caster that balances the ro­
bot requires a relatively smooth surface.

How Robots Move

The robots covered in this book move forward,


back, left and right much like a conventional
car. Figure 1-6 shows the wheel motion to
move the robot forward.

Figure 1-6. Left and Right wheels turn forward, Robot


moves Forward

If the wheels on one side are not driven (or are


driven more slowly than the other side) the ro­
bot will turn, as in Figure 1-7.

Figure 1-7. Only Left wheels turn, Robot Turns Right

Chapter 1 5
Tools

Figure 1-8 shows that reversing the wheel ro­


tation drives the robot backward.

Figure 1-8. Left and Right wheels turn backward, Robot


moves Backward

Unlike a car (but a little like a tank), these robots


can also rotate in place by driving the wheels
on each side in different directions. If the
wheels on each side are spinning in opposite
directions, the robot will rotate. Figure 1-9
shows clockwise rotation.
Figure 1-9. Left wheels turn forward, Right wheels re­
verse, Robot rotates Clockwise

Tools
These are the tools you need to assemble the robot chassis.
Phillips Screwdriver
A small Phillips screwdriver from your local hardware store.
Small long-nose or needle-nose pliers
For example, Radio Shack 4.5-inch mini long-nose pliers, part number
64-062 (see Figure 1-10) or Xcelite 4-inch mini long-nose pliers, model L4G.
Small wire cutters
For example, Radio Shack 5” cutters, part number 64-064 (Figure 1-11) or
Jameco 161411
Soldering iron
For example, Radio Shack 640-2070 (Figure 1-12) or Jameco 2094143 are
low cost irons suitable for beginners. But if you are serious about elec­
tronics, a good temperature controlled iron is worth the investment, such
as Radio Shack 55027897 or Jameco 146595.
Solder 22 AWG (.6mm) or thinner
For example, Radio Shack 640-0013 or Jameco 73605.

6 Make an Arduino-Controlled Robot


Tools

Figure 1-10. Small Pliers

Figure 1-11. Wire Cutters (Side Cutters)

Figure 1-12. Soldering Iron

Chapter 1 7
Building the Electronics 2
This chapter guides you through the electronic systems that will control your
robot. Both the two wheeled and four wheeled platforms use the same mod­
ules, a pre-built Arduino board (Arduino Uno or Leonardo), and a motor con­
troller kit. The motor controller featured in this book is the AFMotor shield from
Adafruit Industries. Although other motor controllers can be used (see Ap­
pendix B) the AFMotor shield provides convenient connections for the signals
and power to all the sensors and devices covered in this book. It is also capable
of driving four motors, which is required for the four wheel drive chassis.
Although the attachment of the boards to the robot differs somewhat de­
pending on the chassis, the building of the AFMotor circuit board kit is the
same for both. If you don’t have much experience with soldering, you should
practice soldering on some wires before tackling the circuit board (you can
find soldering tutorials here: http://www.ladyada.net/learn/soldering/
thm.html).

Hardware Required
See http://shop.oreilly.com/product/0636920028024.do for a detailed parts list.

• Tools listed in “Tools” (page 6)


• AFMotor shield kit
• Three 6 way 0.1” female headers
• Three QTR-1A reflectance sensors
• Stripboard, three 3 way 0.1” headers for line sensor mount
• Ribbon Cable, 11-way or wider, cut with a sharp knife as follows:
— One 10 inch length of 5 conductor ribbon cable for line sensors

9
Construction Techniques

— Two 10 inch lengths of 3 conductor ribbon cable for edge sensors


• Optional: 3 way 0.1” female header for optional charging circuit
• Optional: 3 way 0.1” female header for optional wireless connection

Construction Techniques
This section provides an overview of the motor controller shield construction.

Soldering
Soldering is easy to do if you understand the basic principles and have a little
practice. The trick for making a good solder joint is to provide the right amount
of heat to the parts to be soldered and use the right solder. 22 AWG solder
(0.6mm or .025 inch) or thinner is a good choice for soldering printed circuit
boards. A 25-watt to 40-watt iron, ideally with temperature control, is best. The
components to be joined should be mechanically secure so they don’t move
while the solder is cooling—wires should be crimped around terminals (see
Figure 4-11 and Figure 4-12). To make the joint, the tip of the iron should have
good contact with all the components to be soldered. Feed a small amount of
solder where the iron is touching the parts to be joined. When the solder flows
around the joint, remove the solder first and then the iron. The connection
should be mechanically secure and the joint shiny.

Building the Motor Controller


The motor controller shield is the heart of this robot. As well as controlling the
motors, all the sensors are connected to Arduino through this board. The shield
is provided as a kit and is the same for use with either the 2WD and 4WD robots,
differing only in the method of connecting the motors and mounting to the
chassis (both are detailed in later chapters).
The following is an overview of the construction with some tips that you should
read through before starting to build the circuit board. You can find step by
step construction details for the shield at this site: http://ladyada.net/make/
mshield/solder.html
Figure 2-1 shows the components for the shield.

10 Make an Arduino-Controlled Robot


Construction Techniques

Figure 2-1. Parts required to build the Motor Shield

The parts to the right of (as well as below) the board are packed with
the shield, but the three 6-pin headers on the left are not supplied with
the standard shield. These headers are used to connect the sensors.
These headers are included with the Maker Shed companion kits that
go along with this book. You can also purchase female headers from
Adafruit and other suppliers.
The two Maker Shed kits can be found at http://www.makershed.com/
Bots_and_Bits_for_Bots_s/46.htm. Look for either the Rovera 2W
(Arduino-Controlled 2 Wheel Robotics Platform) or Rovera 4W (Ardu­
ino Controlled 4 Wheel Robotics Platform).

Solder the smallest components first (Figure 2-2). The three small capacitors
and two resistors are not polarized so you can insert them either way around.

Chapter 2 11
Construction Techniques

Figure 2-2. Solder the Small Components

The resistor network (the long thin component with ten pins) is polarized—
the end with the white dot goes to the left of the PCB (nearest to C1) as shown
in Figure 2-3.

Figure 2-3. Solder the resistor network ­ the marker (circled) indicates correct orientation

The large capacitors, ICs, and LED are all polarized. The color of the components
shown in the step-by-step assembly pictures on the Adafruit site (you can find
the link at the beginning of these build notes) may not match the components
or layout for the parts you received (particularly the capacitors) so carefully

12 Make an Arduino-Controlled Robot


Construction Techniques

check that you have placed the correct value component in the correct orien­
tation. Figure 2-4 shows the layout for version 1.2 of the shield PCB. The kit
includes two IC sockets for the L293D chips. As mentioned in the assembly
instructions on the Adafruit site, these are optional but if you like to play safe
and want to use the sockets, solder them so the indent indicating pin 1 matches
the outline printed on the PCB.

Figure 2-4. Solder the rest of the polarized components

Figure 2-5 shows the board with all of the standard shield components (push­
button, headers, screw terminals) soldered. The final assembly step is to solder
the three 6-pin female headers near the analog input pins. These headers are
not included in the shield package or mentioned in Adafruit’s step-by-step
build instructions, but are included with the Maker Shed kits.

Chapter 2 13
Construction Techniques

Figure 2-5. Everything soldered except the sensor headers

Figure 2-6 shows all components including the sensor headers soldered. Trim
the component pins (except the header pins that connect the shield to the
Arduino) on the underside of the board so they are clear of the Arduino when
the shield is plugged onto the board. Locate one of the jumpers supplied with
the shield and plug this onto the pins marked power jumper—this connects
the motor power input and the Arduino VIN (power input) together so both
are fed from the batteries that you will be wiring after you have built the robot
chassis.

14 Make an Arduino-Controlled Robot


Construction Techniques

Figure 2-6. Shield with sensor headers

Figure 2-7 shows where all of the sensors and other external devices will be
connected. The three pin female headers are not needed for some of the
projects but you will find it convenient to solder these to the shield at this time.
Figure 2-8 shows two styles of connections. On the left, you’ll find the
stripboard-based wiring scheme as described in “Making a Line Sensor
Mount” (page 17). As you’ll see in later chapters, you can experiment with a
variety of mounting methods, including the stripboard-based one. The right
side of Figure 2-8 shows the wiring for separately connected sensors. As you
read through the later chapters and experiment with various mounting tech­
niques, you’ll use one or the other wiring schemes. Because you’ll be using
sockets and ribbon connectors to hook up the sensors, you won’t be locked
into any particular connection scheme; you can mix and match.

Chapter 2 15
Construction Techniques

The left and right designation in the diagram refers to left and right
from the robot’s perspective, and the later chapters will explain where
to connect these.

Figure 2-7. Connections for devices covered in the chapters to come

16 Make an Arduino-Controlled Robot


Construction Techniques

Figure 2-8. Connection detail ­ stripboard wiring is shown on the left, individual jumpers shown
on the right

Soldering the Reflectance Sensors


Each sensor package contains a small PCB and a 3-pin header. Insert the header
so the shorter length pins emerge on the side of the board with components
already soldered, see Figure 2-9. After ensuring you have the header the right
way around, solder the three pins.

Figure 2-9. QTR­1A Reflectance Sensors

Making a Line Sensor Mount


The line sensing project in this book uses three reflectance sensors wired to
analog inputs. Although it is possible to wire the three connections (+5V, Gnd,
and Signal) using 9 jumpers, it is more convenient to use a small piece of

Chapter 2 17
Construction Techniques

stripboard to connect the power lines together. Header sockets soldered to


the stripboard enable the sensor to be easily unplugged so you can change
configuration if you want to swap back and forth between line and edge de­
tection. Figure 2-10 shows the layout of the stripboard (note the five holes
you’ll need to drill out with a hand drill). Figure 2-12 shows the wires soldered
directly to the stripboard pads. If you’d like to add some strain relief, you can
drill out a few extra holes in an unused area of the stripboard. Next, divide the
wire into two groups (one for positive and negative, and three for the analog
pins), and feed the wires through large holes in the board before you solder
them. That way, if you tug on the wires, they’ll pull against the holes before
they pull against your solder joints.

Figure 2-10. Stripboard layout for mounting QTR­1A reflectance sensors for line following

To ensure that the mounting bolts don’t short the tracks, you can either cut
the tracks as shown in Figure 2-10 (you will be cutting along the third column
from the left, or the “C” column) or use insulated washers between the bolts
heads and the tracks. Figure 2-11 shows how the header sockets are connected,
and Figure 2-12 shows the completed stripboard, with the ribbon cable con­
nected. A ten inch length of cable is more than ample. Figure 2-13 shows the
other end of the ribbon connected to shield pins.

18 Make an Arduino-Controlled Robot


Construction Techniques

Figure 2-11. Stripboard with three 3 pin header sockets

Figure 2-12. Stripboard with all wires soldered

Chapter 2 19
Construction Techniques

Figure 2-13. Ribbon cable connections to shield pins

The method of mounting the stripboard depends on the robot chassis; see
Chapter 3, Building the Two-Wheeled Mobile Platform or Chapter 4, Building the
Four-Wheeled Mobile Platform. The three holes shown will suit either chassis
but you may prefer to wait until you have built the chassis and only drill the
holes you need.

Next Steps
The next stage in building the robot is to assemble the chassis. Chapter 3 covers
the two-wheeled robot and Chapter 4 is for the four-wheeled version.

20 Make an Arduino-Controlled Robot


3
Building the Two-Wheeled
Mobile Platform

This chapter provides advice on the construction of a Two Wheel Drive (2WD)
chassis with front caster, as shown in Figure 3-1. Construction is straightfor­
ward; you can follow the detailed steps or improvise if you want to customize
your robot. The chapter also shows how you attach and connect sensors used
in the projects covered in later chapters.
If you prefer to build a two wheeled robot of your own design, you should read
the sections on attaching control electronics and sensors; this will prepare you to
use the code for the projects in the chapters to come. Information in this chapter
my also provide some ideas to help with the design of your own robot.

21
Hardware Required

Figure 3-1. 2WD Robot Chassis

Hardware Required
See http://shop.oreilly.com/product/0636920028024.do for a detailed parts list.

• Tools listed in “Tools” (page 6)


• The assembled electronics (see Chapter 2, Building the Electronics
• 2WD Mobile Platform (two wheeled robot kit made by DFRobot)
• Two 0.1uF ceramic capacitors
• Two lengths of 3 conductor ribbon cable, two 3 way 0.1” headers for edge
sensors
• Optional: charging circuit resistors and diode, see detailed parts list

22 Make an Arduino-Controlled Robot


Mechanical Assembly

Mechanical Assembly
Lay Out the Chassis Parts
Figure 3-2 shows all of the parts contained in the 2WD chassis package. The
three black brackets to the left of the figure are not needed for any of the
projects in this book.

Figure 3-2. 2WD Chassis Parts

Figure 3-3 shows the contents of the bag containing the mounting hardware.
Locate the two bolts with the flat heads and put them aside for mounting the
battery case. Also identify the two thicker (M4) bolts that will be used to attach
the caster. The remaining short bolts in this pack are identical.

Chapter 3 23
Mechanical Assembly

Figure 3-3. 2WD hardware pack contents

Motor Assembly
Use two long bolts with lock washers and nuts, as shown in Figure 3-5, to attach
each motor to the chassis lower plate. Tighten the nuts snugly but take care
not to stress the plastic motor housing.

Lock washers are used to prevent a nut from accidentally coming lose
due to vibration. This is particularly important for attaching the motor
and switch. These washers have a split ring or serrations that apply
extra friction when tightened.
If you find that things still come lose, don’t overtighten the nuts; an
effective solution is retighten the nut and apply a dab of nail polish to
the point where the threads emerge from the nut.

Figure 3-4 shows the motors in place with the nut seen on the upper right
ready to be tightened.

24 Make an Arduino-Controlled Robot


Mechanical Assembly

Figure 3-4. Motors mounted on the chassis lower plate

Chapter 3 25
Mechanical Assembly

Figure 3-5. Motor Assembly

Assemble the Chassis Components


Push the wheels onto the motor assembly shafts, aligning the slots in the
wheels with the flat section of the motor shaft. Attach the caster with two M4
bolts and nuts. Figure 3-6 and Figure 3-7 show this.

26 Make an Arduino-Controlled Robot


Mechanical Assembly

Figure 3-6. Motor Assembly

Figure 3-7. Wheels and caster mounted

Chapter 3 27
Mechanical Assembly

Attach the sensor bracket to the underside of the lower chassis plate, as seen
in Figure 3-8 and Figure 3-9.

This robot is sometimes built with the sensor plate mounted at the
opposite end of the chassis (furthest from the caster). You can build
yours however you like, but the orientation shown here enables the
servo mounted distance scanner to be attached in the front of the robot.
Also, the sensor bracket in this location maximizes the distance be­
tween the wheels and the line sensors and this improves line following
sensitivity.

Figure 3-9 shows the underside of the chassis after mounting the sensor brack­
et. Note that the sensor bracket is attached to the bottom of the chassis plate.

Figure 3-8. Sensor bracket viewed with the robot right Figure 3-9. Sensor bracket viewed with the robot up­
side up side down

The battery pack is bolted to the bottom base plate with two countersunk (flat
headed) Phillips bolts as shown in Figure 3-10 and Figure 3-11. You may want
to delay this step until after the battery leads have been soldered to make it
easier to position all the wires.

28 Make an Arduino-Controlled Robot


Mechanical Assembly

Figure 3-10. Motor Assembly


Figure 3-11. Chassis with Battery Pack Attached

Cut two pieces of red/black wire, each about 7 1/2 inches long. Strip to expose
about 3/16 inch of bare wire at one end of the wires and attach to the motor
terminals. Strip 1/4 inch off the other end of the pairs of wires; these will be
connected to the motor shield. Connect a 0.1uF capacitor across each of the
motor terminals, as shown in Figure 3-12. The capacitors suppress electrical
spikes generated by the motor that could interfere with signals on the Arduino
board.

Figure 3-12. Wires and capacitors soldered to Motors

Chapter 3 29
Mechanical Assembly

The DC power jack is bolted to the top plate using the large (M8) lock washer
and nut. The switch is mounted using two (M6) nuts and a lock washer. Put
one nut on the switch leaving around 3/16” of thread above the nut. Then place
the lock washer on the thread and push this through the opening in the rear
plate and secure with the second M6 nut.
Orient the switch so the toggle moves towards the jack, as shown in Figure 3-13
and Figure 3-14 (Figure 3-15 shows the view from beneath).

Figure 3-13. Switch and Jack Assembly

30 Make an Arduino-Controlled Robot


Mechanical Assembly

Figure 3-14. Top panel showing location of switch and Figure 3-15. Top panel underside showing orientation
DC jack of switch and jack

The battery can be wired as shown in Figure 3-16 and Figure 3-17. The power
switch will disconnect the battery when the robot is not in use. The DC jack is
not used in this configuration (other than as a junction point for the black
ground wires). The switch is off when the toggle is closer to the DC jack as
shown (the toggle is a lever; when the exposed end is up as seen in the figure,
the contact at the bottom is connected and the contact wired to the shield is
open).

Figure 3-16. Basic Switch Wiring (no trickle charger)

Chapter 3 31
Mechanical Assembly

Figure 3-17. Solder the battery wires to the switch

You can build a simple trickle charger into the robot if you will be using re­
chargeable NiMH batteries. The charger can be built using the circuit shown
in Figure 3-18 and Figure 3-19. See “Trickle Charging” (page 229) for information
about using the charger.

Figure 3-18. Optional Trickle Charger Wiring

32 Make an Arduino-Controlled Robot


Another Random Document on
Scribd Without Any Related Topics
arm in a gesture of horror at the sight of the Damned, who, half-
buried in the turbulent waters, cling despairingly to the sides of the
boat. In the background are seen the towers of the burning city of
Dite.
Signed:—“eugène delacroix.”

Painted in oil on canvas.


5 ft. 11 in. × 7 ft. 10½ in. (1·80 × 2·40.)

INGRES
Jean Auguste Dominique Ingres (1780–1867) was a pupil of
David. Having gained the Prix de Rome in 1801, he did not leave for
Italy until 1806, but spent the next eighteen years in Rome and
Florence, returning to Paris in 1824. Although Ingres was brought up
in the cold tradition of the David school, he had a much clearer
perception of the true spirit of Greek art than his master. When he
became acquainted with the work of Raphael in Rome, he found it
the very acme of perfection, and henceforth frankly strove to
emulate that master, seeking to arrive at an eclectic ideal of the
human form which in its dogmatic rule of the proportions that
constitute absolute beauty, allowed none of the accents and
variations which make for life and character. Himself greater than his
theories, Ingres achieved that perfection of grace and beauty in his
deservedly famous The Spring (No. 422, Plate XLVIII.), one of the
few “gems” in the Salle Duchâtel, and in the very Raphaelesque
Odalisque (No. 422b), which was purchased in 1899 from the
Princesse de Sagan for £2400. On the other hand, the imposition of
an inflexible, rigid ideal of form did incalculable harm to his
numerous and less gifted followers, in whom every spark of
individuality was extinguished by the tyranny of the dogma.
Yet Ingres, when he applied himself to portraiture, was as
uncompromising a realist as Holbein, of whose sensitive, subtle
drawing and plastic modelling, without the introduction of entirely
unnecessary shiny high lights, we are forcibly reminded by the
Portrait of the Painter’s Friend, M. Bochet (No. 428a). Something of
the same perfection of modelling, suggested rather by the sensitive
contour than clearly stated by pronounced lights and shadows, is to
be noticed in the nude figure of The Odalisque, and in the creamy
white drapings of the oval Portrait of Mme. Rivière (No. 427).
Perhaps his best portrait at the Louvre is the one of M. Bertin,
Founder of the Journal des Débats (No. 428b), a masterpiece of
character painting, in which the marvellously drawn fleshy hands,
with their tapering fingers, are as expressive as the fine head. This
portrait was acquired in 1897 for the sum of £3200.
The less admirable side of Ingres’s talent is illustrated by the
circular composition of the Virgin of the Host (No. 416), a crude
scheme of “Sassoferrato blue” and red, on entirely conventional
lines; and by the Apotheosis of Homer (No. 417), a tame
Raphaelesque design in which Homer is seen enthroned in the
centre, with allegorical figures of the Iliad and Odyssey seated on
the steps of the throne, and a winged goddess placing a laurel
wreath on his head. To the left of the central group are the figures
of Hesiod, Æschylus, Apelles, Raphael, Virgil, Dante, Tasso, Corneille,
and Poussin; to the right, Pindar, Plato, Socrates, Alexander,
Camoens, Racine, Molière, and Fénelon. There is a touch of the
grotesque in the combination of rather mechanical dry portraiture
with trite allegory that constitutes the design of the terribly cracked
Portrait of the Composer Cherubini (No. 418). His failings as a
colourist are most aggressively obvious in the Christ handing the
Keys to St. Peter (No. 415). Ingres died in Paris on the 14th January
1867.
PLATE XLVIII.—JEAN AUGUSTE DOMINIQUE
INGRES
(1780–1867)
No. 422.—THE SPRING
(La Source)
A nude figure of a fair-haired young maiden stands facing the
spectator, the background being formed by a perpendicular rock
partly overgrown with clinging plants. She raises her right arm over
her head to hold the foot of a tilted vase, the mouth of which is
supported by her left hand, and from which issues a streamlet of
water that falls into a pool at the base of the rock, in which are
reflected the feet of the maiden.
Signed on a stone on the left:—“ingres, 1856.”
Painted in oil on canvas.
5 ft. 5 in. × 2 ft. 7½ in. (1.65 × 0.80.)

DELAROCHE AND SCHEFFER


Among the painters who were influenced by Delacroix, and whose
name was associated with the Romanticist movement, none rose to
greater fame than Paul Delaroche (1797–1856), a pupil of Gros, and
the Dutchman Ary Scheffer (1795–1858), who, like Delacroix,
studied under Guérin. But neither of these artists managed wholly to
shake off the trammels of the academic tradition, and both became
popular for the very reasons for which a more critical generation has
denied them the right to figure among the world’s great artists:
Delaroche for the theatricality of his historical anecdotes, of which
The Death of Queen Elizabeth (No. 216) and The Princes in the
Tower (No. 217) are typical examples; and Scheffer for the sickly
sentimentality displayed in such pictures as St. Augustine and St.
Monica (No. 841).
Contemporary with the fighters in the great battle between the
Romanticists and the Classicists were a group of able painters who
were not connected with either of these main currents of artistic
thought, but drew their inspiration from the Dutch genre painters.
The Arrival of a Diligence at the Messageries (No. 28), by Louis
Leopold Boilly (1761–1845), and The Interior of a Kitchen (No. 261),
by Martin Drolling (1752–1817), may be quoted as characteristic
instances of these “small masters” without possessing the luminosity
of their Dutch exemplars.

DECAMPS
Something of the precious quality of pigment and of the luminosity
of these Dutchmen is to be found in the genre pictures of Alexandre
Gabriel Decamps (1803–1860), of which a large number form part of
the Thomy Thiéry Bequest—notably The Knife-Grinder (No. 2831)
and The Gipsy Encampment (No. 2833). Decamps owes his historical
importance to his position as the head of the Orientalists. Unlike his
contemporary explorer of the East for pictorial purposes, Delacroix,
he found the facts of Eastern life, scenery, and customs sufficiently
attractive to be satisfied with the realistic statement of his visual
impressions, instead of making them the basis for the invention of
romantic incidents. Yet the Street in Smyrna (No. 2827) and similar
works are by no means of merely topographic interest, for Decamps
was a great painter to whom pigment yielded beauty independent of
the subject represented. The Rat retired from the World (No. 2834)
vies in quality with the still-life pictures of Chardin. Decamps was
also the greatest animal painter of his time, as may be gathered
from his Chevaux de halage (No. 204), The Bull-Dog and Scotch
Terrier (No. 206), and the precious little genre piece, The Kennel-Boy
(No. 2838).

THE ORIENTALISTS
Brought up in the tradition of the Classicist school, Prosper
Marilhat (1811–1847) only “formed himself” when the world of
colour was discovered to him under the glowing sky of the Holy Land
and Egypt, where he painted The Mosque of the Khalif Hakem, at
Cairo (No. 615). Another Orientalist of great distinction, who, after
being a favourite pupil of Ingres, became attracted by the fiery
romanticism of Delacroix, was the Creole Théodore Chassériau
(1819–1856). His works at the Louvre illustrate the earlier better
than the later phase of his art. Chassériau was still entirely under the
spell of Ingres when he painted, in 1844, the decoration of the Cour
des Comptes, which building was destroyed under the Commune.
Peace (No. 121a) is a fragment of this important decorative work,
which may be said to constitute a link between Ingres and Puvis de
Chavannes. The Chaste Susannah (No. 121) and the Portrait of
Father Lacordaire, Dominican Preacher (No. 121b), are again clear
evidence of Ingres’s influence upon Chassériau at the beginning of
his brief career.
A man of profound culture and rare critical acumen, Eugène
Fromentin (1820–1876) was perhaps greater as a critic than as a
painter. He, too, travelled repeatedly in Algeria and Egypt, where he
found abundant material both for his brush and pen. He did not look
upon the East with the curiosity of the traveller, nor did he let the
strange land work upon his romantic imagination. His pictures,
somewhat timid in technique but marked by great refinement,
reveal, on the other hand, a thorough understanding of the sad
monotony of the sun-parched desert, and the chivalrous, noble
bearing of its Arab inhabitants. His refined talent shows to best
advantage in Hawking in Algeria (No. 305).

REGNAULT
The Orient was by no means the uncontested field of the
Romanticists. But the followers of the official school who devoted
themselves to the depicting of Eastern life and scenery, approached
these subjects in the same spirit of parti pris which robs all their
work of real significance—unless, like Henri Regnault (1843–1871) in
his famous and often reproduced Moorish Execution (No. 771), they
treated them as rank melodrama. Regnault is, however, not to be
judged by this overrated piece of sensationalism. Killed in the
Franco-German War in 1871 at the early age of twenty-eight, this
young painter gave rare promise of brilliant achievement in an
altogether unacademic direction in his superb equestrian portrait of
General Prim (No. 770). There is something truly heroic in the way
the Spanish general sits his horse, arresting its forward movement
with a sudden jerk at the reins; but the ruggedness and unkempt
appearance of the rider displeased General Prim to such an extent
that Regnault, who would not alter the picture, preferred to keep it
on his hands.
ACADEMIC PAINTERS
It will suffice here merely to indicate the names and chief works at
the Louvre of the principal artists who carried on, about the middle
of the nineteenth century, the academic tradition,—capable painters
all, but without clearly-marked individuality. Thomas Couture (1815–
1879), a pupil of Gros and of Delaroche, in painting the huge
composition, Romans of the Decadence (No. 156), produced a
picture which may be taken as typical of the ambitions and failings
of the whole school—of their literary tendencies, theatricality, and
uninspired dulness. He was, however, an accomplished master of
technique, which is more than can be said of Joseph Devéria (1805–
1865), the painter of The Birth of Henri IV. (No. 250); or of Ingres’s
pupil, the dull Hippolyte Flandrin (1809–1864), who is only
represented by two Portraits (Nos. 284 and 285). Nor is it possible
to-day to grow enthusiastic over the historical paintings of Joseph
Nicolas Robert-Fleury (1797–1890), whose Conference at Poissy (No.
2982), Galileo before the Inquisition (No. 2983), and Christopher
Columbus received by Ferdinand and Isabella on his Return from
America (No. 2984), can only be regarded as unnecessarily large
coloured illustrations.

MICHEL AND HUET


In the much-neglected branch of landscape painting the classic
tradition of Claude ruled supreme until a new conception arose with
the victory of the romantics in the third decade of the nineteenth
century. Two names only need be mentioned before we pass on to
the new movement—the return to nature—which was inaugurated
by the group of painters vaguely known as the Barbizon school. Both
Georges Michel (1763–1843) and Paul Huet (1804–1868) may be
regarded as forerunners of that great movement; and both have
only in recent years received the recognition which is their due.
Michel developed his style in copying and closely studying the Dutch
landscape masters, and must in his maturity have been well
acquainted with the art of Constable, who exercised, together with
Bonington, a prodigious influence on the whole course of French
landscape painting. If Michel’s breadth of style, which may be judged
from Near Montmartre (No. 626), had been accompanied by a
greater range of subject-matter, he would probably rank more highly
in the roll of French artists; but he contented himself with the
endless repetition of the same motifs which he found close to
Montmartre, where he spent his whole life. The care with which he
studied the works of Jacob van Ruisdael earned for him the
nickname of “the Ruisdael of Montmartre.”
Huet, again, learnt more from the old masters and from his
friends, Bonington and Delacroix, than from his actual teachers. He,
too, thrust aside the recipes of composing classic or “noble”
landscapes, and was inspired by an altogether emotional outlook
upon nature, calm and serene, as in The Still Morning (No. 413), or
threatening and tempestuous, as in The Inundation at St. Cloud (No.
412), or in his masterpiece, The Breakers at Granville (No. 2952).

THE BARBIZON SCHOOL


The term “Barbizon school” has been extended from its narrower
meaning, in which it merely comprises Rousseau, Diaz, Millet and
the disciples who joined them, to form a little artistic colony on the
edge of the Forest of Fontainebleau, to a less accurate but now
generally accepted wider application, embracing “the men of 1830,”
who collectively and individually set out, inspired indirectly by
Constable, upon the conquest of light and atmosphere through
intimate communion with nature. In a pedantic survey of this
Barbizon school, Rousseau would have to take honour of place as
the leader of the group, whilst Corot and Daubigny, neither of whom
actually worked at Barbizon, would have to be altogether excluded.
But in the more liberal interpretation of the term, which we have
here adopted, Jean Baptiste Camille Corot (1796–1875) must be
given first place as the doyen of the whole group, since he alone
was born before the eighteenth century had run its course.
COROT
Corot, the son of a coiffeur and a modiste in comfortable
circumstances, was destined in his youth for the drapery trade, and
was only enabled to follow his bent for the artistic profession when,
at the age of twenty-five, he entered into possession of a small
annual allowance, sufficient to meet his modest requirements and to
save him from the desperate struggle for very existence which was
the fate of some of his later friends and companions. His early work
from nature had already laid the foundations for his subsequent style
when he entered the studio, first of the academic painter Michallon,
and then of Bertin. In 1825 Corot went to Rome, where he painted,
among many pictures of equally rich luscious quality, the View of the
Forum Romanum (No. 139), and the View of the Coliseum (No. 140),
which he himself bequeathed to the State. Although these early
works have none of the elusive charm and lyrical feeling of his
mature style, and are of rather topographic character, they reveal in
every touch the artist enamoured of atmosphere and of the quality
of pigment. The touch is precise, but not tight. The two pictures
were painted in 1826, but already they hold more than a hint of that
unrivalled mastery of tone-values which found supreme expression
in A Street in Douai (No. 141f), painted in 1871.
From the precision of his early manner Corot gradually advanced
to freedom and airy looseness of touch; from statement of fact, to
the suggestion of the very spirit and essence of nature in terms of
paint that, more than any other artist’s work, justify the expression
“colour music.” His later canvases are filled with the soft shimmer of
vibrating atmosphere and with the tender poetry of dawn and dusk.
Whilst retaining a truly classic sense of style, and adapting nature to
his purposes by arrangement and generalisation, he never fails to
convince the beholder of the reality of the scene represented. Even
if his glades are peopled with dancing nymphs and satyrs, as in A
Morning (No. 138), these mythical beings no longer suggest classic
statuary, but they belong as much to the landscape as do the trees
and shrubs and clouds, as do the peasant woman and the cow in
The Dell (No. 2801, Plate XLIX.), or the piping shepherd in the
exquisite Souvenir d’Italie: Castel Gandolfo (No. 141b). Of the
twenty-two paintings by the master at the Louvre, no fewer than
twelve form part of the Thomy Thiéry Bequest to which the great
French national collection owes so many of its chief treasures of
nineteenth-century art.

T. ROUSSEAU
The real head of the Barbizon school was Théodore Rousseau
(1812–1867), who was one of the first exponents of the “romantic”
as opposed to the “classic” landscape. If Corot was the lyric,
Rousseau was the epic poet of Nature. In his early works he was
considerably influenced by Constable, but he failed for a long time to
gain the approval of the public and of the Salon juries. Fourteen
times in succession his pictures were refused admission to the Salon,
and success only came to him late in life. In 1851, at about the
same time as Millet, he settled at Barbizon, on the outskirts of the
Forest of Fontainebleau, where henceforth he found the subjects for
his pictures. Rousseau was a most conscientious artist, who
“constructed a group of trees with the care that an Academician puts
into the construction of a nude figure.” His love of accurate detail did
not, however, make him lose sight of the general effect. His
insistence on bold silhouettes made him favour the sunset hour
when, as in his masterpiece, An Opening in the Forest at
Fontainebleau (No. 827), the trees would form effective dark masses
against the glowing sunset sky. More characteristic of his favourite
manner of composition is the imposing group of oak trees in the
middle of a plain in the picture known as Les Chênes (No. 2900). In
this, as in Marais dans les Landes (No. 830), which was bought in
1881 for £5160, and, indeed, in all the pictures where cattle are
introduced, it will be noticed that the animals form part and parcel of
the landscape, and are no longer individual “portraits” of animals, as
they were apt to be in the pictures by the earlier Dutch cattle-
painters. The same unity of vision is to be noted in all his sixteen
pictures at the Louvre.
PLATE XLIX.—JEAN-BAPTISTE CAMILLE
COROT
(1796–1875)
No. 2801.—THE DELL
(Le Vallon, avec des paysannes et une vache)
A grass-covered hill descends from the horizon line on the left to
the right-hand bottom corner of the picture. A low hedge with a
clump of trees in the centre divides the grassy plot from the field
rising beyond towards the horizon-line, from which projects a church
in the far distance. The sun is behind the trees, which throw a deep
shadow on the dale. A cow occupies the centre of the foreground. To
the left a group of three peasant women and a child; to the right a
farm labourer.
Signed on left:—“corot.”
Painted in oil on canvas.
1 ft. 1¾ in. × 1 ft. 9¼ in. (0·35 × 0·54.)

C. TROYON
This oneness of inanimate and animate nature is less completely
realised in the art of Constant Troyon (1810–1865), who, having
been trained as a porcelain-painter, was subsequently attracted by
the romanticism of Dupré, but followed such Dutch masters as Paul
Potter in subordinating the landscape to the cattle. It is for this
reason that Troyon is known to the public as a “cattle-painter” rather
than as a landscape painter. At the same time, he was a close
observer of the effects of light on fields and meadows, which he
rendered with a skill only rivalled by the solidity, the suggestion of
weight and movement, the well-accentuated forms and sinuosities of
his cattle. The huge canvas Oxen going to Work (No. 889) is an
unrivalled achievement of its kind—a piece of realism that is not
without poetry and grandeur. Next to it in importance ranks the
Return to the Farm (No. 890). Among the eleven Troyons (Nos.
2906–2916) of the Thomy Thiéry Bequest, the Morning (No. 2909)
strikes a more cheerful and hopeful note than is this artist’s wont.
Another artist of this group, who devoted himself almost
exclusively to the painting of sheep, is Charles Jacque (1813–1894),
from whose brush the Louvre owns the Flock of Sheep in a
Landscape (No. 430a), a characteristic work of unusually large
dimensions.

J. DUPRÉ
Jules Dupré (1811–1889) began, like Troyon, as a china-painter,
and, like Rousseau, with whom he was for years on terms of
intimate friendship, benefited by the example of Constable, whose
art he had presumably occasion to study during a visit to England. It
was from him that he acquired the sense of movement in nature,
which is so much more pronounced in his landscapes than in
Rousseau’s, whom he exceeded in breadth of touch and in power.
More particularly in his later manner he loved to apply his colours in
a thick impasto laid on to every part of the canvas, including the sky.
Only on rare occasions did he adopt the more fluid, suave manner
shown in Morning (No. 2940) and Evening (No. 2941), the two
decorative panels executed for Prince Demidoff, and acquired by the
Louvre in 1880 at the San Donato sale. More typical of his virile,
forceful style are the twelve signed pictures by Dupré in the Thomy
Thiéry Bequest (Nos. 2864–2875), especially the fine autumn
landscape The Pond (No. 2867, Plate L.), the intensely sad, sunless
Flock in the Landes (No. 2871), The Large Oak (No. 2873), and The
Sunset on a Marsh (No. 2874), with the golden glow of the sky
reflected in the water.
Before turning to Diaz, who has been aptly called “the most
romantic of the Romanticists,” we must briefly mention Eugène
Isabey (1804–1886), who connects the art of the First Empire with
Romanticism, and who knew how to invest his historical paintings
with genuinely pictorial interest at a time when that class of subject
was generally treated from the literary and anecdotal point of view.
His exuberant temperament led him not infrequently to exaggerated
movement. The twelve pictures which bear his signature at the
Louvre (Nos. 2878–2884, 2953–2956, and 2953a) are illustrative of
every phase of his art. As a landscape painter he may be considered
a forerunner of Rousseau.

DIAZ
Narcisse Diaz de la Peña (1809–1876) was born at Bordeaux, the
son of political fugitives from Spain, and, like so many artists of this
group, started his artistic career as a china-painter. He afterwards
gained considerable success with his romantic figure pictures of
mythological and Oriental subjects, like the Nymphs in a Wood (No.
2854), Venus and Adonis (No. 2858), Venus disarming Cupid (No.
2859), and above all the Fée aux Perles (No. 256). As a landscape
painter he delighted in rendering the sparkle of sunlight penetrating
through the dense foliage of forest and brushwood. Diaz must be
placed between Isabey and Millet, who followed his example in his
early figure pieces; but he was also influenced by Rousseau and by
Delacroix. Among his eighteen pictures at the Louvre are several
landscapes of superb quality, notably the Study of a Birch Tree (No.
252), Sous Bois (No. 253), and Dogs in the Forest (No. 257a).

PLATE L.—JULES DUPRÉ


(1811–1889)
No. 2867.—THE POND
(La Mare)

Autumnal landscape with a pond in the middle distance on the left,


bordered on the right, in the centre of the composition, by a group of
oak trees. In the foreground some cattle and a cowherd. Cloudy sky.
Signed on left:—“jules dupré.”

Painted in oil on canvas.


1 ft. 1 in. × 1 ft. 6½ in. (0·32 × 0·46.)

DAUBIGNY
Of all the Barbizon painters and their artistic kinship, Charles
François Daubigny (1817–1878) is the one who approached nature
with the most reverent spirit. He is in a way the least subjective of
them all, because his love of nature even in her simplest aspects
prevented him from imposing his own personality upon her; and for
this very reason he is more varied in his range of landscape subjects
than any of the other masters of this important group. The most
fugitive effects of light and atmosphere were seized by him with a
masterly sureness which found expression in every touch of his
summary brush. Every hour of the day, every season of the year,
every mood of nature appealed to him with equal intensity, although
the choice of his subjects is most frequently inspired by serene
optimism.
Daubigny belonged to a family of artists. He received his first
instruction from his father, and afterwards studied under Delaroche.
Before he began to paint landscapes in the neighbourhood of Paris,
he gained his livelihood by painting sweet-boxes! He found his best
subjects on the banks of the Oise, but worked also in other districts
of France, in Italy, and in England. Of his sojourn in England we are
reminded by The Thames at Erith (No. 2821), one of the thirteen
Daubignys bequeathed to the Louvre by Thomy Thiéry, which also
include the sun-flooded Weir Gate at Optevoz (No. 2818, Plate LI.),
The Pond with Storks (No. 2815), Les Péniches (No. 2820), Morning
on the River (No. 2824), and The Banks of the Oise (No. 2823). The
Vintage in Burgundy (No. 184), which was bought by the State at
the ridiculously low price of £400, is a picture of unusually large
dimensions for an artist who generally needed but a small surface to
express his ardent worship of nature. The delicious Spring (No. 185),
with its blossoming apple trees and young grass, must be counted
among his finest achievements. It is a picture that fills the heart of
the beholder with the joy and contentment engendered by the blithe
atmosphere of a bright spring day in the country.

MILLET
The Louvre is fortunate in possessing no fewer than a dozen
pictures by Jean François Millet (1814–1875), the great painter of
the peasant’s unceasing struggle with the forces of nature to gain
his livelihood from the soil. Millet himself was the son of a peasant,
and was kept busy with farm work until he had attained the age of
twenty, when he began to study art at Cherbourg. His studies were
repeatedly interrupted before he definitely took up art as his
profession. Before he went to Barbizon, in 1849, to devote himself
exclusively to the genre in which he was to achieve immortal fame,
he gained popular favour and admission to the Salon by following
the eighteenth-century tradition of mythological art, and painted a
number of nude studies of nymphs, goddesses, and cupids, not
unlike in style to those of Diaz, but already marked by that firmness
of design and by the monumental character that are so remarkable
in his later work. The study of Bathing Women (No. 642) belongs to
that period.
PLATE LI.—CHARLES FRANÇOIS DAUBIGNY
(1817–1878)
No. 2818.—THE WEIR GATE AT OPTEVOZ
(La Vanne d’Optevoz)

In the limpid clear water of the river, in the foreground, are


reflected the blue sky and the opposite river bank, which, from a
grassy slope on the left changes abruptly, near the weir gate, into a
steep, low, sandstone cliff, on the crest of which some trees and
bushes are silhouetted against the sky. On the left some ducks are
swimming on the mirror-like water.
Signed on left:—“daubigny, 1859.”
Painted in oil on canvas.
1 ft. 7¾ in. × 2 ft. 4¾ in. (0·49 × 0·73.)

After he had settled at Barbizon, Millet, whose peasant origin was


probably the cause of his intense sympathy with the struggles and
hardships of the field labourers’ fatiguing work, devoted his brush to
creating that profoundly moving record of labour and toil which
constitutes his claim to be considered one of the world’s great
masters. He knew how to invest scenes of humble life with truly
monumental grandeur, and brought out the hopeless monotony and
cruel hardships of the life led by the tillers of the soil with such
incisive strength, that he was accused of propagandist tendencies.
Nothing, however, was further from his aim. He was an artist pure
and simple, who, in following his own unpopular ideal, preferred to
suffer neglect and extreme poverty to a compromise with the taste
of the vulgar.
The Women Gleaning (No. 644, Plate LII.) may be considered his
supreme achievement, and an epitome of his whole art. Millet alone
could have invested so bald and unpromising a subject with so much
epic grandeur. There is in the rhythmic repetition of the action of the
two women in the centre of the composition a sense of the
inevitable hopeless monotony of labour in the fields, even if the
picture is not “a plea against the misery of the people.” The same
struggle for existence and the resulting physical fatigue are
admirably expressed in the statuesquely silhouetted figure of The
Weed-burner (No. 2890). The Woodcutter (No. 2895), The
Strawbinders (No. 2892), and The Winnower (No. 2893) all
exemplify this phase of Millet’s art. The domestic life of the
peasantry is treated with equally profound sympathy in Maternal
Precaution (No. 2894), La Couseuse (No. 644a), and La Lessiveuse
(No. 2891). Among his comparatively rare pure landscape subjects
The Church of Gréville (No. 641), which was found in an unfinished
state in the artist’s studio after his death, takes very high rank. It is
as remarkable for the simple telling truth with which the normal
aspect of the landscape is rendered, as the Spring (No. 643) is for
the realisation of a more uncommon effect—a rainbow and the shrill
accent of sunlight in the orchard under the leaden grey of the
departing thunder clouds.

DAUMIER
What Millet did for the life of the country, Honoré Daumier (1808–
1879) did for the life of the town, of which he was a shrewd and
critical observer. But his long practice as a caricaturist made him look
upon the types that engaged his brush with a certain cruel bitterness
which is far removed from Millet’s human sympathy. With a palette
restricted almost to black and grey, Daumier yet proved himself a
great colourist through the infallible accuracy of his tone-values and
the suggestion of rich colour in his almost monochrome schemes.
His design is as massive and monumental as Millet’s. The touch of
the macabre, which is so characteristic of Daumier’s art, is very
evident in The Thieves and the Donkey (No. 2937). The Portrait of
the Painter Théodore Rousseau (No. 2938) holds a hint of the
caricaturist’s vision.

COURBET
Equally far removed from, and hostile to, Classicism and
Romanticism was Gustave Courbet (1819–1877), who as head and
founder of the Realistic school exercised a prodigious influence upon
nineteenth-century art. He was essentially a fighting spirit,
determined to overcome official hostility to his revolutionary
principles. Excluded from public exhibitions, he held a private show
of his own works, and defended his theories by spoken and written
arguments. His just claim was that it did not matter what you paint,
but how you paint what you actually see; and in conformity with his
loudly proclaimed principles he often chose subjects that were
offensive to the taste of his day. At the same time we can see now
that he was endowed with a keen instinctive feeling for pictorial
fitness, and that most of his pictures are far from being haphazard
snapshots of actuality. In his student years he had copied many
masterpieces by Rembrandt, Velazquez, Hals, and Van Dyck. How
much he benefited from the example of the old masters is to be
judged from his portrait of himself, known as The Man with the
Leather-belt (No. 147).
PLATE LII.—JEAN FRANÇOIS MILLET
(1814–1875)
No. 644.—WOMEN GLEANING
(Les Glaneuses)
In a harvest-field three female gleaners, seen in profile to the left,
are occupied with picking up blades of corn. Two of them are
bending right down, with their right hands touching the ground; the
third woman is half erect. In the background some ricks, a cart and
horses, harvesters, a farm building, and a horseman.
Signed on right:—“j. f. millet.”

Painted in oil on canvas.


2 ft. 8¾ in. × 3 ft. 8¼ in. (0·82 × 1·12.)

By far his most famous picture is the gigantic Funeral at Ornans


(No. 143), which, as a study of the life and types in a small French
provincial town, has aptly been compared with Flaubert’s great novel
Madame Bovary. Each individual head in this vast composition is a
marvellous study of facial expression. In his landscapes, again, he
was by no means photographic, and he never failed to consider the
decorative effectiveness of his pictures. His influence upon Whistler’s
early work is to be judged from The Wave (No. 147a). If his
landscapes retain to a certain extent the atmosphere of the studio,
such pieces as La Remise des Chevreuils (No. 145a) and Le Ruisseau
du Puits noir (No. 146a) clearly show that he possessed a sound
understanding of the way in which colours react upon, and modify,
each other. Courbet’s revolutionary tendencies made him take part in
the political movement of the Commune, and forced him to leave his
native country. He died in Switzerland in 1877.

MEISSONIER
It was realism of a very different kind that made public opinion
place Jean Louis Ernest Meissonier (1815–1891) on a pinnacle, from
which he has only in recent years been transferred to the more
modest position due to him, for the exquisite minute care he
bestowed upon the working out of insignificant details. Meissonier
was a draughtsman and an illustrator rather than a painter. As a
colourist he does not count. He had no appreciation of values,
textures, substances, and surfaces. Nothing could be more to the
point than Manet’s mordant remark that in Meissonier’s pictures
“everything is of iron except the cuirasses.” Still, the mind that finds
delight in small things will dwell with pleasure upon the microscopic
details of his little costume pictures The Flute Player (No. 2887), The
Poet (No. 2889), and several similar “gems” at the Louvre. Strangely
enough the Portrait of Mme. Gerriot (No. 2965), which he painted at
the age of nineteen, has more breadth and real character than any
of his later works. The chief task of Meissonier’s life was the
glorification of Napoleon i.’s campaigns. Of this famous series the
Louvre includes no example. On the other hand, the collection owns
three important historical pictures from his brush in Napoleon III. at
Solferino (No. 2957), which long hung in the Luxembourg Gallery,
Napoleon III. surrounded by his Staff (No. 2958), and The Siege of
Paris (No. 2969), in the painting of which he had at least the
advantage of personal experience, as he had followed the Emperor’s
army on the Italian campaign, and was in Paris during the siege.
Altogether the Louvre owns no fewer than twenty-nine paintings by
Meissonier.

RICARD
If Meissonier is beginning to find his proper level after having
been grossly overrated, Louis Gustave Ricard (1824–1873), one of
the most remarkable portrait painters of his century, has only just in
recent years been rescued from almost complete oblivion. A pupil of
L. Cogniet, Ricard spent several years in copying the works and
analysing the technical methods of the old masters, and in travelling
in Italy, Belgium, Holland, and England. It was not before his return
to Paris in 1850 that he began to exhibit. Ricard was exclusively a
portrait painter. Technically his early studies enabled him to arrive at
a method of singular morbidezza and warm luminosity. There is a
certain truth in a modern critic’s description of Ricard’s pigments as
being composed of “crushed jewels, flower juice, and gold and silver
powder.” The great merit of Ricard’s portraits is, however, his
extraordinary insight into his sitters’ psychology. To him a portrait
meant more than a correct record of the model’s superficial aspect:
he endeavoured to paint the very soul in so far as it can be read
from eyes and lips. In this respect he is the descendant of Giorgione
and the forerunner of Watts and Carrière. The portraits of The
Painter Heilbuth (No. 778a), of Mme. de Calonne (No. 778e), of His
Own Portrait (No. 778), and the badly cracked Portrait of Paul de
Musset (No. 778b), may be quoted as admirable instances of his art.

MANET
We must close this necessarily fragmentary survey of French art at
the Louvre with the mention of Edouard Manet (1832–1883), whose
Olympia (No. 613a, Plate LIII.) is the first, and so far the only
painting of the Impressionist school that has gained access to this
gallery. It was formerly exhibited at the Luxembourg. Hung as it is
now in Gallery VIII. amid the works of David, Gros, Ingres,
Delacroix, Delaroche, and other early nineteenth-century painters,
this Olympia fully explains the sensation, but certainly not the
indignation, caused by its first appearance at the Salon of 1865. It
sings out with such brilliant purity of colour and is so emphatic in the
patterning of its design, so daring in the placing side by side of
almost unmodulated but infallibly accurate colour masses, that
everything around appears more or less dingy and artificial. Manet’s
Olympia marks the dawn of a new era, not because it is based on a
revolutionary rejection of tradition, but because it is true to the spirit
of the best tradition, which is not carried on by literal and
mechanical imitation, but by evolution and adaptation to modern life
and thought.
PLATE LIII.—ÉDOUARD MANET
(1832–1883)
No. 613a.—OLYMPIA
A nude woman, with blue-edged yellow satin slippers on her feet,
a narrow black riband round her neck, and a gold bracelet on her
right arm, is reclining on a bed, her right arm resting on the cushion.
Beneath her is spread a yellowish, flowered Indian shawl. A black cat
with raised tail stands at her feet on the bed. Behind the bed is seen
a negress, who brings a large bouquet of flowers to her mistress.
Signed on left:—“ed. manet, 1865.”
Painted in oil on canvas.
4 ft. 2 in. × 6 ft. 3 in. (1·27 × 1·90.)
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like