Skip to content

Building the Robot Chassis

Introduction

The system described in this section is the configuration that the author used during the development of the Introduction to Arduino exercises for this module, as shown in Fig 1. This is the recommended configuration for the robot build, as it will be assumed that you have followed these procedures when carrying out the exercises.

Picture of the completed Robot.
Picture of the completed robot.

Note

Many of the pictures in this Mechanical Component Assembly section were taken during the prototyping phase of the system design and feature a slightly earlier version of the robot chassis. As a result, there may be slight differences compared to the robot chassis in your kit, but the procedures described in this documentation are all for the final chassis design.

Info

For those of you that are not familliar with breadboard circuits, Sparkfun have in intersting article on How to Use a Breadboard, describing their use and construction.

Adding the mechanical components to the chassis

This section covers the assembly of the mechanical system; a later section will cover the assembly of the electronic circuitry.

Annotated layout of the robot chassis
Annotated layout of the robot chassis.

Due to overlapping parts, certain elements of the robot must be constructed in the order described below. See Fig 2 for a diagram of the layout. The suggested order of construction is:

  1. Attach the yellow FIT0450 motor to the back of the chassis
  2. Attach the skinny wheel to the motor
  3. Attach the cheap plastic wheels to the front of the chassis
  4. Attach the MG996 servo to the front of the chassis
  5. Attach the IR sensor to Lolly Stick D
  6. Attach the lolly stick to the servo horn
  7. Attach the assembled lolly stick (with the IR sensor and servo horn) to the servo shaft.

Attaching the FIT0450 and Skinny wheel

This is the most awkward component to attach to the chassis, as the motor must be maneuvered to slide into its final location and screw into place. The procedure for assembly is as follows:

  1. Push 2x M3x30 through the motor, from the brass shaft side.
  2. Carefully insert the motor into the chassis and manipulate it so that the screws are aligned with the screw holes in the chassis sidewall.
  3. Insert a screwdriver through the access holes in the chassis, push the screws through, and secure the motor using 2× M3 nuts, as shown in Fig 3b and c.
  4. Push the skinny wheel onto the motor shaft and use an M3x6 machine screw to fasten fasten it in place, as shown in Fig 3a.
Assembly pictures of the mounted motor
Assembly pictures of the mounted motor

A video of this process is provided in Fig 4.

Note: This video has no commentary

Motor and wheel assembly video

Note: Skinny Wheels May need drilling out

The M3 mounting hole on some of the narrow wheels is too small and will need to be drilled out to 3 mm. Please see a member of the lab technical team during your lab session if this is the case.

Attaching the Moulded Plastic wheels

The moulded Plastic wheels attach to the robot chassis as shown in Fig 5.

Direction of fixings for the the Molded plastic wheels.
Direction of fixings for the the Molded plastic wheels.

Do this Before Attaching The MG996 Servo

These wheels must be attached before the servo, as the servo blocks access to the screw heads for the left wheel.

Attaching the Left-Hand Moulded Plastic Wheel

The left-hand molded plastic wheel is located next to the servo at the front of the robot, and it should be attached first. To attach this wheel, you will need an M3×20 mm bolt and an M3 Nyloc nut. The molded plastic wheels attach to the lugs at the front of the robot chassis.

The bolt for this wheel Must be inserted from between the lugs, with the bolt head in front of the rectangular servo hole. This ensures the servo mounting hole is not obstructed, allowing the servo to be installed correctly.

Fig 6 shows a short video showing assembly of the lefthand wheel beside the servo.

Note: This video has no commentary

Video showing the attachment of the lefthand moulded plastic wheel beside the servo.

Attaching the Right-Hand Moulded Plastic Wheel

The right-hand molded plastic wheel is located opposite the servo at the front of the robot, and it should be attached second. To attach this wheel, you will need an M3×20 mm bolt and an M3 Nyloc nut.

The presence of the left-hand wheel makes inserting the bolt from between the lugs difficult; therefore, we advise inserting the screw from the outside of the lugs, placing the nut on the inside.

Fig 7 shows a short video demonstrating the assembly of the right-hand wheel.

Note: This video has no commentary

Video showing the attachment of the plastic moulded wheel away from the servo.

Note on wheel screw tightness

When securing the molded plastic wheels, ensure that you tighten the Nyloc nut sufficiently to prevent excessive wobble while still allowing the wheel to spin freely.

Attaching the MG996 Servo

Attach the moulded plastic wheels before the MG996 Servo

You must attach both plastic wheels before mounting the MG996 servo. Otherwise, the MG996 servo body will block access to the molded plastic wheel screws.

The MG996 servo is attached to the robot chassis using 4× M3×12 mm screws, as illustrated in Fig 8. The top screws obscure access to the bottom screws, so it is recommended that you fit the bottom screws before the top screws.

