NXT Bluetooth Remote Control

ACTIVITY HEADER

 

 

 

Name of Activity NXT Bluetooth Remote Control
Author Jay Clark
Keywords NXT, master, worker, simple, remote control car, soccer, maze, navigation, battlebots
Subject NXTs
Grade Level 7, 8, 9+
Time 1 Hour Total
Brief Description Students will program two NXT’s: One to be the master and one to be the worker. They will create simple remote control car as an introduction to a more complicated activity: A soccer match, maze navigation, battlebots, etc.
Lesson Objectives: Introduce students to bluetooth communication.
Encourage division of tasks and creative solutions.
Understand loops, switches, wiring, and data flow.
Materials Needed: Two NXT’s per group (bring extra NXT’s or combine groups)
Computes with Mindstorms NXT software
Preparation and Set Up: If you have time, give all NXT’s a unique name using the procedure outlined below.
Necessary Background Bluetooth connectivity in the NXT will bring surefire excitement into your classroom. However, there are a lot of (albeit simple) steps involved in making a connection. Be prepared for varying levels of difficulty across groups.

Groups that achieve connectivity early can work on making their remote controls more complex and sophisticated. Work to achieve connectivity before helping groups with involved programming questions.

Vocabulary:
Bluetooth – a standard for the short range wireless interconnection of electronic devices.

Master – Device in a communication relationship that sends commands.

Worker – Device in a communication relationship that receives and executes commands.

Procedure (1) Students must give their NXT a unique name. This is done by clicking on the NXT window button (located above the download and run button), replacing the name on the right hand side of the pop up window and pressing the enter button next to the name. Make sure the new name remains in the slot.

(2) Turn Bluetooth on on both of the NXT’s. This is done by scrolling over to bluetooth, clicking “turn on/off” and selecting on. The NXT should display the bluetooth symbol with a “<” next to it.

(3) One NXT should “search” for the other. In the bluetooth menu, select ‘search.’ The NXT will display a status bar while it scans electronic devices. A list will come up listing all closeby computers, phones, and NXT’s. Scroll to the NXT you want to connect to and select it.

(4) Choose a connection port. The NXT can connect to multiple devices. Connect to any port.

(5) Enter passkey. The passkey is 1234. If you successfully connected, both NXT’s should have a “<>” symbol next to the bluetooth symbol.

 

Programming the Master

The master will send messages using the “send message” command. For controlling a car with a continuous sensor value (rotation, light, sound, distance), you will be sending a number. Select your connection port, change message type to number. Finally, assign a mailbox for your command. Every command should have its own unique mailbox. (For example, the rotation sensor on the master will be controlling the power of the motors on the worker, while the NXT buttons will be controlling the steering. The rotation sensor message should get its own mailbox, and each NXT button should get its own mailbox, but they should all have the same connection number) To control the worker using buttons (NXT buttons and touch sensors), you will be sending logic. So switch the message type to logic and wire from the logic output of the sensor.   The program should be in a loop to check for and send commands continuously.

 

Programming the Worker

The worker uses the “receive message” command. Choose the mailbox and the message type, and use the wiring tool to use the information to send commands. If the message type is a number, you can wire it directly into the output you want to control. If its logic, you need to use it with a switch.

Reference 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/h.png

Maze Competition

ACTIVITY HEADER

 

 

 

Name of Activity Maze Competition
Author STOMP
Keywords NXT, car, touch sensor, maze, switch blocks, decision statement
Subject NXTs
Grade Level 4, 5, 6
Time 1 Hour Total
Brief Description Students will construct an NXT car and program the car to be controlled by two touch sensors. Students will drive their car through a maze.
Lesson Objectives: - To learn to program with touch sensors and use decision statements “Switch Blocks”.
Materials Needed: NXT car or materials to build an NXT car
Two touch sensors and long wires per car
Assortment of extra LEGO pieces
Tapeline Maze
Planning Sheet and Final Design Sheet (attached or make your own)
Computer running MINDSTORMS NXT-G Software
Preparation and Set Up: Construct one or more maze(s) for students to use for their NXT cars.
Photocopy worksheets.
Arrange student into groups of two.
Distribute necessary materials.
Necessary Background Vocabulary:
- Switch block.
- Decision statement.
Procedure
  1. Have students plan out their design and program. Ask students questions to help them plan: How will students make their car so it turns easily? What makes a car turn in a computer program? What response should the car have when one touch sensor is pressed? What response should the car have when both sensors are pressed?
  2. Give students pre-built models or have students build a two-motor car using and NXT brick and two NXT motors.
  3. Have students wire two different touch sensors to the car using long wires. The sensors should not be directly attached to the car because the students will hold the sensors to direct the car.
  4. Have students program their two-motor cars:
    1. Students should recognize that they have two touch sensors attached to two ports.
    2. Both touch sensors need to be able to work at the same time so two paths should be created.
    3. You want two responses from the touch sensors. You can get these two responses from a decision statement, or “switch” block (if pressed then response 1. If released then response 2).
    4. The Switch blocks will need to be contained within a loop or else the NXT brick will only look for a response once and the program will end instantaneously.
  5. Allow students to test their designs in the maze you have set up.
  6. Remind students that they may redesign their cars and programs if they do not complete the maze.
  7. Optional: have a prize at the end of the maze.
