RoboSlam Instructions for CAO Open Day 2015

These instructions outline a shorter method of building the RoboSlam robot, custom adapted for the CAO Open Day in the DIT School of Electrical and Electronic Engineering (Saturday 28th March 2015).

Stage 1: Preparation

Step 1.1: Switch to Firefox

If you’re reading this in Internet Explorer, please switch to Firefox now. Some elements of these instructions will not display correctly in Internet Explorer.

A total of 22 wires are required. Each wire has been pre-cut to the required length and has 5-6 mm of its plastic insulation stripped from each end. Every piece of wire in the circuit is one of four standard lengths:

  • Short: 30mm in length, including 5-6mm stripped at each end.
  • Medium: 50mm in length, including 5-6mm stripped at each end.
  • Long: 60mm in length, including 5-6mm stripped at each end.
  • Extra Long: 100mm in length, including 5-6mm stripped at each end.

The quantity of each length in each colour is:

  • BLACK: 3 short, 2 medium, 1 extra long
  • RED: 2 short, 2 medium
  • ORANGE: 2 medium
  • PURPLE: 2 medium, 2 long
  • BROWN: 1 short, 2 medium
  • GREY: 1 medium
  • YELLOW: 1 extra long
  • GREEN: 1 extra long

wire_lengths

Stage 2: Indicator LEDs

In this stage, we build a basic breadboard circuit using the MSP430 microcontroller to blink two light emitting diodes (LEDs) on and off. These LEDs are used as indicator lights.

Step 2.1: Connect the battery pack to the breadboard

The breadboard is the rectangular plastic board with the grid of holes on the top. We use it to build and test electronic circuits quickly without any soldering. Each of the two main panels in the centre of the breadboard consists of 30 short rows of 5 connected holes. To connect any two wires (or components) together, just plug them both into the same short row. For example, wires plugged into holes a3 and e3 will become electrically connected because they’re both in the same row of 5.

The long red and blue lines on each side of the breadboard indicate that each of these long rows of holes is connected continuously along the full length of the board. We call these long rows “rails”. They are normally used to distribute supply voltage to different parts of the circuit. The red rail is used for the positive supply voltage (either 6V or 3.3V in this circuit). The blue rail is used for the negative supply voltage (0V).

Connect the battery pack to the breadboard as shown below. Put three batteries into the battery pack, but leave the last one out until the circuit is ready to be powered up.

01_batteries_and_breadboard

Step 2.2: Install the voltage regulator

The battery pack supplies 6 volts to the circuit, but this supply voltage is too high for some of the components in our circuit, so we need to use a voltage regulator to provide a lower voltage. The LF33ABV is a 3.3 volt regulator which we connect as shown below to feed a stable 3.3V supply to the red rail on the right hand side of the breadboard.

  • Very carefully insert the LF33ABV voltage regulator (the black rectangular component with three legs and a metal back plate) into holes c28, c29 and c30 of the breadboard. The metal back plate of the voltage regulator should be on the left, as shown in the illustration below. It’s tricky to coax the three legs of the LF33ABV into the breadboard without bending them, so be careful!
  • Connect a short red wire between hole a30 and the red rail on the left-hand side of the breadboard (6V).
  • Connect a short black wire between hole a29 and the blue rail on the left-hand side of the breadboard (0V).
  • Connect a medium orange wire between hole e28 and the red rail on the right-hand side of the breadboard (3.3V).
  • Connect a medium black wire between hole e29 and the blue rail on the right-hand side of the breadboard (0V).
  • Connect a 220uF capacitor between the two rails on each side of the breadboard, as shown below. The capacitor is the small purple cylindrical component with two parallel legs sticking out the bottom. These capacitors act as reservoirs of electric charge, reducing unwanted fluctuations of the 6V and 3.3V supply voltages. Note that the minus leg of the capacitor, which is marked by a long black stripe running down the body of the capacitor, must be connected to the blue rail (0V).

02_voltage_regulator_mar2015

Step 2.3: Install the MSP430 microcontroller

WARNING: The MSP430 chip is very fragile! The pins bend and break easily, so be careful when placing it into the breadboard.

The “brain” of the robot is the MSP430 microcontroller. A microcontroller is a complete computer on a single chip. It contains a microprocessor, RAM memory, flash memory (like in a USB memory stick) and other useful features.

Place the MSP430G2553 microcontroller in the position shown. Make sure that the end of the chip with the semi-circular indentation is in row 3.

03_msp430_ic_Mar2015

Step 2.4: Connect the voltage supply to the MSP430

To supply power to the MSP430 microcontroller,

  • Connect a medium orange wire between hole d3 and the red rail on the right-hand side of the breadboard (3.3V).
  • Connect a short black wire between hole j3 and the blue rail on the right-hand side of the breadboard (0V).

