Remote Control (simple)

From FIRE Wiki
Revision as of 21:34, 22 December 2011 by Ipflot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Project Description

This multi-robot project demonstrates wireless remote control and communication with 2 NXT devices. One master NXT controller is equipped with 2 touch sensors and acts as the transmitting controller. The touch sensors wirelessly control the right and left motors of another NXT robot.


Topics covered in this project:

  • Use of touch sensor interfacing and calibration.
  • Transmitting and Receiving Data from an RS-485 Device (NXTBee)
  • Using External Libraries
  • Formatting strings and characters

User Notes

Note: The concepts outlined in this lesson are geared towards an intermediate user of ROBOTC and C Programming languages. Students should be comfortable with all material covered in the Teaching ROBOTC for MINDSTORMS curriculum before jumping into any Multi-Robot communication lessons.

  • Remember when using Multi-Robot communications to always start the robot that is the receiver first. Otherwise, the receiving robot will not be listening when the sending robot broadcasts it's message. However since this lab introduces a continuous stream of messages being sent and received, it does not matter which program is started first

Hardware and Software Required



  • The NXT controller (master) consists of a NXT brick with 2 touch sensors. It is meant to be a handheld controller and does not have motors attached.
  • The NXT robot (slave) is a standard NXT robot with right and left motors. There are no sensors on this robot.
  • Each device is equipped with an Xbee radio module.


  • The goal of the master controller is to monitor the state of the touch sensors (using a loop) and continuously send string commands to the slave robot based on the the state of the touch sensors. If the right touch sensor of the controller (master) is pressed, then the right motor of the slave robot will move forward. If the left touch sensor of the controller (master) is pressed, then the left motor of the slave robot will move forward. If both touch sensors are pressed on the controller, both the right and left motors of the slave robot will move forward. If neither touch sensor is pressed on the controller, then the slave robot stops.
  • The goal of the slave robot is to repeatedly await wireless commands from the controller (using a loop); identify the commands, and then take the appropriate motor action based on the command received.
  • There are 2 complete versions of the solution to this challenge provided below. In version 1 the use of characters is introduced. Version 2 is a solution without the use of character data or string formatting. These solutions are presented to show you the flexibility in creating and sending the string commands.


Master Controller Source Code (version 1)

Slave Robot Source Code (version 1)

Master Robot Source Code (version 2)

Slave Robot Source Code (version 2)

Follow-up Project - Control 2 robots with 1 controller

Goal: Extend the remote control project above to allow the controller to wirelessly control 2 robots. Both robots will respond simultaneously to the controller commands. Remember that each command sent by the controller will be received by both robots. Here is a video demonstrating the project.

Video (for Follow-up Project)

More Follow-up Projects and Discussion Questions

  1. Expand control to 2, 3 or more slave robots and observe behavior.
  2. What impact does the time delay used with the NXT display have on the response and performance? How can this be improved?
  3. Replace wheels/tires with wheels of a different diameter on one or both of the slave robots. What behavior do you expect? Test.
  4. Modify the speed (and/or direction) in one or both of the slave robots. What behavior do you expect? Test.
  5. Add a feature to the code to display the transmitted action on the controller screen (examples: "Stop", "Fwd", "Right", "Left").
  6. Create, design, and test your own handheld robot controller. What features make the robot controller easy to use?
  7. Create, test, demonstrate and share your own challenge or application based on this technology.
  8. What are some real-world applications of this technology?