Fixing screws for the MG996 Servo
Fixing screws for the MG996 Servo.

Fig 9 shows a short video demonstrating the attachment of the servo into the chassis.

Note: This video has no commentary

Video showing the attachment attachment of the servo into the chassis.

Note: The hole for the servo has been modified since this video was filmed

For structural strength and 3D-printing yield, the servo mounting cutout on many chassis models is slightly tighter than shown in the video. With a little maneuvering, the servo will fit into the rectangular cutout.

Also note: All servo mounting hardware has been standardized to M3×12 mm screws, unlike the hardware shown in the video.

Assembling the Lolly Stick D Assembly

The lolly stick assembly consists of the Sharp IR sensor, a laser-cut plywood linkage, and a servo horn for the MG996 servo, as shown at the bottom of Fig 10.

Fixing Screws for the Lolly Stick Assembly.
Fixing Screws for the Lolly Stick Assembly.

Note: You can use any of the servo horns shown at the top of Fig 10 for this assembly (we have used a cross-style horn). Attach the servo horn to the lolly stick with the spline recess facing away from the stick and the flat face flush against it, as shown in Fig 10.

We recommend assembling the lolly stick as shown in Fig 10 so that the IR sensor header terminals face upward when the lolly stick is in a horizontal position, see Fig 11.

The IR sensor is secured to the lolly stick using 2× M3×6 mm screws and 2× M3 nuts, as shown in Fig 10.

The servo horn is attached to the lolly stick using 2× 2×8 mm Phillips head flange screws.

Warning: Sharp Screws

The pointed ends of the flange screws will protrude through the opposite side of the servo horn. Handle this assembly carefully to avoid minor injuries from the exposed tips.

Attaching the Lolly Stick D Assembly to the Servo

The servo horn pushes onto the MG996 servo shaft and is secured in position using an M3×6 mm screw. Once attached, verify that the lolly stick can rotate smoothly between the horizontal and vertical positions, see Fig 11.

Info

This assembly will need to be repositioned at the start of the "Control of the Standard Servo" exercise to ensure it is calibrated correctly for the task.

Pictures of the lolly stick assembly attached to the servo, rotated into the horizontal and vertical positions.
Pictures of the lolly stick assembly attached to the servo, rotated into the horizontal and vertical positions.

Electronic Component Layout and Connections

The layout of the electronic components on the breadboard is entirely up to you; however, the following sections illustrate how they were arranged during the design and prototyping stages of these exercises. The author recommends following this layout because it matches the example code provided for the exercises and represents a proven design.

The connections for each exercise are discussed in more detail in the following sections, , but these subsections provide high-level details regarding component placement and the DC power socket.

Breadboard layouts

We suggest placing the components on the two breadboards as shown in Fig 12, with each breadboard containing:

  • Breadboard 1: The LEDs, push button, and motor driver board.
  • Breadboard 2: The DC power inlet socket, 10 kΩ potentiometer, and a 12-way header strip (used to connect the motor power, encoder, MG996 servo, and Sharp IR sensor).

The location of breadboard 1 and breadboard 2 in the robot chassis are illustrated in Fig 2 and shown in Fig 1.

Component positioning for breadboard 1 and breadboard 2.
Component positioning for (a) breadboard 1 and (b) breadboard 2.

External DC Power Socket and Connection

Some of the robot systems draw too much power to be supplied directly from the Arduino via the USB connection. If you power the MG996 servo or the DC motor directly from the Arduino, you may exceed the current limits of the +5 V rail. This can cause erratic behavior, such as the Arduino intermittently restarting—a condition known as a brownout restart.

To overcome this issue, we will use an external DC power supply to provide additional current for power-hungry components, specifically the MG996 servo and the DC motor driver board. To facilitate this, you will add a DC power connector to your robot system, as shown in Fig 13.

Annotated picture of the external power supply connector pins
Annotated picture of the external power supply connector pins.

In previous years, student setups experienced issues with the DC power connector slipping out of the breadboard. To significantly reduce the chances of this happening, a cable tie can be used to strap the DC connector down to Breadboard 2, as illustrated inFig 14.

Photograph of the cable tie used to hold the DC power connector and the  positioning of the DC power connector on the breadboard.
Photograph of the cable tie used to hold the DC power connector and the positioning of the DC power connector on the breadboard.

Note

Ensure that the cable tie is pulled tight around the board so that the connector cannot move before trimming the excess end.

The following section provides important details concerning the two different power supplies on the breadboards and MUST be read before continuing.

Arduino and External Power Supplies Lines

There are two +5V power supplies on the robot chassis:

  1. The +5V supply from the Arduino.
  2. The external +5V from the AC-DC Plug-in Power adaptor.

