
Design and build a Raspberry Pi robot By Stewart Watkiss (PenguinTutor) About this guide This is a guide to creating Ruby Robot. An inexpensive robot vehicle controlled by a Raspberry Pi computer. Copyright This guide is provided through a creative commons license - Attribution-ShareAlike 3.0 Unported. License details: http://creativecommons.org/licenses/by-sa/3.0/ About the author Stewart Watkiss graduated from The University of Hull, UK, with a masters degree in electronic engineering. Since then he has been working in the IT industry, including Linux and networking. Linux has been his passion for many years and he has gained certification at LPIC-2. He runs the website PenguinTutor.com providing information on learning Linux, electronics and the Raspberry Pi. After working on several projects with the Raspberry Pi, both on his own or with his children, he signed up as a STEM ambassador to pass some of his knowledge on to school children helping out at local schools. He has also been technical reviewer of the book “Learning Raspberry Pi with Linux”, published by Apress, and a volunteer guest writer for The MagPi free magazine. DRAFT Version Contents Table of Contents Contents................................................................................................................................................1 Introduction..........................................................................................................................................3 How to use this guide...........................................................................................................................3 Knowledge required.............................................................................................................................4 Design decisions...................................................................................................................................4 Creating a design specification.............................................................................................................4 Design specification for robot vehicle.............................................................................................5 Deciding on main components.............................................................................................................5 Magician chassis kit.............................................................................................................................7 Raspberry Pi.........................................................................................................................................8 Raspbian Linux operating system....................................................................................................9 Initial configuration of the Raspberry Pi............................................................................................10 Download the NOOBS image........................................................................................................10 Connect the Raspberry Pi for first time install...............................................................................11 A basic introduction to the Linux command line...........................................................................13 Connect the robot to an existing Wi-Fi network............................................................................15 Installing additional software on Linux.........................................................................................16 Create a Wi-Fi hotspot for the Raspberry Pi..................................................................................17 Check the dongle supports Wireless Access Point mode..........................................................17 Configure the static IP address..................................................................................................18 Configure the DHCP server......................................................................................................18 Configure the Wireless Access Point software..........................................................................20 Logging on to the Raspberry Pi using SSH..............................................................................21 Adding the Raspberry Pi to the robot chassis.....................................................................................25 Power for the Raspberry Pi and motors.........................................................................................25 Shared or separate power supplies.................................................................................................26 Pre-supplied power supply.............................................................................................................27 Connecting the power...............................................................................................................27 Connecting the breadboard to the Raspberry Pi GPIO.............................................................27 Electronic circuit................................................................................................................................30 H-Bridge motor controller.............................................................................................................30 H-Bridge using relays / transistors / FETS / ICs...........................................................................32 SN754410 quad half-H driver IC..............................................................................................33 GPIO ports.....................................................................................................................................35 Circuit diagram...................................................................................................................................37 Breadboard design..............................................................................................................................38 Creating a more permanent circuit (stripboard vs PCB)...........................................................40 Printed Circuit Board - RyanTeck PCB kit RTK-000-001........................................................40 With diodes or without diodes..................................................................................................42 Heatsink....................................................................................................................................43 Controlling the speed of the motors with PWM............................................................................43 Writing the software to make it work.................................................................................................44 1 DRAFT Version Basic software design points..........................................................................................................45 Using the design to provide implementation details......................................................................45 Choosing the programming language.......................................................................................46 Getting started with Python...........................................................................................................46 Learning to program in Python......................................................................................................49 Programming the GPIO with Python.............................................................................................50 Remote control Python program....................................................................................................51 Testing the robot.................................................................................................................................53 Adding a camera.................................................................................................................................53 Using the camera...........................................................................................................................55 Developing the robot vehicle further..................................................................................................56 Remote control vs. autonomous robots..........................................................................................56 Adding additional sensors..................................................................................................................57 What is I2C and SPI?.....................................................................................................................57 What's next?........................................................................................................................................58 Appendix A – Shopping list................................................................................................................59 Appendix B – Software requirements specification...........................................................................60 Software requirements specification for Ruby Robot v1...............................................................60 Appendix C – Program listing robotcontrol.py..................................................................................62 Appendix D – Key codes for remote control program.......................................................................65 Glossary..............................................................................................................................................66
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages71 Page
-
File Size-