Unformatted text preview:

Department of Mechanical Engineering 2.017 Design of Electromechanical Robotic Systems, Fall 2009 Lab 1: Introduction to Microcontrollers 1 Overview Welcome to 2.017 lab! The purpose of this lab is for you to get familiarized with the lab space and the equipment in the lab. We will then learn about a microcontroller called Arduino that we will be using in the formal labs. The Arduino microcontrollers are very popular because of their ease of use, and they provide a good balance between capabilities and cost. Thanks to their popularity, you can find a wealth of information on the web about these microcontrollers. You may want to check out Arduino’s official web site at http://www.arduino.cc/ first to find out more information. Each group will be given an experimentation kit (offered by http://www.oomlout.com) that includes all the pieces needed to complete 11 different circuits, along with an experimenter's guide booklet and breadboard layout sheets. You need to keep the kit and its contents in a safe place when you are done with the lab. You can also take the kit with you if you want to experiment with the microcontroller outside the lab, but make sure you take good care of it and bring it back for the next lab. The last half hour of the lab is set aside for project discussion. Today you will need to formulate your team and decide which project you want to do. 2 Arduino Experimentation Kit The circuits in the Arduino kit are designed to explore microcontroller basics, covering LEDs, transistors, motors, integrated circuits, pushbuttons, variable resistors, photo resistors, temperature sensors and relays. They represent common sensors, actuators, and circuitry that are important for building a robotic system. You will also find them helpful for your lab project. The kit includes the following components: x Arduino Prototyping Bundle: Arduino Duemilanove board (http://arduino.cc/en/Main/ArduinoBoardDuemilanove), breadboard & acrylic holder x 75 Piece Jumper Wire Bundle x Printed 29 page Experimenter's Guide x 11+1 Breadboard Layout Sheets x USB Cable x Multi-compartment Plastic Storage Box x Loads of components o 5mm Red LEDs (x10) 2.017 Fall 2009 11Department of Mechanical Engineering o 5mm Green LEDs (x10) o 10mm Blue LED (x1) o Toy DC Motor (x1) o Mini Servo Motor (x1) o 8-Bit Shift Register (74HC595) (x1) o Piezo Element (x1) o Pushbuttons (x2) o Potentiometer (10k) (x1) o Photo Resistor (x1) o Temperature Sensor (TMP36) (x1) o Relay (5v DPDT) (x1) o Transistors (P2N222A) (x2) o Resistors (560 Ohm x25, 2.2k Ohm x3, 10k Ohm x3) o Diodes (1N4001) (x2) For this lab you need to complete the fowling 4 circuits: x {CIRC01} Getting Started - (Blinking LED) x {CIRC02} 8 LED Fun - (Multiple LEDs) x {CIRC07} Button Pressing - (Pushbuttons) x {CIRC08} Twisting - (Potentiometers) We will finish the rest of the circuits in the next few labs. We encourage you to explore the components and circuits if you finish your circuits early. 3 Setting Up and Programming Arduino The goals for this microcontroller lab are for you to learn how to: x setup the Arduino and the development software on the host computer x write simple C code and download to the Arduino x interact with simple sensors and actuators x acquire data to the host computer through the USB port Follow the instructions on Page 3 of the User’s Guide to download and install the Arduino Development software and to setup the USB driver. Using the included USB cable, plug your Arduino board into a free USB port on the computer. You will then need to find out the correct USB Serial Port that is connected to the Arduino. For this, click the “Start” menu and select “Run…” then type in the command 2.017 Fall 2009 22Department of Mechanical Engineering “devmgmt.msc” and click “OK”. From the “Device Manager” window locate the COM port number that corresponds to the USB Serial Port, as shown in Figure 1. Now run the Arduino software by double-clicking the shortcut on Window’s desktop. You should then see the Arduino software development window on the Windows desktop as shown in Figure 2. Before we can communicate with the Arduino board we need to configure the software to point to the correct microcontroller board and serial port. This is normally a one-time configuration so long as you use the same computer and the Arduino board. From the “Tools” menu, click “Board” and select “Arduino Duemilanove w/ATmega328”, then click “Serial Port” and select the correct COM port for the USB Serial Port that we just found. Now open the “Blink” example code and click the “Upload to I/O Board” icon on the tool bar. This will compile, build, and download the code to the Arduino board. You should see a blinking LED light on the board once it is done uploading. After you have successfully configured the board, you should be ready to try out today’s circuits. The teaching staff will help you resolve any problems you may encounter. 2.017 Fall 2009 33Department of Mechanical Engineering Figure 1. Locating the USB Serial Port on the Device Manager Window 2.017 Fall 2009 4 4Department of Mechanical Engineering Figure 2. Arduino software development environment 4 Deliverables x Show and explain each completed circuit to the teaching staff. x Show the teaching staff your lab notebook. 2.017 Fall 2009 55Courtesy of Arduino.cc. Used with permission.MIT OpenCourseWarehttp://ocw.mit.edu 2.017J Design of Electromechanical Robotic Systems Fall 2009 For information about citing these materials or our Terms of Use, visit:


View Full Document

MIT 2 017J - Study Guide

Documents in this Course
Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?