UNDER NO CIRCUMSTANCE should the +5V line from the Arduino be connected to the external 5V line. You must, however, connect all the GND (ground) lines of these power supplies - and other systems - to a common GND net/node on your robot chassis to ensure that all the working from the same reference voltage.

The external +5V should only be connected to the Vm connection of the motor drive board and the V+ power connections of any servo used on your system. The Arduino +5V should be used for the Vcc connection of the motor drive board and any other connection requiring +5V, that are not powered by the external +5V supply.

Danger: You can destroy your Laptop motherboard if you get this wrong

If you connect the +5 V supply of the Arduino and the external power supply together, you risk destroying your laptop's motherboard by sending a high voltage/current transient up the USB lead when the servo or DC motor operates.

Read the Disclaimer document before proceeding.

The University and MEE take no responsibility for damaged laptops due to this issue. We recommend using the University IT equipment to mitigate damaging your personal equipment.

At this point, you may have noticed how strongly we emphasize NOT connecting the external +5 V line to the Arduino +5 V line. This is because we want to avoid having to tell anyone that we cannot pay for repairs to their personal IT equipment... It is not a fun conversation to have!!

Suggested Circuit Layouts for the Exercises

The electronic system for the robot can be built incrementally as required for each exercise. The exercises are designed so that you only ever need to add components to the system, with later exercises building upon the work of previous ones. This means no circuitry needs to be removed between exercises.

Before starting any of the following exercises, you will need to add these additional elements to your robot circuit.

  1. Basic: LED Pattern
    • No extra circuitry is required for the Calibration of Potentiometer Angle Exercise. This uses the potentiometer from the LED Pattern Exercise.
  2. Basic: IR Sensor Measurement + Graph
  3. Basic: Externally Powered Servo
  4. Basic: DC Motor
  5. Basic: Encoders and Motor

Note: Advanced Exercises

The advanced exercises do not require any additional circuit building. They build directly on the circuit constructed for the final Basic Exercise: Encoders and Motor.

Note on the circuit layout diagrams in the following sections

The circuit layout diagrams in the following sections were created using different drawing tools. As a result, some components and connections may not line up perfectly. Please use these diagrams alongside the accompanying figures and tables to get a clear, complete picture of how to assemble the circuit.

Circuit Layout for the LED Pattern and Calibration of Potentiometer Angle Exercises

The following circuit layout is sufficient to complete both the LED pattern exercise. This section illustrates the layout and connections for the three LEDs and their associated resistors, the push button, and the potentiometer, as shown in Fig. 15.

Diagram showing the suggested component layout and wiring for the LED Pattern Exercise.
Diagram showing the suggested component layout and wiring for the LED Pattern Exercise.

The additional components required for this exercise (in addition to the Arduino and two breadboards) are shown in Fig. 15:

  • 3x LED
  • 3x 470Ω resistor
  • Tactile button
  • 100nF capacitor
  • Potentiometer
  • 12-way header

Fig. 15 illustrates the component layout, but for clarity, Table 1 lists the connections into the Arduino that we recommend for this section:

Arduino Pin: Description:
DIO 4Button
DIO 11LED 1
DIO 12LED 2
DIO 13LED 3
A5Potentiometer Input
Suggested Connection table for the LED Pattern Exercise.

Circuit Layout for the IR Sensor Exercise

This section illustrates how to connect the Sharp IR sensor into the circuit for the IR Sensor Measurement and Graph exercise, as shown in Fig. 16. See Fig 17 for details on the 6-way terminal board used to connect the IR sensor. You should keep the circuit wired from the previous section.

Diagram showing the suggested component layout and wiring for the IR Sensor Exercise.
Diagram showing the suggested component layout and wiring for the IR Sensor Exercise.

Extra parts required for this configuration:

  • Sharp IR Sensor
  • Sharp IR Sensor cable
  • 6-way Screw Terminal Breakout Board

The Sharp IR sensor interfaces with the breadboard using the 6-way screw terminal breakout board shown in Fig 17.

Diagram showing the pinout configuration for the 6-way screw terminal breakout board.
Diagram showing the pinout configuration for the 6-way screw terminal breakout board.

Table 2 lists the recommended Arduino connections for the Sharp IR sensor:

Arduino Pin: Description:
A4IR Sensor Output
Suggested Connection for the IR sensor output to the Arduino.

The Sharp IR sensor cable has stripped wire ends that should be connected to the 6-way screw terminal breakout board according to the pinout in Table 3, as shown in Fig. 16.

IR Sensor Wire: Description: Breakout Board Terminal:
YellowIR Sensor OutputP1
Red+5V PowerVCC
Black0V Power (GND)GND
Suggested Connection Table for the IR sensor into the 6-way breakout board.

Circuit Layout for the Externally Powered Servo Exercise

The servo will be used in the Driving a Servo Motor Exercise. Fig. 18 illustrates the connections required for the servo and the external DC power socket. You should keep the circuit wired from the previous section.

