Thimble Learning Platform
Back to full view

## Robotics Kit 4

### Introduction

This is the fourth kit in the Robotics Series. In this kit you'll be adding a robot arm to your driving and drawing robot.

#### Objectives

• Learning about robotics control systems.
• Have fun!
• I've Never Used an Arduino

Then this is a great place to start! If you're already familiar with setting up the Arduino and the IDE, you can skip to the next section.

### Terms

When we talk about Arduino, the Arduino IDE, and coding, there are a lot of words being thrown around. This section will clear all of those up and get you ready to start building!

### Arduino

The Arduino is a electronics prototyping platform. That means it's a flexible platform for building, testing, and, of course, prototyping electronics. That could be simple LEDs that light up at night, or advanced robots. When we talk about the Arduino we are talking about the physical board itself. The one that comes in this kit is red, but they come in many different shapes and colors. The Arduino brand and original board were created by arduino.cc and you can read more about the details of its history here.

### Arduino IDE

The Arduino IDE, or Integrated Development Environment, is not hardware, but a piece of software. If you wanted to write an essay, you might use Microsoft Word or Google Docs. If you wanted to edit pictures, you'd probably use Photoshop or Paint.net. If you want to program code for the Arduino, you'd use the Arduino IDE. Its a computer program (tool) that let's you develop and test out code. Once written, the code can be upload to the physical Arduino where it will stay until you upload new code.

Since it is a program, you'll need to install it.

For Windows computers use this link Windows Installer

For Mac computers use this link Mac Installer

Mac Installation
For Mac users

#### Installation

Next up are the installation options. The Install USB Drivers lets the Arduino board communicate with the IDE. We definitely want this. The Associate .ino files makes any Arduino file on your computer open up to the Arduino IDE. Very helpful, so we'll keep that too. Press Next >.

Options

Now you are being asked where you'd like the Arduino IDE program installed. I don't mind it in the standard Program Files so I just press Install. You can change where it will be installed, just remember what you chose. I recommend not changing it.

Folder

Now the IDE is installing.

Installing

Once completed proceed to the next section.

Completed

#### Arduino IDE 101

Open up the Arduino IDE for the first time. So, let's figure out what's what.

Arduino IDE

There is a mostly empty space in the middle that has this text:

1
2
3
4
5
6
7
8
9
void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}


This is a simple Arduino Sketch. A Sketch is code you write that will later be uploaded to the Arduino board.

There are few steps to go from code written in a sketch to code that runs on the Arduino board. Those are Verify > Compile > Upload.

All of these you can get to by going under Sketch on the top bar of the program. Or using the Checkmark and Arrow icons right below that. The Checkmark verifies your code will compile, and the arrow button uploads the code to the Arduino.

Sketch
Icons

Verify - looks at your code and makes sure it can actually run. It checks that there are no errors or things out of place. If your code will work, it goes to the Compile stage.

Compile - The code you've written is great for human. It is readable and hopefully understandable. But this isn't great for a machine ie the Arduino. The Compile stage takes your written code and translates into something that the Arduino can understand and run, called machine code. It saves that compiled file and tried to Upload it to the board.

Upload - This takes the compiled files and tries to send it to a plugged in Arduino. The IDE doesn't know where you've plugged in your Arduino or what kind it is. You have to tell it. I'll show you how to set that up in the next section.

#### Arduino Board Setup

For this section, make sure your Arduino Board that came with your kit is plugged in. Use the included micro USB cable to plug your Arduino into any free USB port on you computer.

Navigate to the Tools section at the top of the Arduino IDE.

You'll be greeted with a scary drop down. To setup your Arduino to accept uploads, do the following: Go to Board: and make sure Arduino/Genuino Uno is selected.

Board

Next is the Port. For Mac users refer to the video for these instructions. With your Arduino plugged in, you'll see some options. Mine says COM 15. This is the channel that the IDE will use to communicate with your Arduino. If you have a lot of COM # devices and don't know which is your Arduino, unplug your Arduino and take note of that numbers are there. Then plug it back in. Whichever is the new one in the list is your Arduino. Select that port.

