O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Make: Lego and Arduino Projects

Book Description

Make amazing robots and gadgets with two of today’s hottest DIY technologies. With this easy-to-follow guide, you’ll learn how to build devices with Lego Mindstorms NXT 2.0, the Arduino prototyping platform, and some add-on components to bridge the two. Mindstorms alone lets you create incredible gadgets. Bring in Arduino for some jaw-dropping functionality—and open a whole new world of possibilities.

Build a drink dispenser, music synthesizer, wireless lamp, and more

Each fun and fascinating project includes step-by-step instructions and clear illustrations to guide you through the process. Learn how to set up an Arduino programming environment, download the sketches and libraries you need, and work with Arduino’s language for non-programmers. It’s a perfect book for students, teachers, hobbyists, makers, hackers, and kids of all ages.

  • Build a Drawbot that roams around and traces its path with a marker pen
  • Construct an analog Mindstorms clock with hands that display the correct time
  • Create a machine that mixes a glass of chocolate milk at the touch of a button
  • Make a Gripperbot rolling robotic arm that you control wirelessly with Arduinos mounted on your arms
  • Explore electronic music by building a guitar-shaped Lego synthesizer
  • Build a Lego lamp with on/off and dimmer switches that you control with a smartphone application
  • Jump feet first into the world of electronics, from learning Ohm’s Law to working with basic components

You'll need the Bricktronics shield created for this book by Open Source Hardware kit maker Wayne and Layne, or you can build a breadboarded equivalent (see Chapter 10) for about $25 in parts.

Table of Contents

  1. A Note Regarding Supplemental Files
  2. Foreword
  3. Preface
    1. Assumptions This Book Makes
    2. Contents of This Book
    3. Conventions Used in This Book
      1. Lego CAD Conventions
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
    7. Acknowledgments for John
    8. Acknowledgments for Matthew
    9. Acknowledgments for Adam
  4. 1. Project: Drawbot
    1. Parts List
      1. Tools & Electronics
      2. Lego Elements
    2. Assembly Instructions
      1. Build the Lego Model
      2. Attach the Arduino and Bricktronics Shield
      3. Attach the Pen
    3. Program the Robot
      1. Processing and Arduino
      2. Setting Up the Programming Environment
      3. Don’t Forget Your Libraries!
      4. The Arduino Sketch
    4. The Next Chapter
  5. 2. Anatomy of Lego Robotics
    1. Mindstorms
      1. The NXT Brick
      2. Sensors
      3. Motors
      4. Wires
      5. Technic Beams, Mechanics & Connectors
    2. Expanding on the Mindstorms Set
      1. Buying More
      2. Add-On Electronics
      3. Third-Party Bricks
      4. Non-Mindstorms Lego Bricks
      5. Power Functions
    3. Programming Your Brick
    4. The Next Chapter
  6. 3. Arduino Interlude
    1. History of the Arduino Project
    2. What Is OSHW?
    3. Anatomy of the Uno
    4. The Arduino Ecosystem
      1. Uno Alternatives
      2. Older Models
      3. Shields
    5. Arduino Resources
      1. Books
      2. Websites
      3. Code
    6. The Next Chapter
  7. 4. Project: Clock
    1. Parts List
      1. Tools & Electronics
      2. Lego Elements
    2. Assembly Instructions
      1. Prepare the Gear
      2. Build the Lego Model
      3. Install the Arduino
    3. Program the Robot
    4. Setting the Clock
    5. The Next Chapter
  8. 5. Project: Chocolate Milk Maker
    1. Parts List
      1. Tools & Electronics
      2. Beverage Handling
      3. Food
      4. Lego Elements
    2. Assembly Instructions
      1. Build the Pump Assembly
        1. Wiring the Aquarium Pump
      2. Build the Lego Model
      3. Attach the Syrup Bottle
      4. Build the Mixing Attachment
      5. Wire up and Install the Electronics
        1. Adapting the Power Functions Wire
    3. Program the Robot
    4. The Next Chapter
  9. 6. Basic Electronic Theory
    1. Basic Concepts in Electricity
      1. Voltage, Current & Resistance
      2. Ohm’s Law
      3. Other Concepts
        1. Ground
        2. Series & Parallel Connections
    2. Know Your Electronic Components
      1. Resistors
        1. Determining a Resistor’s Rating
      2. Capacitors
      3. Diodes and LEDs
      4. Inductors
      5. Transistors
      6. Integrated Circuits
    3. Sensors 101
      1. Digital Sensors
        1. Tilt Sensor
        2. Hall-Effect Sensor
        3. Passive Infrared Motion Sensor
        4. Temperature and Humidity Sensor
        5. Infrared Receiver
      2. Analog Sensors
        1. Thermistor
        2. Photocell
        3. Force Sensitive Resistor
        4. Ultrasonic Sensor
        5. Accelerometer
    4. Further Study
  10. 7. Gripperbot
    1. Parts List
      1. Electronics Parts
      2. Lego Elements
    2. Building Instructions
      1. Bracers
      2. Gripperbot
    3. Assembling the Gripperbot’s Electronics
    4. Programming the Gripperbot
    5. The Next Chapter
  11. 8. Project: Keytar
    1. Parts List
      1. Tools & Electronics
      2. Lego Elements
    2. Assembly Instructions
      1. Build the Lego Model
      2. Install the Electronics
    3. Program the Keytar
    4. Play Some Music!
    5. The Next Chapter
  12. 9. Project: Lamp
    1. Parts List
      1. Tools & Electronics
      2. Lego Elements
    2. Assembly Instructions
      1. Build the Lego Model
      2. Install the Electronics
      3. Download and Install the App
    3. Program the Lamp
    4. The Next Chapter
  13. 10. Advanced Techniques
    1. Wiring Up Bricktronics Equivalents
    2. Mounting PCBs to Legos
    3. Adding Molex Connectors to Lego Wires
    4. All About Motors
      1. DC Brushed Motors
        1. Driving a DC brushed motor
        2. Flyback Diodes
      2. Stepper Motors
      3. Hobby Servo Motors
    5. Powering Your Robot
      1. DC Power Jack
      2. USB Connector
      3. Batteries
      4. Battery Dos and Don’ts
    6. NXT to Arduino Communication
    7. XBee Wireless Modules
    8. Epilogue
  14. Index
  15. About the Authors
  16. Colophon
  17. Copyright