To prevent the microcontroller from resetting while the robot is running, a 10kΩ resistor (colour code: brown, black, orange, gold) must be placed between hole i7 and the red rail on the right-hand side of the breadboard (3.3V).

04_msp430_power_and_reset_resistor_mar2015

Step 2.5: Add two indicator LEDs

  • Connect the green LED between hole e1 and hole e2. One side of the LED is slightly flattened. That’s the side that should be connected to hole e1.
  • Connect a 220Ω resistor (colour code: red, red, brown, gold) between hole b1 and the blue rail on the left-hand side of the breadboard (0V). This resistor limits the amount of current that flows through the green LED so that it doesn’t burn out.
  • Connect a short brown wire from hole c2 to hole c4. This wire will supply current from pin 2 (which is also called P1.0) of the MSP430 to the green LED.
  • Connect the red LED between holes f1 and f2. The side of the LED that is slightly flattened should be connected to hole f1.
  • Connect a 220Ω resistor (colour code: red, red, brown, gold) between hole j1 and the blue rail on the right-hand side of the breadboard (0V). This resistor limits the amount of current that flows through the red LED so that it doesn’t burn out.
  • Connect a medium brown wire from hole h2 to hole h8. This wire will supply current from pin 15 (which is also called P1.7) of the MSP430 to the red LED.

05_leds_Mar2015

At this point, the two LEDs should be flashing on and off, alternating between red and green. If not, please ask a facilitator to check your circuit.

Stage 3: Motor control

Step 3.1: Install the SN754410NE motor driver chip

  • Remove at least one battery from the battery holder to power down the robot.
  • Add the SN754410NE driver chip to the breadboard as shown below. The end of the chip with the semi-circular indentation must be in row 19.

07_sn754410ne_ic_Mar2015

Step 3.2: Connect the voltage supply to the motor driver chip

Add the supply voltage connections shown below:

  • A short red wire between the left-hand red rail (6V) and hole a26.
  • A short black wire between the left-hand blue rail (0V) and hole a23.
  • A medium red wire between holes d26 and g19.

08_sn754410ne_power_Mar2015

Step 3.3: Connect the digital outputs of the microcontroller to the inputs of the SN754410NE driver chip

Add the connections shown below. These allow the microcontroller to send signals to the driver chip to control the motors:

  • A long purple wire between hole d10 and hole d25.
  • A medium purple wire between hole d11 and hole d20.
  • A long purple wire between hole d12 and hole g25.
  • A medium purple wire between hole g12 and g20.

09_motor_signals_Mar2015

Step 3.4: Connect the motors to the driver chip

  • Connect the wires of the left motor to holes c21 and c24
  • Connect the wires of the right motor to holes h21 and h24

There’s no need to worry about which way around you connect the wires for each motor. If the motor turns the wrong way, you can simply swap the wires around later on.

10_motor_Mar2015

To test the motors and ensure we can control them in both directions, we will make the robot drive in a zig-vag pattern. To enable the “zig zag” behaviour, simply connect a medium wire between hole d5 and the blue (0V) rail on the left side of the breadboard.

09a_zigzag_behaviour_Mar2015

At this point, the robot should be driving in a zig-zag pattern. If not, please ask a facilitator to check your circuit.

Stage 4: Rangefinder

Step 4.1: Add the rangefinder and connect it to the microcontroller

The rangefinder is an ultrasonic distance sensor.

  • Add the rangefinder to the breadboard in the position shown (holes j14, j15, j16 and j17).
  • Connect a medium black wire from the left-hand blue rail (0V) to hole f14.
  • Connect a medium red wire from the left-hand red rail (6V) to hole f17.
  • Connect a medium brown wire between hole h9 and hole h16. This wire is used to transmit a trigger pulse from the MSP430 to the ultrasonic sensor each time the distance needs to be measured.
  • Connect the diode between hole e15 and hole f15, taking care that the end of the diode with the black stripe is inserted into f15.
  • Connect a medium grey wire between hole c9 and hole c15. This wire is used to transmit the “echo” pulse from the ultrasonic sensor to the MSP430 each time the distance has been measured. The duration of the echo pulse is proportional to the distance measured.
  • Connect a 10kΩ resistor (colour code: brown, black, orange, gold) between hole a3 and hole a9.

12_rangefinder_Mar2015

To test the rangefinder, we will make the robot perform a simple sumo wrestling action. When an object is detected in front of the rangefinder, the robot drives forwards, but when nothing is detected, the robot turns around on the spot.

13_sumo_behaviour_Mar2015

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s