Port

With the board and port selected and ready to go, let's upload our first sketch.

#### Sketches

We are going to upload a simple sketch to make an LED on the board blink. Head to File > Examples > Basics > Blink . You should see this sketch.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

*/

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);                       // wait for a second
digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
delay(1000);                       // wait for a second
}


Don't worry about the coding for now. Let's upload this sketch. You can press the Arrow icon, go to Sketch then Upload, or you can use the shortcut Ctrl+U in order to upload the code. Your sketch will auto-verify, compile, then upload to your Arduino board.

We provide example code for all our projects. To use those you'll need to copy them from our website. Then, go into the Arduino IDE, File > New. It's best to then delete all the code already there in the sketch before you paste our code in, as that will avoid any errors from copying over the old code.

#### Serial Plotter

You'll be asked to use the Serial Plotter on some projects. This reads any information coming from the Arduino and displays it on a graph. It can only be accessed after you've uploaded your code. It is in the Tools menu. Once opened, make sure the Baud rate is set to 9600.

Where to find the Serial Plotter
Baud rate

### Troubleshooting

The most common issues are solved by double checking your Board and Port settings.

Libraries

### What are Libraries?

Libraries are a collection of code that has already been written. We use them when we want to add functionality without have to write everything from scratch. The advantage of using a library is code re-use.

Some of the projects in this set need libraries so this section will show you how to install those.

No new libraries are required for this kit.

### Adding Them to the Arduino IDE

Open up the Arduino IDE and go to Sketch > Include Library > Add .ZIP Library.... After that navigate to the zip files and add them one by one. And that's it!

### What

Here are all the parts that come with Robotics Kit 4

### Modules

Gather the following parts to complete this project.

#### Parts

All Parts x Qty
Taped Acrylic Sheet x 1
Servos x 3
M3 6mm Machine Screw x 6
M3 8mm Machine Screw x 18
M3 12mm Machine Screw x 10
M3 Hex Nuts x 8

You should also have received a sheet of 6 stickers and a postcard with instructions.

Before Building

### Start

You'll need everything in the kit plus a working drawing robot from RS3.

### Piece Identification

Start by peeling off the acrylic pieces from the tape. Then take the paper backing off of each side. Each piece will have a letter etched into it, expect for the size reference card. Check out the sheet below to double check that you have every piece. It is recommended to place the pieces in alphabetical order.

Identification Guide

Parts sheet
Taking off parts
First one off
All off
All parts

### Hardware Identification

Included is a acrylic piece with the name Size Reference etched into it. This is to be used to identify 6mm, 8mm, 10mm, and 12mm screws. There are no 10mm screws in this kit but they have been used in the past. It is recommended to keep this reference handy throughout your build and hey why not forever.

### Calibration Code

There are three times in the build process where the servos much be set to a certain degree. Upload the following code to the completed drawing robot from Robotics Series 3.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//Libraries needed
#include "ServoDriver.h"
#include <Wire.h>

//Creating the servo driver object
ServoDriver servoDriver;

void setup() {
//Open I2C communication
Wire.begin();
//Begin communication with driver
servoDriver.init(0x7f);
}

void loop() {
//Set Servos
servoDriver.setAngle(7, 25);
servoDriver.setAngle(8, 90);
}


### Next Section

You'll want to grab a screwdriver and then head over to the next section to start the build.

Building the Arm

### Start

You should have the acrylics pieces lined up, a screwdriver with a Philips bit, and Robotics Series 3

### Left Side

#### Left Servo Mount

You will need pieces A, B, one servo, and two M3 8mm screws. Place A with the largest rectangular cutout towards the top left. Take the blue servo out of its bag and place it down through that cutout. The cable coming out of the servo should be on the left. Thread the cable through the large cut out in B then place B over the servo. The smaller cutout should be towards the right. Before screwing this piece in place, take the servo cable and feed it through the small cut out in B. Push B flush against the servo. Place both screws in the holes in B then screw into A. Do not over tighten the screws. You will snap the acrylic.

