You are previewing Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level, Second Edition.
O'Reilly logo
Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level, Second Edition

Book Description

Although LEGO MINDSTORMS NXT allows anyone to build complex inventions, there are limits to what you can do with what comes inside the box. This book shows you how to advance the NXT with more than 45 exciting projects that include creating a cool magic wand that writes words in thin air, building a remotely guided vehicle, and constructing sophisticated robots that can sense color, light, temperature, and more. All projects are explained with easy-to-follow, step-by-step instructions, so you'll be able to create them successfully whether you're a novice or an expert. This book also shows you how to expand the programming software and use the alternative language NXC.

New input devices-such as keypads, sensors, and even the human body-are covered, along with fun games such as surfing, PONG, and SIMON. On the serious side, there are classic engineering challenges such as controlling an inverted pendulum, making a robot that follows a wall, and building several light-seeking vehicles. Some projects are just entertaining, such as the Etch-A-NXT; others are useful, such as a motorized camera mount that takes panoramic photographs.

This second edition accounts for the important changes found in the next generation NXT, and it also covers the original concepts in greater depth. Details are presented for practically unlimited expansion of the NXT inputs and outputs by using the I2C communications bus, and several power amplifier designs allow the NXT outputs to drive bigger motors. Instructions are also included for adapting LEGO Power Functions motors to work directly with the NXT.

In the book you'll learn how to

  • Create sophisticated new sensors for light, magnetism, temperature, pressure, humidity and angle

  • Advance your nxt creations with alternate software, bluetooth communications, new motors, and muscle wires

  • Build a galvanic skin response meter, magic wand, numeric keypad, and panoramic camera controller

  • Play pong, simon, and surfing games