Extensions or Modifications: - Create a maze that has a different challenge that will require further design
changes in the car or program (ramp, narrow section, line that students must
stop on).
- Use light sensors to navigate a maze (similar to line following activity).
- Use the proximity sensor to navigate through a maze made out of cardboard boxes.

Modifications:
- Use only one sensor to make car drive forward and stop.

Reference 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/59_image_2_paj.png
Reference 2 http://sites.tufts.edu/stompactivitydatabase/files/formidable/59_image_3.png
Reference 3 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Building_Design_Sheet2.pdf
Reference 4 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Engineering_Design_Process1.doc
Reference 5 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Final_Design_Sheet2.pdf
Reference 6 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Maze-Competition.pdf
Reference 7 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Maze_competition.doc

Wire Maze Challenge

ACTIVITY HEADER

 

 

 

Name of Activity Wire Maze Challenge
Author STOMP
Keywords Electrical Engineering, maze, loop, wire, current, switch, open circuit, closed circuit
Subject Non-LEGO
Grade Level 4, 5, 6
Time 1 Hour Total
Brief Description Students will be constructing a game made out of a simple circuit with a movable loop of wire that can be guided over a curved “maze” wire. The object of the game will be to guide the loop along the maze without touching the loop to the maze wire. If the student does touch the loop to the wire, the circuit will be complete, turning on the light bulb, and signaling the touch.
Lesson Objectives: - To teach students about electrical circuits.
- To teach students about electrical currents.
Materials Needed: Per Group:
- One 9V battery w/connection plate and attached wires.
- 24 inches of un-insulated wire (stripped insulated wire between 20 – 24 AWG should work).
- One 1-Watt light bulb w/ lamp base.
- One 24 inch length of insulated wire w/stripped ends.
- One 8 inch length insulated wire w/stripped ends.
- Electrical tape.
- Cardboard base (optional).
- Four alligator clips (optional).
- Popsicle stick or pencil.
Preparation and Set Up: - Show the first five slides of Powerpoint attached.
- Break the class into groups of two.
- Distribute worksheets and building materials.
Necessary Background Vocabulary:
Electrical current
Switches
Open circuit
Closed circuit
Procedure
  1. Connect 1 wire of the battery connection plate to the light bulb using an 8 inch strip of wire.
  2. Attach a 24 inch length of insulated wire to the other side of the light bulb. The end of the wire not connected to the lamp should be stripped of insulation for the last three inches of its length.
  3. Curl the stripped end of the long wire into a small loop approximately ½” across.
  4. Using electrical tape, create a handle for the wire ring by fastening the remaining wire to the end of a pencil or popsicle stick.
  5. Using a 24 inch strip of wire without insulation, create a looping and bending “maze” that the ring will have to follow.
  6. Put one end of your maze through the wire loop on the end of the popsicle stick, and then tape both ends to the cardobard base so that the maze sticks up into the air.
  7. Use a gator clip to attach the other terminal of the battery connection plate to the end of the maze. Leave one end of the un-insulated maze taped to the table with nothing else connected to it. You should now see that when your loop touches the wire path the light bulb turns on!. See if you can guide the loop along the maze without touching the wire and turing on the light.
  8. Discuss with the class why the light bulb only goes on when the loop touches the wire.
Extensions or Modifications: If you finish with the wire maze with extra time remaining, try to figure out a way to add an additional loop to the maze. There are two different ways to wire this circuit – you can either have the light bulb turn on when either one of the loops touches the wire, or you can have it turn on only when both loops are touching the wire. Draw your new circuit below using the electrical engineering symbols on the previous page.

The diagrams below are two possible approaches to this extension.

Modifications:
Hint:
Be careful not to connect the battery terminals together if there is no resistor in between
them! This creates what is known as a short circuit, and if left connected for too long will
quickly drain the battery.

Reference 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze1.png
Reference 2 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze2.png
Reference 3 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze3.doc
Reference 4 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze4.pdf

Switch to our mobile site