Parts needed
Top left cutout
Take the servo
Insert down into cutout
Flush with the part
Cable coming out of the left
Take B
Slip through cable
Slide out servo
Take a screw
Place in top hole
Screw down
Repeat with remaining screw
Pieces should be parallel and not bent at all

#### Left Servo Arm

You will need the smaller bag inside the servo bag, and C. Take out the servo horn shown below as well as all three screws. Place the center of the horn through the large hole at the end of C. From the opposite side as the horn arms, screw in the two longer screws through C and into the horn.

Parts needed
Take horn
Place in hole
Flip over
Take a long screw
Insert
Screw into horn
Repeat

#### Attaching the Arm

For this step we need Robotics Series 3. Power up the Arduino and connect all batteries from the 6-AA battery holder. Place the servo cable from the Left Servo Mount into header P8 found at the front left of the I2C Servo Driver if the robot is facing forward. Make sure the brown wire is facing the inside. Once inserted, the servo will go to the 90 degree location. Unplug the servo cable.

Powered on RS3
Plug in to P8
Wait for servo to move

Take your servo arm and place it on the servo so that the arm point to the 9 o' clock position. Plug in the servo cable again to make sure it still points to 9 o' clock. When confirmed, take the cable out and screw the smaller screw from the smaller servo bag into the center of the servo horn and into the servo. It's okay if you spin the arm while tightening, but if it is spinning then it's tight enough.

Parts needed
Place on servo
Pointing to 9 o' clock
Screw in small screw
Set this aside

Set this aside as we proceed to the next step.

### Right Side

#### Right Servo Mount

You will need pieces D, E, one servo, and two M3 8mm screws. Place D with the largest rectangular cutout towards the top right. Take the blue servo out of its bag and place it down through that cutout. The cable coming out of the servo should be on the right. Thread the cable through the large cut out in E then place E over the servo. The smaller cutout should be towards the right. Before screwing this piece in place, take the servo cable and feed it through the small cut out in E. Push E flush against the servo. Place both screws in the holes in E then screw into D. Do not over tighten the screws. You will snap the acrylic.

Parts needed
Take the servo
Place down into D
Cable to the right
Take E
Slip cable in cutout
Place over servo
Take a screw
Place into upper hole
Feed cable through guide
Pull tight
Tighten screw
Repeat

#### Right Servo Arm

You will need another smaller servo bag of parts and F. Insert a similar servo horn into the large hole in F. Screw two screws from the opposite side through F then the horn.

Parts needed
Take horn
Place in hole
Flip over
Take one screw
Insert
Tighten
Repeat

#### Attaching the Arm

Follow the same procedure from the left side except the arm should be at 12 o' clock not 9. When the arm is in the correct position, screw the smaller screw from the smaller servo bag into the center of the servo horn and into the servo.

Take arm
Place on servo pointing up
Screw into servo
Finished

#### Vertical Piece

Take a G piece and one 6mm screw. Line up one hole from the G piece with the hole on the top right of D. If the servo arm is on the outside of the piece then G should be on the inside. Screw the 6mm screw through G and into D.

Parts needed
A hole in G
The hole in D
Take the 6mm screw
Insert into G
Insert into D from behind
Tighten
Done

Set this aside as we proceed to the next step.

### Middle Mount

You will need pieces H, i, J and one 8mm screw. Line up the hole in H with the hole in the rounded part of i then J. The H piece should be closest to you. Insert the screw through H into i then J. Not too tight as we want the parts to move freely.

Parts needed
Hole in H
Hole in i
Hole in J
Take the screw
Insert into H
Seen from above
Tighten
Done

### Creating the Base

#### 3/4 Frame

