0%

Book Description

Enter the world of mechatronic systems with the Raspberry Pi to design and build 12 amazing projects

In Detail

A mechatronic system is an integration of mechanical and electronic systems designed to simplify or automate a repetitive task. The Raspberry Pi is one such low cost, low power consuming, miniature computer that can act as the brain for different types of applications.

Through 12 accessible and well-demonstrated projects, you will learn how to effectively identify and leverage the best components for your design. Beginning with a simple example of interfacing the Pi with an Arduino, you will delve into more complex projects. From a Weasley weather clock to a line-following robot, a pet monitor to a fun arcade game, you will implement powerful and entertaining projects to master the Raspberry Pi in and out.

What You Will Learn

  • Prototype electronic circuits to solve problems using the Raspberry Pi
  • Learn simple prototyping tools such as a laser cutter to build mechanisms that interface with the Raspberry Pi
  • Interface with standard development platforms such as the Arduino and different operating systems
  • Build simple tools that will help you in your day-to-day life
  • Learn the nuts and bolts details of mechatronic system development through examples like a Christmas light controller and a personal health monitor
  • Get to grips with the practical implementation of robotics and home automation
  • Troubleshoot problems that arise during the implementation of your projects

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Raspberry Pi Mechatronics Projects HOTSHOT
    1. Table of Contents
    2. Raspberry Pi Mechatronics Projects HOTSHOT
    3. Credits
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      6. Task 1
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      7. Reader feedback
      8. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Hello World
      1. A quick introduction to the Raspberry Pi
        1. Features of a Raspberry Pi
      2. Where can I buy a Raspberry Pi?
        1. Requirements to get started with the Raspberry Pi
          1. Operating systems on the Raspberry Pi
        2. Getting started with Raspbian
          1. Downloading Raspbian
          2. Flashing image on to the SD card
            1. Windows
            2. Linux
              1. A command-line interface-based approach
                1. Identifying the SD card mount point
                2. Unmount the SD card
                3. Flash the SD card
              2. GUI-based approach
        3. Setting up the Raspberry Pi
      3. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      4. Hunting and gathering
        1. Engage thrusters
        2. Objective complete – mini debriefing
      5. Setting up the GPIO
        1. Engage thrusters
          1. Installing GPIO libraries
        2. Objective complete – mini debriefing
      6. GPIO programming using Python
        1. Engage thrusters
          1. An alternative to quick2wire – RPi.GPIO
        2. Objective complete – mini debriefing
      7. Electrical output of our program
        1. Engage thrusters
        2. Objective complete – mini debriefing
          1. Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi
      8. Mission accomplished
      9. Hotshot challenge
    9. 2. A Raspberry WebIDE Example
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Installation, features, and usage of the Occidentalis operating system from Adafruit
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. Setup of a remote login into the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      4. Installation of the Raspberry Pi WebIDE
        1. Engage thrusters
        2. Objective complete – mini debriefing
      5. Python development on the WebIDE
        1. Prepare for lift off
          1. Quick introduction to the I2C interface
          2. Configuring the I2C interface on the Raspberry Pi
        2. Engage thrusters
        3. Objective complete – mini debriefing
      6. Test and debugging examples using the WebIDE
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      7. Mission accomplished
      8. Hotshot challenge
    10. 3. The Arduino Raspberry Pi Interface
      1. Mission briefing
        1. Why is it awesome?
          1. Where can you buy an Arduino?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Installing the Arduino IDE
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. Programming the Arduino using the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      4. Raspberry Pi AlaMode
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      5. The Weasley weather clock
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      6. Controlling the stepper using the Arduino
        1. Prepare for lift off
        2. Engage thrusters
          1. Counterclockwise rotation of the stepper motor
        3. Objective complete – mini debriefing
      7. Controlling the RGB LED Strip using the Arduino
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      8. I2C Communication using the Arduino (optional)
        1. Prepare for lift off
        2. Engage thrusters
          1. The 7-Segment display
          2. 8x8 LED matrix
            1. BlinkM
            2. Proximity sensor
        3. Objective complete – mini debriefing
      9. Serial port communication with the Raspberry Pi
        1. Engage thrusters
          1. Python program for the Weasley clock
          2. Arduino acknowledgement to control signal
            1. Control flow for the weather clock
            2. Temperature data
            3. Control of the RGB LED strip
            4. Control of stepper via serial port
            5. Programming the weather forecast position
            6. 8x8 matrix control
              1. BlinkM control
        2. Objective complete – mini debriefing
      10. Mission accomplished
      11. Hotshot challenge
    11. 4. Christmas Light Sequencer
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
      2. Interface the devices to the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
          1. Connecting multiple appliances to the Raspberry Pi
        3. Objective complete – mini debriefing
      3. Setting up the digitally addressable RGB matrix
        1. Prepare for lift off
          1. Where can I buy them?
        2. Engage thrusters
          1. How does it work?
          2. Lighting up the RGB LED strip
            1. An Arduino-based control
        3. Objective complete – mini debriefing
      4. Interface of an audio device
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      5. Installing the web server
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mission debriefing
      6. Interfacing the web server
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      7. Mission accomplished
        1. References
    12. 5. Internet of Things Example – An E-mail Alert Water Fountain
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
        4. Prepare for lift off
        5. Engage thrusters
        6. Objective complete – mini debriefing
      2. Installation of the Flask framework
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. Controlling RGB LEDs from a web page
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      4. Setup of the e-mail alerts in the fountain
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      5. Mission accomplished
      6. Hotshot challenge
    13. 6. Raspberry Pi as a Personal Assistant
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
      2. Setting up the e-mail feed parser
        1. Prepare for lift off
        2. Engage thrusters
      3. Setting up the parser for reminders and events
        1. Prepare for lift off
        2. Engage thrusters
      4. Designing an enclosure design for the personal assistant
        1. Prepare for lift off
        2. Engage thrusters
      5. Setting up the assembly for the dish monitor
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      6. Setting up sensors for the key alert system
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      7. Mission accomplished
      8. Hotshot challenges
      9. References
    14. 7. Raspberry Pi-based Line Following Robot
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Assembly of the Pi Plate for the line following robot
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. Sensor selection, interface, and data interpretation
        1. Engage thrusters
          1. Light Dependent Resistors
          2. Infrared emitter/detector
          3. Machine-vision-based line following robot
          4. Sensor selection
        2. Objective complete – mission debriefing
      4. Implementation of line following logic based on sensor data
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      5. Testing the motor driver circuit
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      6. Preparation of the line following course
        1. Prepare for lift off
        2. Engage thrusters
          1. Use electrical tape and build a track
      7. Designing the chassis for the line following robot
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      8. A step-by-step assembly of the robot
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      9. Mission accomplished
      10. Hotshot challenge
        1. References
    15. 8. Connect Four Desktop Game using Raspberry Pi
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
      2. Hello world example with the pygame
        1. Prepare for lift off
        2. Engage thrusters
          1. Playing sounds using the pygame module
          2. Building menus using the pygame module
        3. Objective complete – mini debriefing
      3. Getting started with the Connect Four game (UI and sound effects)
        1. Prepare for lift off
        2. Engage Thrusters
          1. Adding a menu for the game
          2. Adding sounds to the game
        3. Objective complete – mission debriefing
      4. Interfacing game inputs using the PiFace module
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      5. A brief description of the Connect Four Game AI
        1. Prepare for lift off
        2. Engage thrusters
          1. Main game loop
        3. Objective complete – mini debriefing
      6. Marquee design and control (optional)
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      7. Setup of the switches using a cardboard box
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      8. Mission accomplished
      9. Hotshot challenge
        1. References
    16. 9. The Raspberry Pi-enabled Pet/Wildlife Monitor
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
      2. Installing and testing the python-twisted framework
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. Setting up and testing Spark Core to interact with appliances
        1. Prepare for lift off
        2. Engage Thrusters
        3. Objective complete – mini debriefing
      4. Installing and testing the Google Coder project on the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – objective complete
      5. A brief overview of a bird feeder that triggers a camera
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
          1. Alternatives and project ideas to consider
      6. Mission accomplished
      7. Hotshot challenge
    17. 10. Raspberry Pi Personal Health Monitor
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Setting up a web server to record health parameters
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. A simple exercise tool using the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
          1. A mini project idea
        3. Objective complete – mini debriefing
      4. Setting up an e-mail feed parser to refill a prescription as well as remind the user about an upcoming doctor's appointment
        1. Engage thrusters
          1. Setting up a reminder for doctor's appointments
        2. Objective complete – mini debriefing
      5. A simple tool that reminds a person to take his/her pills
        1. Prepare for lift off
        2. Engage thrusters
          1. Other project ideas
        3. Objective complete – mini debriefing
      6. Mission accomplished
      7. Hotshot challenge
    18. 11. Home Automation using Raspberry Pi
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
      2. A simple example that controls limited indoor and outdoor lighting in the evening
        1. Prepare for lift off
          1. Software prerequisites
        2. Engage thrusters
        3. Objective complete – mini debriefing
          1. Alternative solutions and some project ideas to consider
      3. A customary web server example
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      4. Turning on a lawn sprinkler only when there is no rain forecast!
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Gaining remote access to your Raspberry Pi to control appliances
        5. Some project ideas to consider
      5. Mission accomplished
    19. 12. Using a Raspberry Pi for Science and Education
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
      2. Improving your vocabulary using the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      3. Raspberry Pi and Khan Academy
        1. Some ideas to consider
      4. Building a science fair exhibit using the Raspberry Pi
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Some simple educational experiments using the Raspberry Pi
      5. Hotshot challenge
    20. 13. Tips and Tricks
      1. Mission briefing
        1. Why is it awesome?
        2. Your objectives
        3. Mission checklist
      2. Setting up Raspberry Pi as a development platform
        1. #1 – Simple trick for Python development via remote login
        2. #2 Web development using Google Coder
        3. #3 Adafruit Occidentalis
        4. #4 Java Development using the Raspberry Pi
        5. #5 The Thingbox project
      3. Remotely logging in the Raspberry Pi from anywhere on the Internet
      4. Problems that might be encountered while using Raspberry Pi
        1. SD card corruption
        2. Power issues
        3. Devices powered by USB
      5. Cool add-on hardware sources developed for the Raspberry Pi platform
        1. The Raspberry Pi model B versus B+, model A versus A+
      6. Project ideas that can be implemented over a weekend
      7. Useful resources for the Raspberry Pi
        1. Raspberry Pi Foundation's forums:
        2. Raspberry Pi Stack Exchange:
        3. Element 14's Raspberry Pi community:
      8. Mission accomplished
    21. Index
18.223.21.5