Table of Contents

  1. Copyright
  2. Foreword
  3. About the Authors
  4. Acknowledgments
  5. Introduction
  6. 1. In the Beginning
    1. 1.1. The RCX and the Robotics Invention System
    2. 1.2. The MINDSTORMS NXT
    3. 1.3. The Sensors
      1. 1.3.1. NXT Sensors
        1. 1.3.1.1. Touch
        2. 1.3.1.2. Light
        3. 1.3.1.3. Sound
        4. 1.3.1.4. Ultrasonic
        5. 1.3.1.5. Color
        6. 1.3.1.6. NXT Temperature
      2. 1.3.2. RCX Legacy Sensors
        1. 1.3.2.1. Touch
        2. 1.3.2.2. Light
        3. 1.3.2.3. Rotation
        4. 1.3.2.4. Temperature
    4. 1.4. The NXT Motor
  7. 2. Extreme Software
    1. 2.1. NXT-G
      1. 2.1.1. My Blocks
      2. 2.1.2. Importing Blocks
    2. 2.2. Not eXactly C and Bricx Command Center
    3. 2.3. Other Alternative Languages
      1. 2.3.1. RobotC
      2. 2.3.2. LabVIEW
      3. 2.3.3. Java
  8. 3. Making a Connection
    1. 3.1. NXT Ports
      1. 3.1.1. Sensor Input Pinout and Signal Description
        1. 3.1.1.1. Pin 1—White—AN
        2. 3.1.1.2. Pin 4—Green—4.3V Power
        3. 3.1.1.3. Pins 5 and 6—Yellow and Blue—DIGI0 and DIGI1
      2. 3.1.2. Motor Output Pinout
        1. 3.1.2.1. Pin 1 and 2—White and Black—M1 and M2
        2. 3.1.2.2. Pin 3—Red—GND
        3. 3.1.2.3. Pin 4—Green—4.3V POWER
        4. 3.1.2.4. Pin 5 and 6—Yellow and Blue—TACHO0 and TACHO1
    2. 3.2. Physically Connecting to the NXT
      1. 3.2.1. Buying Connectors
      2. 3.2.2. Making Your Own Connectors
        1. 3.2.2.1. Taped Telephone Plug Method
        2. 3.2.2.2. Modified Telephone Plug Method
        3. 3.2.2.3. Cut Cable Method
    3. 3.3. Screw Terminal for Passive Sensors
  9. 4. Contact Sensors
    1. 4.1. Touching Wires
    2. 4.2. Electronic Surfboard
    3. 4.3. Construction
      1. 4.3.1. Programming
    4. 4.4. Switches
    5. 4.5. Parallel and Series
    6. 4.6. Antenna Sensor
    7. 4.7. Going Further
  10. 5. Resistive Sensors
    1. 5.1. Analog-to-Digital Conversion
    2. 5.2. Ohmmeter
      1. 5.2.1. Ohmmeter Program
      2. 5.2.2. Measuring Salinity
    3. 5.3. Legacy Temperature Sensor
      1. 5.3.1. Thermistors
      2. 5.3.2. Reverse Engineering the NXT
      3. 5.3.3. Homebrew Legacy Temperature Sensor
      4. 5.3.4. NXT Digital Thermometer
      5. 5.3.5. Relative Humidity Sensor
    4. 5.4. Light Sensor
      1. 5.4.1. Building the Light Sensor
      2. 5.4.2. Comparison of LEGO and CdS Light Sensor
      3. 5.4.3. Theremin
      4. 5.4.4. Braitenberg Vehicle 2
    5. 5.5. Two-Switch Input
      1. 5.5.1. Building a Two-Switch Input
      2. 5.5.2. Programming a Two-Switch Input
  11. 6. Potentiometer Sensors
    1. 6.1. Connecting to the Pot
    2. 6.2. Resistance Selection
    3. 6.3. Angle Sensor Construction
    4. 6.4. NXT Protractor
    5. 6.5. Pressure Sensor
    6. 6.6. Broom Balancer
    7. 6.7. Joysticks
      1. 6.7.1. Bottom Mounted Joystick
      2. 6.7.2. Top Mounted Joystick for a Robot Arm
  12. 7. Voltage Sensors
    1. 7.1. Design of a −5V to +5V Sensor
    2. 7.2. Constructing the Voltage Sensor
    3. 7.3. NXT Battery Tester
    4. 7.4. A −15V to +15V Sensor
  13. 8. 4.3V Powered Sensors
    1. 8.1. Hall Effect Sensor
      1. 8.1.1. Hall Sensor Construction
      2. 8.1.2. Robot Mouse
    2. 8.2. Transistor Buffer
    3. 8.3. Infrared Rangefinder
      1. 8.3.1. Interface Construction
      2. 8.3.2. Operation of the Sensor
      3. 8.3.3. Wall Follower
    4. 8.4. Differential Light Sensor
      1. 8.4.1. Construction
      2. 8.4.2. Digital Sundial
    5. 8.5. Protecting the Transistor Buffer
  14. 9. Two-Wire Powered Sensors
    1. 9.1. Signals
    2. 9.2. Power Supply
      1. 9.2.1. Programming
    3. 9.3. Half-Volt Sensor
    4. 9.4. Current Sensor
      1. 9.4.1. Electronic Whistler
      2. 9.4.2. Exposing the Filament
      3. 9.4.3. Whistler Construction
    5. 9.5. Pressure Sensor
  15. 10. Light Sensor with LED Control
    1. 10.1. LED Control Circuit
    2. 10.2. Reflected Light Sensor
    3. 10.3. Transmissive Light Sensor
  16. 11. LEGO Motor Interfaces
    1. 11.1. The Clapper
    2. 11.2. The Etch-A-NXT
    3. 11.3. Pneumatic Gripper
    4. 11.4. RCX 9V Motor
    5. 11.5. NXT Conversion Cable
    6. 11.6. Power Functions Motors
    7. 11.7. Power Functions Cabling
  17. 12. Beyond LEGO Motors
    1. 12.1. The Motor Block
    2. 12.2. Output Control Program
    3. 12.3. Lamps
    4. 12.4. Muscle Wires
    5. 12.5. Electromagnets and Solenoids
      1. 12.5.1. Kinetic Sculpture
      2. 12.5.2. Relays
    6. 12.6. Doubling Outputs
    7. 12.7. Light Emitting Diodes
    8. 12.8. More Power
      1. 12.8.1. One MOSFET Amplifier
      2. 12.8.2. Bipolar MOSFET Amplifier
    9. 12.9. RC Servo Interface
  18. 13. I2C Bus Communication
    1. 13.1. I2C Communications
    2. 13.2. PCF8574
    3. 13.3. Eight Outs
    4. 13.4. Magic Wand
    5. 13.5. Four Ins and Outs
    6. 13.6. Simon Game
    7. 13.7. Keypad Input
    8. 13.8. Relay Outputs
    9. 13.9. PCF8591
    10. 13.10. Four Analog Ins
    11. 13.11. 2-D Light Sensor
    12. 13.12. RC Servo Controller
    13. 13.13. Color Sensor
    14. 13.14. Going Further
  19. 14. Cool Combinations
    1. 14.1. Data Logging
    2. 14.2. NXT-to-NXT Bluetooth Remote Control
    3. 14.3. LEGO Train Station
    4. 14.4. Panoramic Camera
    5. 14.5. Graphics
    6. 14.6. NXT Pong Video Game
    7. 14.7. Remotely Guided Vehicle
    8. 14.8. Galvanic Skin Response Meter
  20. A. Construction Techniques
    1. A.1. Solderless Breadboard
    2. A.2. Building on the Breadboard
    3. A.3. Printed Circuit Board
    4. A.4. Soldering
    5. A.5. Building a Printed Circuit Board
    6. A.6. Prototype Board Kits
  21. B. References, Links, and Sources
    1. B.1. General Interest
    2. B.2. Chapter 1
    3. B.3. Chapter 2
    4. B.4. Chapter 3
    5. B.5. Chapter 5
    6. B.6. Chapter 6
    7. B.7. Chapter 7
    8. B.8. Chapter 8
    9. B.9. Chapter 9
    10. B.10. Chapter 10
    11. B.11. Chapter 11
    12. B.12. Chapter 12
    13. B.13. Chapter 13
    14. B.14. Chapter 14
    15. B.15. Appendix A
  22. C. Code Listings
    1. C.1. Chapter 13
    2. C.2. Chapter 14