To start the base of the arm you'll need the middle mount, left servo mount, K, L, a 12mm screw and nut. Place K with the large tabs facing up and down and the small tabs should be below the cutouts. Place the middle mount on top of the K piece. The side with the hole should be on the right. Line up the slots in L with the tab in K and the tab in the middle mount. Connect the left servo mount to K. The side of the left servo mount with the arm should be facing K. Slide the mount into the tabs in the top K as well as L. Place a nut in the T-slot in L then insert the 12mm screw through A and into the nut.

Parts needed
Starting with the middle mount
It will go here
In this orientation
Middle mount in place
Match these cutouts
To these
Take L
Slide into K and middle mount
Left servo arm
Facing the inside
Take the left servo mount
Slide into tabs on K
And in L
Take nut
Insert into T-slot
Insert the screw
Tighten

Take the M piece, a 12mm screw, and nut. Slide the M piece into A. It should be similar to how L worked. If the already constructed base is too ridged, try loosening the t-sloted 12mm just a tad to allow for some flex. With the M piece in place, again put a nut in the T-slot and then insert a 12mm screw through A and into the nut.

Parts needed
Take M
Slide onto base
Screw in T-slot
Screw in T-slot

#### J Extension

Take a G piece and one 8mm screw. Place G between the holes found in C in the left servo mount and J in the middle mount. Insert a screw through C, then G, then tighten into J.

Parts needed
Take screw
Place through C
Place G through screw
Place J on screw
Flip over
Tighten
Done

#### Cross Brace

Take the N piece, a 12mm screw, and a nut. Place N into i. There is a curved section in N which should be on the bottom right of the piece. Place the nut into the upper t-slot and insert the 12mm screw through i and into the nut.

Parts needed
Take N
Insert into i
Another view
Screw in T-slot

#### Full Frame

Slide the right servo mount towards the base we have already constructed. First, insert F into N. Place a nut into the lower t-slot and insert the 12mm screw through F and into the nut. Fit tabs in K, L, and M into D before fully tightening. Place a nut each in t-slots found in L and M. Then insert a 12mm screw through D into each nut and tighten.

Take right servo mount
Slide together

### Base to Claw

#### O Arm

Take the O piece and two 6mm screws. Place O between i and the G piece coming off of the left side. Insert one 6mm screw through G and tighten into O. Insert the remaining screw through O and tighten into i. Not to tight as we want free movement.

Parts needefd
This hole
With attach here
This more middle hole
Goes into i
Both screw from the outside in
G is in front of O but O is in front of i

Take pieces G, P, Q, a circle spacer, two 8mm screws, and one 6mm screw. The following directions assume that the letter Q on piece Q is facing so it's readable. Place a 8mm screw through the bottom hole in Q. Now place P through that screw as well. Now tighten the screw into the hole found on F.

Parts needed
Take an 8mm screw
Insert into bottom hole
All the way through
Place P on same screw
Into F
Like so
Tighten

Slide a circle spacer between the left hole in Q and the G piece already attached to D. Insert the remaining 8mm screw through G and the circle spacer before tightening into Q.

From this angle
Take a circle spacer
Place between Q and G
Insert screw through G and spacer
Tighten into Q

Take the free G piece and insert a screw through either hole. Tighten this screw into the remaining hole in Q from the back. The opposite direction that you did the two previous 8mm screws.

This hole in G
Goes behing this hole in Q
With a 6mm screw

### Claw

#### Servo Mount

Take pieces R, S, T, U, the remaining servo, and four 8mm screws. Place R so that the letter faces up and is to the left. Place S and T as they are seen in the pictures below. Place the servo face down and with the cable coming out the left. Once the servo is flush with R, place U on top. Make sure to line up the larger notch in U with S. Insert all four 8mm screw through U and into R.

Parts needed
Take S
Place in upper slot
Take T
Place in lower slot
Take servo
Place between S and T
Take note of cable
Coming out of left side
Take U
Slip cable through
And over servo
Take all screws
Place through holes in U
Screw into R
No bends

#### Claw arms