Warning

UNDER NO CIRCUMSTANCE should the +5V External power supply be connected to the +5V Arduino supply. You must, however, connect all the GND lines of these power supplies, and other systems, to a common GND net/node on your robot chassis to ensure that all components share the same reference voltage.

Diagram showing the suggested component layout and wiring for the Externally Powered Servo Exercise.
Diagram showing the suggested component layout and wiring for the Externally Powered Servo Exercise.

In addition to the Arduino and two breadboards, the extra components required for this exercise, shown in Fig. 18, are:

Note

The initial servo exercise used the SG90 (or MG90) powered from the Arduino +5V supply, rather than the external +5 V supply. Keep this in mind when building your circuit.

Table 4 lists the connections into the Arduino that we recommend for the servo exercise:

Arduino Pin: Description:
DIO 6Servomotor Signal Pin
Suggested Connection Table for the Servomotor.

Circuit Layout for the DC Motor Exercise

The DC motor exercise requires both the TB6612FG and the DC motor to be wired into the circuit, as illustrated in Fig. 19. In this section, you will wire only the power connections to the motor, not the encoder signals. You should keep the circuit wired from the previous section.

Diagram showing the suggested component layout and wiring for the DC Motor Exercise.
Diagram showing the suggested component layout and wiring for the DC Motor Exercise.

Extra parts required for this configuration:

  • TB6612FG driver board
  • DC motor
  • DC motor power cable

Due to the orientation of the TB6612FNG board on the robot chassis, we will use Channel B for these exercises. The TB6612FNG driver board is shown in Fig 20.

Picture of the TB6612FG motor driver board, with pins labelled.
Picture of the TB6612FG motor driver board, with pins labelled.

Table 5 lists the connections into the Arduino that we recommend for the DC motor exercise:

Arduino Pin: Description:
DIO 5PWM Signal Pin
DIO 7BI1 Signal Pin
DIO 8BI2 Signal Pin
Suggested Connection Table for the DC Motor.

Note

All GND pins are connected internally on the TB6612FNG breakout board; therefore, only a single GND connection to the power system is required.

Pin:Description:Connected to:
VmMotor Power System SupplyExternal +5V
VccLogic Control Power SupplyArduino +5V
GNDGroundN/C
AO1Channel A Motor Output 1N/C
AO2Channel A Motor Output 2N/C
BO2Channel B Motor Output 2Motor+ (P3 on the 6-way breakout)
BO1Channel B Motor Output 1Motor- (P4 on the 6-way breakout)
GNDGround
PWMAChannel A PWM SignalN/C
AI2Channel A Bridge Configuration Input 2N/C
AI1Channel A Bridge Configuration Input 1N/C
StandbyDriver Chip Standby SignalArduino +5V
BI1Channel B Bridge Configuration Input 1Arduino DIO 7
BI2Channel B Bridge Configuration Input 2Arduino DIO 8
PWMBChannel B PWM SignalArduino DIO 5
GNDGroundPower Supply GND
Pin connections to the TB6612FG motor driver board.

The DC motor power terminals are connected through the 6-way screw terminal breakout board, as shown in Fig. 17. The connections for the driver board are listed in Table 6.

Circuit Layout for the Encoders and Motor Exercise

The final part of the circuit to connect is the motor encoder to the Arduino, as illustrated in Fig. 21. The encoder is connected through the 12-way header, which is detailed in Table 8.

Diagram showing the suggested component layout and wiring for the Encoders and Motor Exercise.
Diagram showing the suggested component layout and wiring for the Encoders and Motor Exercise.

Extra parts required for this configuration:

  • DC motor encoder cable

Table 7 lists the recommended Arduino connections for the DC motor exercise:

Arduino Pin: Description:
DIO 2Encoder B Signal
DIO 3Encoder A Signal
Suggested Connection Table for the Rotary Encoder.

The 12-Way Header Connections

The 12-way header connector provides a convenient method for interfacing key system components—the motor, encoder, servo, and IR sensor—to the breadboard for easy integration with the rest of the electrical system. A summary of the connections used during development is provided in Table 8.

Pin:Description:Connected to:
1N/CNot Connected
2N/CNot Connected
3Encoder A SignalArduino DIO 3
4Encoder B SignalArduino DIO 2
5Encoder GNDGND
6Encoder +5VExternal +5V
7Servo SignalArduino DIO 6
8Servo +5VExternal +5V
9Servo GNDGND
10N/CNot Connected
11N/CNot Connected
12N/CNot Connected
12-Way Header Connections to robot components.

Note

During the writing of this document, a 6-way screw terminal header was added to the assembly to replace some of the 12-way header connections. As a result, several of the 12-way header connections listed in Table 8, are marked as N/C - Not Connected.