Tufts Datalogging Book 1

Embed Size (px)

Citation preview

  • 7/30/2019 Tufts Datalogging Book 1

    1/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and Outreach

    LEGO Engineering Conferences

    ROBOLAB and MINDSTORMS EducationVersion 5.0 December 2009

    NXT-G Data Logging Book I: Introductory

    Robotic Activities for use with the NXT

  • 7/30/2019 Tufts Datalogging Book 1

    2/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 1

    NXT Data Logging Book DI: Introductory

    Data Logging Activities for use with the NXT

    This purpose of this book is to help you develop a basic understanding of how to collectand graph data using the LEGO MINDSTORMS program and the NXT brick. Each

    activity in this book contains learning objectives and step-by-step programminginstructions that illustrate how to conduct data logging experiments. At the end of each

    activity, an open-ended Exploration Taskprovides you with the opportunity to practicethe techniques you just learned.

    In these introductory activities, the primary focus points include creating data logging

    experiments, integrating data logging experiments into NXT programs, and displayingdata in the NXT Data Logging workspace. The Introductory activities involve collecting

    data from the NXT touch sensor, NXT light sensor, NXT rotation sensor, and the NXTsound sensor.

    Activities in this book assume that the user has experience programming with blocks inLEGO MINDSTORMS. You should also be able to modify the blocks using theconfiguration panel. If you do not have experience programming in LEGO

    MINDSTORMS, please reviewNXT-G Software Book I: Introductory.

    Activities Level Page

    Finding the Light 1 DI - 2

    Voting Booth 1 DI - 8

    Measuring Wheel 2 DI - 14

    Into the Dark 2 DI - 20

    Hidden Letter 2 DI - 27

    Additional Required Materials

    These materials are not provided with the Conference Kits, and must be colletedseparately before attempting any of the activities in this workbook.

    Materials Number

    Meter or Yard stick 2

    Roll of broad black tape (electrical tape) 3Roll of white tape 2

    Pair of Scissors 1Power adaptor for charging NXT Brick 2

    Large print-out of letters of the alphabet 1

    Some sort of construction to hide a letter so that a data collector cannot see what theirNXT vehicle is driving over (chair covered by cloth, cardboard box tunnel, etc)

  • 7/30/2019 Tufts Datalogging Book 1

    3/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 2

    Level 1 Data Logging

    Find the Light

    Learning Objective:

    Understand how to collect information from the light sensor using both the NXT brickand theNXT Data Loggingfeature in NXT MINDSTORMS v. 2.0.

    Challenge:

    In this challenge, you will be asked to use your NXT brick and a light sensor to collectlight sensor information. You will first use the view feature on your NXT to read light

    levels in the room to become accustomed to using this sensor to collect data. This datawill be displayed numerically on your NXT screen. You will then attach your NXT and

    light sensor to your computer to read light levels in the environment around yourcomputer. With data displayed graphically.

    Building Procedure:

    NOTE: This activity will not involve building an NXT vehicle.

    Step 1: Using a wire, attach an NXT light sensor to your NXT brick via port 2.

    Light Sensor:

    Using the NXT

    Step 1: Turn on the NXT by selecting the orange button. The NXT will turn on to show

    the main menu.

    Step 2: Using the grey arrow buttons, navigate through the menu until you see the view

    icon.

  • 7/30/2019 Tufts Datalogging Book 1

    4/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 3

    Step 3: Select View by pressing the orange select button. You will be directed to a listof sensors. Navigate to the ambient light icon using the grey navigation buttons. Select

    this menu option by pressing the orange select button.

    Note: Ambient light measures the light levels in the environment around the light sensor.Reflected light measures the amount of light that is returned to the light sensor from light

    that it generates itself. The Ambient Light option is what you should use when youwant to know about light levels surrounding the NXT. The Reflective Light option is

    what to use to measure light reflected off of materials (darker, less shiny materials willnot reflect much light, whereas lighter, more reflective materials will reflect a lot of light)

    Step 4: You will be directed to a menu of ports. Navigate to the correct port using the

    grey arrow buttons. Select the correct port (input port 2) using the orange select button.

    Step 5: At this point, you will be able to view the light levels that your light sensor is

    measuring. Walk around the room to find the darkest spot you can and the lightest spotyou can. The NXT measures light levels on a scale of 0 100, with 0 being the darkest,

    100 being the lightest.

    Step 6:Notice the value of light in different areas of the room. You will useNXT dataloggingto measure light levels at your desk, so keep in mind the values to see if you can

    replicate the highest and lowest values when sitting at your desk.

    Programming Procedure:

    Step 1: Open up NXT MINDSTORMS v. 2.0.

    Step 2: Access the NXT Data Loggingmenu by clicking on the button at thetop of theNXT Programmingmenu.

  • 7/30/2019 Tufts Datalogging Book 1

    5/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 4

    Step 3: You will be directed to theNXT Data Loggingmenu shown below:

    Step 4: Type the name of your experiment into theNXT Data Loggingmenu in the StartNew Experimenttitle box.

    Step 5: Click the button to the right of the orange Start New Experimenttitlebox to continue.

    Step 6: The Experiment Configuration panel will appear. You will be collecting light

    sensor data from a light sensor wired to port 2, for 10 seconds, at a rate of 5 light sensorsamples a second. This will give you a total of 50 data points. Configure the experiment

    as shown below:

    Step 7: In the Experiment Configuration panel, the experiment will automatically look

    for reflected light, for this experiment you want to collect ambient light data. To do this,uncheck the reflected light option in the experiment configuration panel. Shown below:

    Step 8: TheNXT Data Logging workspace should now appear andlook similar to the image below:

    Note: You are measuring light levelsin the environment, which is why you

    want to measure ambient rather thanreflected light.

  • 7/30/2019 Tufts Datalogging Book 1

    6/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 5

    There are five main areas in the Data Logging workspace:

    Area 1 The Data Logging toolbar, which contains tools for manipulating data.Area 2 The Navigation Space, used to select different experiment tabs.

    Area 3 The Data Logging Graph, which displays collected data as line graphs.

    Area 4 The Data Logging Controller, which allows for information transfer

    between the computer and the NXT Brick.Area 5 The Dataset Table, which displays the collected data as numbers.

    Data Collection:

    Step 1: Attach your NXT brick to your computer via the USB cable.

    Step 2: Now you are ready to run your experiment. To collect data, click on the play

    button in the center of the Data Logging Controller at the lower right corner of your datalogging workspace (Area 4). This button will collect the data from your NXT brick as

    you sit at your desk.

  • 7/30/2019 Tufts Datalogging Book 1

    7/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 6

    Step 3: While the experiment is running, examine the environment at your desk by

    pointing your light sensor in different directions. Try to find the darkest and the lightestareas around your computer, can you replicate the numbers you got when you walked

    around the room examining light sensor values on your NXT? Remember that you onlyhave 10 seconds to collect your data.

    Data Analysis:

    Step 1: Your graph should look similar to the graph shown below. The peaks will

    indicate when the light sensor was in the lightest area(s) and the valleys indicate when thelight sensor was in the darkest area(s):

    Step 2: To analyze your graph you can use the section analysis tool located in the toptoolbar:

  • 7/30/2019 Tufts Datalogging Book 1

    8/34

    Find the Light Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 7

    Step 3: This tool will automatically place a section on your graph. Move the section by

    selecting the left or right edges and dragging them to the spot that you want to start or endthe analysis. Use the section analysis tool to find the minimum value and maximum value

    on your graph as shown below:

    Step 4: You can also analyze your data in the data set table below your graph. You canlook at the amount of light the sensor was detecting at each interval of your experiment,

    as shown below:

    Further Experimentation:

    Data logging allows you to collect and store information over a period of time. You canreconfigure this experiment to collect data on light levels over much longer periods of

    time, say 24 hours. This type of experiment would show how the light levels in a roomwould change over the course of a day as the lights are turned on/off and as the sun goes

    up and down.

  • 7/30/2019 Tufts Datalogging Book 1

    9/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 8

    Level 1 Data Logging

    Voting Booth

    Learning Objective:

    Understanding how to collect and analyze data from two touch sensors inNXT DataLogging.

    Challenge:

    In this challenge, you will write an experiment to collect data from two touch sensorswired to your NXT brick to make a voting booth. You will think of a yes/no question

    for the group/class to vote on. Other people will vote on your question by pressing one oftwo sensors on your voting booth to give their answer(s). You will total the number of

    votes by counting peaks on your graph.

    Building Procedure:

    Step 1: Think of a yes/no question that you would like to survey other people in the room

    about. Write this question on an index card.

    Step 2: Wire one touch sensor to port 1 on your NXT brick and label this sensor Yeswith a piece of masking tape or half of an index card. You should secure the sensor using

    a beam and pegs so that it is mounted on one side of the NXT brick.

    Step 3: Wire the other touch sensor to port 3. Secure the touch sensor to the other side of

    your NXT brick using beams and pegs. Label this touch sensor No.

    Programming Procedure:

    Step 1: Open up NXT MINDSTORMS v. 2.0. Click on the icon in the upper

    left.

    Whats your vote?

    YES NO

  • 7/30/2019 Tufts Datalogging Book 1

    10/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 9

    Step 2: You will be directed to the Start Data Loggingwindow. Type the name of yourexperiment in the Start New Experimentbox.

    Step 3: Click the button to the right of the orange Start New Experimenttitle

    box to continue.

    Step 4: The Experiment Configuration Panel will now appear. Configure the experiment

    as shown below. You will be collecting data for 300 seconds at a rate of 5 samples persecond from two separate touch sensors, one wired to port 1 and the other to port 3.

    Step 5: Click to proceed to the data logging workspace.

    Data Collection:

    Step 1: Connect your voting booth (NXT brick) to your computer via the USB cable.Step 2: You will leave your experiment at your computer while you walk around the

    room to vote at other groups voting booths. Place your voting booth next to yourcomputer and set it up so that people can read the question on the index card and vote on

    the question using your NXT voting machine while you are away.

    Step 3: When everyone in the class is ready to vote, begin your experiment by clickingon the play button in the center of your data logging control panel at the lower rightcorner of the graphing space, as shown below:

    Step 4: You will have 5 minutes (300 seconds) for your experiment to run, collecting

    votes, while you vote on other groups questions. At the end of the 5 minutes, return toyour computer to analyze your data.

    Data Analysis:

    Step 1: Your graphs should look similar to the graph shown below. There should be twoseparate graphs, one for each sensor. A value of 1.0 indicates that the touch sensor was

    depressed by someone voting on at your voting booth. It may be difficult to see thedifference between the two separate graphs.

  • 7/30/2019 Tufts Datalogging Book 1

    11/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 10

    Step 2: To make it easier to differentiate the two graphs, you can change the color of the

    graph by clicking on the Plot Color/Style in the Dataset Table area below the graph:

    Step 3: Choose two contrasting colors for your graph, like the graph shown below:

    Step 4: Next you will hide one graph, so that you can examine the number of peaks on

    the other. This will allow you to count how many yes votes, and how many no votesthere were. To hide a graph, click on the eye icon,as shown below:

    Step 5: Count the peaks on the graph for touch sensor 1:

  • 7/30/2019 Tufts Datalogging Book 1

    12/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 11

    1 2 3 4 5 6 7 8 9 10

    Touch sensor 1 votes: 10

    Step 6: Hide the graph for touch sensor 1 and show the graph for touch sensor 3. Count

    the number of peaks on the touch sensor 3 graph.

  • 7/30/2019 Tufts Datalogging Book 1

    13/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 12

    1 2 3 4 5 6 7

    Touch sensor 3 votes: 7

    Step 7: You can also analyze your data by examining your Dataset Table. A value of 1.0indicates the sensor is pressed and a value of 0.0 indicates that the touch sensor is not

    being depressed.

    Reflection:

    This activity shows how data collection can be automated and used to collect data frommultiple sensors while you are not actually by your NXT, producing visible results.

    Think of other experiments that could be set up in a similar way.

  • 7/30/2019 Tufts Datalogging Book 1

    14/34

    Test Your Knowledge Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 13

    Explore What You Have Learned

    Challenge: Below are some suggestions of ways that you can use what you have learned

    about data logging to do further exploration. Can you think of any other ways to test yourknowledge?

    What is the lowest and highest light level readings you can get when you sit atyour computer?

    What light level readings do you get when you cover the light sensor with yourhand?

    Think of other questions to vote on using your touch sensors.

    What values to do get when you check the reflected light option and point thelight sensor at different materials?

    TestYourKnowledge

  • 7/30/2019 Tufts Datalogging Book 1

    15/34

    Measuring Wheel Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 14

    Level 2 Data Logging

    Measuring Wheel

    Lesson Objectives:

    In this lesson you will use your NXT vehicle to figure out how many rotations yourwheels make over a certain distance.

    Challenge:

    In this challenge, you will configure an experiment inNXT Data Loggingto performremote data collection of rotation sensor data. You will download this experiment to your

    NXT brick and disconnect it from the computer. You will then physically push yourvehicle along the ground over a specified distance to perform the experiment. You will

    upload this rotation sensor data to decipher how many rotations your wheels make as thecar is rolled a specific distance. You can use this data to figure out how many rotations it

    will take your car to drive a mystery distance.

    Building Procedure:

    Step 1: Build an NXT two-motor vehicle.

    Step 2: Wire one motor to output port B and the other to output port C.

    Programming Procedure:

    Step 1: Open up NXT MINDSTORMS v. 2.0. Click on in the upper left.

    Step 2: You will be directed to the StartData Loggingmenu. Type the name of yourexperiment in the Start New Experimentbox.

  • 7/30/2019 Tufts Datalogging Book 1

    16/34

    Measuring Wheel Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 15

    Step 3: Click the button to the right of the orange Start New Experimenttitle

    box to continue.Step 4: The Experiment Configuration Panel will appear. Configure your experiment to

    collect rotation sensor data from output port B for 10 seconds at a rate of 5 samples asecond. Shown below:

    Step 5: Click ok to open your new experiment.

    Data Collection:

    Step 1: Unlike the previous two data logging activities, you will download your programto your NXT and disconnect the vehicle from the computer to collect data. To do this,

    connect your NXT vehicle to your computer via the USB cable. Click the downloadbutton (shown below) to transfer your experiment from the computer to the NXT brick.

    Step 2: Disconnect your NXT vehicle from the USB cable. Bring the vehicle to a tape

    measure or ruler on the floor.

    Step 3: Run the experiment on your NXT. Navigate to the software file of your

    experiment by selecting the orange button. Select the file and click Run to start yourexperiment. Once your program is running, physically roll your NXT vehicle along the

    ground for a measurable distance (e.g.1 meter, 5 feet, 16 inches).

    Step 4: Return to your computer and reconnect the USB cable to the NXT brick. Click onthe upload button to transfer the data from your NXT brick to the computer.

  • 7/30/2019 Tufts Datalogging Book 1

    17/34

    Measuring Wheel Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 16

    Step 5: The following box will appear and will list all the experiments that are stored onyour NXT:

    Note: All logs that are stored on your NXT will be displayed here. The most recent logwill be at the very top of the logs that are listed. You can delete logs to make space on

    your NXT by clicking on a log and then clicking the delete button in the lower leftcorner.

    Step 6: Click on the experiment(s) you would like to upload, they should be highlighted

    (shown below):

  • 7/30/2019 Tufts Datalogging Book 1

    18/34

    Measuring Wheel Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 17

    Step 7: In the lower right-hand corner of the screen you should select open log in theAfter Upload dialog box. This will open the data set selected in a new window. If you

    select import log, you can open multiple data sets in the same window. For thisexperiment you will only need to open one data set.

    Step 8: Click ok to open your graph and begin analysis.

    Data Analysis:

    Step 1: The graph of your rotation sensor data should appear in the graphing space andlook similar to the graph shown below:

    Step 2: To change the y-axis of your graph so that you have a better view of your graph

    click on in the lower left-hand corner.

    Step 3 (Point Analysis): You can find the total number of rotations using two different

    analysis tools, point analysis and section analysis. First select the point analysis tool fromthe tool bar at the top of the graphing window:

  • 7/30/2019 Tufts Datalogging Book 1

    19/34

    Measuring Wheel Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 18

    Step 4 (Point Analysis): When you select this tool, the computer will automaticallyplace the point analysis bar onto your graph. You should move this point to the highest

    point on your graph by clicking on the yellow line and holding down your mouse to movethe line.

    Step 5 (Section Analysis): Use the section analysis tool to accomplish the same task.When you select the section analysis tool it will automatically place a grey bar on your

    graph:

    Step 6: Move the grey bar to cover the entire graph. The maximum value will be the total

    number of rotations that the wheel on your NXT vehicle made over the distance youpushed it.

    Optional Challenge:

    Step 1: The instructor will give a mystery distance for your vehicle to travel.

    Step 2: Click to open up a new program where you will tell your car to drive

    (separate from your experiment). Call your new program drive:

  • 7/30/2019 Tufts Datalogging Book 1

    20/34

    Measuring Wheel Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 19

    Step 3: click Go to open up the programming window. Place a move block into your

    drive program:

    Step 4: Using the information collected in your graph, figure out how many rotationsyour wheels must make to travel the distance specified by the instructor. Use the

    proportion you came up with in your experiment (e.g. 2 rotations for 6 inches or 2 rot/6in) Cross multiply to figure out the number of rotations you will need to travel the

    distance specified by the teacher

    # of rotations from experiment = ? RotationsDistance from experiment mystery distance

    Example:

    2.75 Rotations = ? Rotations1 Foot 3 Feet

    = 2.75 x 3 = 8.25 Rotations

    Step 5: In the configuration panel of the move block, enter this number of rotations youcalculated:

    Step 6: Connect your vehicle to the computer via the USB cable. Download yourprogram by clicking on the download button in the lower right corner of the

    programming workspace.

    Step 7: Disconnect your vehicle from the USB cable, and run your program by selectingit with the orange button the NXT brick. Measure how far your car travels when you run

    the program. Did it travel the distance the instructor specified?

    Conclusion:

    This activity can be connected to the Going the Distance programming activity in

    which you program your car to travel for several different times, measure the distanceyour vehicle travels, and create a distance-time graph. The graph is then used to predict

    how long you must program your vehicle to drive to stop after a mystery distance. Thinkabout the pros and cons of using time or rotation measurements to program your vehicle

    to travel a given distance.

  • 7/30/2019 Tufts Datalogging Book 1

    21/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 20

    Level 2 Data Logging

    Into the Dark

    Lesson Objectives:

    To understand how to collect data from a moving NXT vehicle. This lesson requires theuse of both NXT Data Logging and programming.

    Challenge:

    In this challenge, you will combineNXT Data Loggingand Programming to accomplish atask. You will write an experiment to collect light sensor data. You will incorporate this

    experiment into a program so that you can collect data as your car drives. You will thenupload the data to analyze how the environment around the car changes as it drives.

    Building Procedure:

    Step 1: Construct a two-motor NXT vehicle. Attach a light sensor to the front of the car.Orient the light sensor so that it is pointed horizontally.

    Step 2: Wire one motor to output port B and the other to output port C.

    Step 3: Wire the light sensor to input port 2.

    Programming Procedure:

    Step 1: Open NXT MINDSTORMS v. 2.0. Click in the upper left corner ofthe window to openNXT data logging.

    Step 2: Type the name of your experiment in the Start New Experimentbox.

  • 7/30/2019 Tufts Datalogging Book 1

    22/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 21

    Step 3: Click the button in the Start New Experimenttitle box to continue.

    Step 4: The Experiment Configuration Panel will appear. Configure your experiment tocollect light sensor data from input port 2, for 10 seconds, at a rate of 5 samples a second.

    You should collect ambient light conditions. Therefore, uncheck the reflected lightoption. Shown below:

    Step 5: Click ok at the bottom of the Experiment Configuration panel to open the

    graphing workspace.

    Step 6: You will now use the experiment that you configured in step 4 in a program thatwill collect this information as the NXT vehicle performs other actions. In the Tools

    menu option on the top bar of your computer, select Create Data Logging Program

    Step 7: The NXT programming window will appear with a programming block already

    in the workspace. This programming block is a Start Datalog block, which signals your

    NXT to record information from the environment depending on how your experiment isconfigured.

    Step 8: Add a Move Block to the program so that your car will drive as it collects data.Place this block before the Start Datalog Block. The Move Block is found in the common

    menu.

    Step 9: Configure the Move Block as shown below. The block should signal the car todrive straight for an unlimited amount of time. Because the NXT brick reads programs

  • 7/30/2019 Tufts Datalogging Book 1

    23/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 22

    from left to right, it will read the Move Block, tell the motors to turn, and then read theStart Datalog block to begin the experiment as the car is driving.

    Step 10: Configure the Start Datalog block like the one shown below. You should be surethat the wait for completion option is checked. This ensures that the program will not

    move to the next block until the data logging has taken place.

    Step 11: Add a Move Block after the Start Datalog block to stop the car after theexperiment is complete:

    Step 12: Configure this Move Block as shown below:

    Step 13: Click on File in the top tool bar and save your file as lightdrive.

    Step 14: Connect your NXT vehicle to the computer via the USB cable. Download the

    program to your NXT vehicle by clicking the download button in the lower right corner.

  • 7/30/2019 Tufts Datalogging Book 1

    24/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 23

    Data Collection:

    Step 1: Disconnect your NXT vehicle from your computer and bring it to an area of the

    room with enough space for your car to drive forward for 10 seconds, but so that it will

    drive into a darker area, like under a desk, or away from a light source.

    Step 2: Select the lightdrive program from the software files, and select Run using the

    orange button to begin your program. Your car should drive forward for 10 seconds,collecting light sensor data as it drives.

    Step 3: Make multiple runs (2 3) of different areas in the room, you will compare these

    samples as graphs in NXT data logging.

    Data Analysis:

    Step 1: Return to your computer and reconnect your NXT vehicle to the USB cable.Return toNXT data loggingby clicking on the icon in the upper left corner:

    Step 2: Click on the upload button in the lower right corner of your graphing space:

    Step 3: Your log files will appear. If you only want to open one of your logs, highlight

    the log file by clicking on it. At the bottom right of the screen, select open log and clickon upload

    Step 4: To upload multiple log files, select the log files, check the option import log,and click the upload button:

  • 7/30/2019 Tufts Datalogging Book 1

    25/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 24

    Step 5: You will be directed to the graphing workspace inNXT data logging. The graphs

    of the log files that you just imported should appear. Change the color of these graphs sothat you can easily identify them by clicking on the change color/plot icon.

    Step 6: Zoom into the graphs by clicking in the lower left corner of your graph,

    below the y-axis. Your resulting graph should look similar to the graph below:

    Step 7: You can use the analysis tools to examine differences between your two graphs.Click on the section analysis tool from the toolbar about your graphing space:

    Step 8: Drag the section analysis tool to cover the entire 10 seconds of your logs by

    clicking on either side of the bar and dragging it to the edge of the graph. You can viewthe minimum and maximum values for each graph and compare these values:

  • 7/30/2019 Tufts Datalogging Book 1

    26/34

    Voting Booth Book DI: NXT Data LoggingLevel 1

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 25

    Step 9: Select the Show Linear Fit option at the bottom of the section analysis box.This will place two linear fit lines on your graph and give you the equation for these

    lines. Compare the slope of these graphs. Which situation did the light levels change thefastest? Which situation did it change the slowest?

  • 7/30/2019 Tufts Datalogging Book 1

    27/34

    Test Your Knowledge Book DI: NXT Data LoggingLevel 2

    Copyright 2009 Tufts University Center for Engineering Education and OutreachD1 - 26

    Explore What You Have Learned

    Challenge: Below are some suggestions of ways that you can use what you have learned

    about data logging to do further exploration. Can you think of any other ways to test yourknowledge?

    Can you program the car to turn while it collects light sensor data rather thandriving in a straight line?

    Program your car to drive while it collects light sensor data. And then drive backto you so that you do not have to go retrieve it.

    Program your car to collect rotation sensor data as it drives. How many rotationsper second is your car driving? What if you change the power level? Run multipletrials to test different power levels.

    Test

    YourKnowledge

  • 7/30/2019 Tufts Datalogging Book 1

    28/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    DI - 27Copyright 2009 Tufts University Center for Engineering Education and Outreach

    Level 2 Data Logging

    Hidden Letter

    Learning Objective:

    To understand how to collect data from a moving NXT vehicle, and how to interpret thisdata usingNXT Data Logging.

    Student Challenge:

    In this challenge, you will program your NXT vehicle to collect light sensor data while itis driving. The vehicle will drive over a letter of the alphabet that is hidden from view in

    different positions to collect light sensor data. You will use this data to decipher whichletter of the alphabet your NXT has driven over.

    Building Procedure:

    Step 1: Build a NXT two-motor car with a light sensor mounted vertically so that it canmeasure reflected light levels off of the floor.

    Step 2: Wire one motor to output port B and the other motor to output port C.

    Step 3: Wire the light sensor to input port 1.

    Programming Procedure:

    Step 1: Open NXT MINDSTORMS v. 2.0. Click t o access theDataLoggingmenu.

    Step 2: In theData Loggingmenu, type the name of your experiment Hidden Letter -into the orange Start New Experimenttitle box.

  • 7/30/2019 Tufts Datalogging Book 1

    29/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    DI - 28Copyright 2009 Tufts University Center for Engineering Education and Outreach

    Step 3: Click the button to the right of the Start New Experimenttitle box.

    Step 4: The experiment configuration panel will appear. Configure your experiment like

    shown below. Collect reflective light sensor data for a period of 10 seconds at a rate of 5samples per second.

    Step 5: You should be sure that the reflected light option is checked. Since you arecollecting information from a piece of paper that may be hidden in a dark space, it is

    important that your light sensor is generating light. The NXT will measure the amount of

    light that is reflected back from the light that it is generating. This will be useful indetecting the differences between the white and black areas on the paper.

    Step 6: To collect data while your NXT vehicle is driving, you must convert theexperiment that you just configured (Hidden Letter) into a programming block.

    Select the Create Data Logging Program under the Tools menu in the top toolbar.

    Step 7: The NXT programming interface will appear with a programming block already

    in the workspace. This programming block is a Start Datalog block, which is configuredto collect data depending on how you configured your experiment inNXT Data Logging.

  • 7/30/2019 Tufts Datalogging Book 1

    30/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    DI - 29Copyright 2009 Tufts University Center for Engineering Education and Outreach

    Step 8: You will add two programming blocks to complete your program. Place oneMove block before the Start Datalog block and the other one after. The Move block is

    located in the Common submenu on the left hand side of the programming workspace.

    Step 9: Program the first block to drive for an unlimited amount of time at a low power.Since your NXT will read the program from left to right, the program will jump from the

    first programming block immediately to the Start Datalog block. As the car is driving itwill perform the experiment as it is configured in the Start Datalog block. You should

    check the wait for completion option in the Start Datalog block to ensure that the NXTdoes not jump to the last programming block before the experiment is complete. The last

    programming block will signal the NXT vehicle to stop driving before the program ends.

    Each block should be configured as shown below:

    NOTE: In the Start Datalog block, the Wait for Completion option should be checked This will ensure that the car will continue to drive while the experiment is taking place.

    Step 10: Save this program with the titleHidden Letter.

  • 7/30/2019 Tufts Datalogging Book 1

    31/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    DI - 30Copyright 2009 Tufts University Center for Engineering Education and Outreach

    Step 11: Connect your NXT brick to your computer via the USB cable. Download yourprogram to the NXT brick using the Download Button. When the program download is

    complete, disconnect your NXT from the USB cable.

    Data Collection:

    Step 1: Unplug your NXT vehicle from the USB cable and place it so that it will drive

    over the letter of the alphabet that is hidden from view.

    Step 2: Run theHidden Letterprogram by selecting Run using the orange button.

    Step 3: Have your vehicle drive over the hidden letter several times at slightly differentlocations to collect multiple logs. (see diagram below)

    Data Analysis

    Step 1: Reconnect your NXT brick to the USB cable. Be certain the NXT is on.

    Step 2: Return to theNXT data loggingby clicking the button at the top left

    corner of the programming workspace.

    Step 3: You will be directed to the graphing workspace inNXT Data Logging. Click theUpload Button in the Data Logging Controller in the lower right corner to transfer your

    data from the NXT brick to the computer.

  • 7/30/2019 Tufts Datalogging Book 1

    32/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    DI - 31Copyright 2009 Tufts University Center for Engineering Education and Outreach

    Step 4: The log files that are stored on your NXT will appear in the log upload window.The files are organized by the time that they occurred, with the most recent log at the top

    of the list. For this activity, you will want to import multiple logs. Select multiple logs byclicking on a log and holding down the CTRL button to select others.

    Step 5: After you have selected the files that you will upload, select the option ImportLog after upload. This option will open up all of your logs in the graphing workspace.

    Click upload to open these files.

    Note: Depending on the number of trials you perform, or the number of other program(s)

    stored on your NXT, you may need to delete files to make space for more. You can dothis in several ways. You must have your NXT connected to perform these actions

    Option 1 Upload Menu: After you select the upload icon you can not only

    import logs, but also delete them. Highlight the logs that you would like to delete,and select delete at the bottom of the screen.

  • 7/30/2019 Tufts Datalogging Book 1

    33/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    DI - 32Copyright 2009 Tufts University Center for Engineering Education and Outreach

    Option 2 NXT Data Window: Select the NXT Data button in the DataController at the lower right corner of the graphing workspace:

    A window containing data specific to your NXT will appear. Select the Memorytab. Select Programs next to the bar on the left of the window, which shows the

    memory allocation, to view programs that are stored on your NXT. Select anyprograms that you would like to delete, or delete all your programs by selecting

    Delete All

    Step 6: All of your graphs will open at once in the graphing workspace.

    Step 7: Examine each graph one at a time using the hide/show button in the Dataset

    Table space. Keep in mind the order that you performed your trials and the orientationthat the car was pointed. The most recent log should be at the top of the list:

  • 7/30/2019 Tufts Datalogging Book 1

    34/34

    Hidden Letter Book I: NXT-G Data LoggingLevel 2

    Step 8: Each graph will look similar to the graph shown below. There will be areas ofdark and areas of light. Dark areas will be lower values than light areas. Use this

    information to try to figure out the letter that your car was driving over.

    Example: For the following scenario (the letter A), the graphs may look as follows:

    Off the

    paper, onthe floor

    On the white part

    of the paper

    Driving over black

    ink (letter)

    A

    A

    3

    2

    1

    1 2 3

    A B C

    A B

    C