Take pieces V, W, X, one 8mm screw, and one 12mm screw. Insert the 12mm screw into the upper hole in R and the 8mm screw into the lower hole. Flip over the servo mount. Place W on the 12mm screw and X on the 8mm screw. The two arms who should be geared together and in the close position seen below. Place V on the two screws such that the V is facing up and points away from the arms. The 8mm screw should be tightened into V at this time.

Parts Needed
Take 12mm screw
Place in upper hole
8mm goes in lower
Place arms on
Flip over
Take V
Place over screws
Tighten 8mm

#### Servo Horn

Take the one sided servo horn out of the small servo bag. Place it in the center hole of Y with the horn above the slotted lug. Take a long screw and tighten it through the slot and into the horn.

Parts needed
Take horn
Place in hole
Flip over
Take screw
Tighten
Done

#### Attaching Y

For this step we will again need the fully powered drawing robot. Plug the servo in the servo mount into P7 in the I2C Servo Driver. It will move to the 25 degree position. Place the Y piece on the servo with the horn facing away from the claw arms. Affix Y in place with the small screw.

RS3 and Claw
Plug into P7
Parts needed
Y piece on servo
Pointing right
Done

#### Finishing the Claw

Take pieces Z. Y+, one 8mm screw, and two 6mm screw. Open up the claw arm to 180 degrees. Place Z over V so the center hole lines up the 12mm screw from before. The other hole in Z should line up with the one in W. Insert the 8mm screw through Z and into W. Place Y+ on top of Y and insert a 6mm screw into both holes.

Arms at 180 degrees
Take Z
Place like this
Tighten 12mm from the other side
Add an 8mm from the bottom
Through Z and W
Tighten
Take Y++
Place over Y

### Attaching the Claw

Gather the other circle space and three 8mm screws. Insert one 8mm screw through P and into the higher hole in S. Insert one 8mm screw through G and into the lower hole in S. Take the remaining 8mm screw and insert it through O and into T.

Claw, G, and P
8mm screw through P into lower S
Take a circle spacer
Place between G and upper S
Tighten in upper S
Other side
Tighten into T
Finished
Finished

### Next Section

You have completed building the arm. Head over to the next section to upload the control code.

Attaching the Arm

### Start

We'll need to take off the second level of Robotics Series 3 to attach the robot arm.

### Undo Robotics Series 3

Undo the cables going to the I2C Servo Driver and the I2C Motor Driver. Press down on the orange buttons on the servo driver then remove the jumper. Unscrew all terminal blocks on the I2C motor driver and remove the wires.

Completed RS3
Remove I2C Servo Driver cable
Remove I2C Servo Driver cable
Remove I2C Motor Driver cable
Remove I2C Motor Driver cable
Press down buttons
Remove jumpers
Unscrew
Unscrew
Remove wires
Unscrew
Remove wires

Undo the four screws at the corners of the level two chassis and remove it from the standoffs. Becareful to feed the wires and cables out first.

Unscrew standoff screws
Screws out
Remove chassis
Remove chassis

Take the robot arm, the freed level two chassis, two 12mm screws, and two hex nuts. Line up the holes in the base of the robot arm with the holes in the chassis. Flip over the arm and chassis. Take one 12mm screw and insert it through the chassis and into the base. Repeat with the remaining screw. Flip back over the to the top. the screws tap into the base but nuts can be added.

Parts needed
Line up these holes
With these
Take the arm
Place over the chassis
Flip over
Take one 12mm screw
Insert through chassis
Screw into base
Repeat with remaining screw
Flip over
The base
With nuts

### Robot Arm Servos

Plug the claw servo into P8 in the I2C servo driver. Plug the farther base servo into P7. Plug the remaining close servo into P6.

Take servo cable from claw
Place into P8
Take this servo cable
Place into P7
The this servo cable
Place into P6
Finished

### Reattached the Chassis

Place the level two chassis on the standoffs so that the robot arm side is oppisite the battery holder. Screw in the four screw into the standoffs. Reverse the Undo Directions to reattached all wires and cables.

Level one chassis
Line up level two
Screws in
Wires and cables in

### Next Section

With the robot arm attached you can head to the next section to program it.