Learn Electronics with Raspberry Pi (eBook)

Physical Computing with Circuits, Sensors, Outputs, and Projects
eBook Download: PDF
2016 | 1st ed.
XXIV, 290 Seiten
Apress (Verlag)
978-1-4842-1898-3 (ISBN)

Lese- und Medienproben

Learn Electronics with Raspberry Pi -  Stewart Watkiss
Systemvoraussetzungen
56,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Learning electronics can be tremendous fun - your first flashing LED circuit is a reason to celebrate! But where do you go from there, and how can you move into more challenging projects without spending a lot of money on proprietary kits? One excellent answer is Raspberry Pi.

Raspberry Pi is everywhere, it's inexpensive, and it's a wonderful tool for teaching about electronics and programming. Learn Electronics with Raspberry Pi shows you how to make a variety of cool projects using the Pi with programming languages like Scratch and Python, with no experience necessary. You'll learn how the Pi works, how to work with Raspbian Linux on the Pi, and how to design and create electronic circuits. You'll then create projects like an arcade game, disco lights, and infrared transmitter, and an LCD display. You'll also learn how to control Minecraft's Steve with a joystick and how to build a Minecraft house with a Pi, and even how to control a LEGO train with a Pi. You'll even learn how to create your own robot, including how to solder and even design a printed circuit board!

  • Learn how to design and build electronic circuits, and even how to make a PCB
  • Learn how to make fun projects like an arcade game, a robot, and a Minecraft controller while learning about sensors and how devices talk to each other
  • Get started programming the Pi with Scratch and Python


Stewart Watkiss graduated from the University of Hull, United Kingdom, with a masters degree in electronic engineering. He has been a fan of Linux since first installing it on a home computer during the late 1990s. While working as a Linux system administrator, he was awarded Advanced Linux Certification (LPIC 2) in 2006, and created the Penguin Tutor website to help others learning Linux and working toward Linux certification.

Stewart is a big fan of the Raspberry Pi. He owns several Raspberry Pi computers that he uses to help to protect his home (Internet filter), provide entertainment (XBMC), and teach programming to his two children. He also volunteers as a STEM ambassador, going into local schools to help support teachers and teach programming to teachers and children.

Make a variety of cool projects using the Pi with programming languages like Scratch and Python, with no experience necessary. You'll learn how the Pi works, how to work with Raspbian Linux on the Pi, and how to design and create electronic circuits. Raspberry Pi is everywhere, it's inexpensive, and it's a wonderful tool for teaching about electronics and programming. This book shows you how to create projects like an arcade game, disco lights, and infrared transmitter, and an LCD display. You'll also learn how to control Minecraft's Steve with a joystick and how to build a Minecraft house with a Pi, and even how to control a LEGO train with a Pi. You'll even learn how to create your own robot, including how to solder and even design a printed circuit board!Learning electronics can be tremendous fun - your first flashing LED circuit is a reason to celebrate! But where do you go from there, and how can you move into more challenging projects withoutspending a lot of money on proprietary kits? Learn Electronics with Raspberry Pi shows you how to and a lot more. What You'll LearnDesign and build electronic circuitsMake fun projects like an arcade game, a robot, and a Minecraft controllerProgram the Pi with Scratch and PythonWho This Book Is ForMakers, students, and teachers who want to learn about electronics and programming with the fun and low-cost Raspberry Pi.

Stewart Watkiss graduated from the University of Hull, United Kingdom, with a masters degree in electronic engineering. He has been a fan of Linux since first installing it on a home computer during the late 1990s. While working as a Linux system administrator, he was awarded Advanced Linux Certification (LPIC 2) in 2006, and created the Penguin Tutor website to help others learning Linux and working toward Linux certification.Stewart is a big fan of the Raspberry Pi. He owns several Raspberry Pi computers that he uses to help to protect his home (Internet filter), provide entertainment (XBMC), and teach programming to his two children. He also volunteers as a STEM ambassador, going into local schools to help support teachers and teach programming to teachers and children.

Contents at a Glance 6
Contents 8
About the Author 16
About the Technical Reviewer 18
Acknowledgments 20
Introduction 22
Chapter 1: Getting Started with Electronic Circuits 26
Voltage, Current, and Resistance 27
Ohm’s Law 28
Electrical Safety 29
Breadboard 30
A First Breadboard Circuit 33
Calculating the Resistor Value 35
Static-Sensitive Devices 35
More Circuits 36
Chapter 2: All About Raspberry Pi 37
Introduction to the Raspberry Pi 37
Raspberry Pi GPIO Ports 38
Serial Communications/UART 40
I2C: Inter-Integrated Circuit 40
SPI: Serial Peripheral Interface Bus 40
PWM: Pulse Width Modulation 41
Getting Started with Raspbian Linux 41
Connecting to the Raspberry Pi Using the Network 42
Secure Shell (ssh) 43
Remote Desktop Using VNC (TightVNC) 44
More Raspberry Pi 45
Chapter 3: Starting with the Basics: Programming with Scratch 46
Introduction to Scratch 46
Scratch with GPIO Support 49
Controlling an LED Using Scratch GPIO Server 49
Light Emitting Diode (LED) 50
Resistor 50
Connecting the LED to the Raspberry Pi 51
Adding an Input to the Scratch GPIO Program 54
Using a Switch as a Digital Input 54
Adding the Switch to the Circuit 55
Robot Soccer 57
Playing Robot Soccer 65
Mars Lander Arcade Game 66
Making an Enclosure 66
Adding Joystick and Switches 67
Wiring the Switches 68
Creating the Game 69
Playing the Game 76
More Games 76
Chapter 4: Using Python for Input and Output: GPIO Zero 77
Power Supplies 77
+5V from the Raspberry Pi GPIO 78
Another USB Power Supply 78
Other External Power Supplies 79
Main Power Supply 81
Batteries 81
Brighter LEDs with a Transistor 81
Transistor 81
Calculating the Resistor Sizes 83
Introduction to Python 85
Getting Started with Python GPIO Zero 88
Using a While Loop 90
Circuit Diagram and Schematics 90
Brighter LEDs with Darlington Transistors 95
Reading a Switch Input with Python GPIO Zero 99
Disco Lights with MOSFETs 101
Light Sequence Using a Python List (Array) 106
Switching AC Lights Using a Thyristor and a TRIAC 107
More GPIO Zero 109
Chapter 5: More Input and Output: Infrared Sensors and LCD Displays 110
PIR Sensor and Pi Camera 110
Controlling a Raspberry Pi Camera with picamera 110
Using a PIR Sensor as a Motion Sensor 113
Using the PIR Motion Sensor to Trigger the Camera 116
Infrared Transmitter and Receiver 117
Infrared Receiver 117
Infrared Transmitter 118
Infrared Transmitter and Receiver Circuit 119
Configuring the Infrared Transmitter and Receiver Using LIRC 120
Receiving Infrared Commands Using python-lirc 124
Sending an Infrared Code Using Python 126
More Infrared Devices 126
Changing Voltage with a Level Shifter 127
Voltage Divider Circuit to Reduce Input Voltage 127
Unidirectional Level-Shift Buffer 128
Bidirectional Level-Shifter 129
I2C LCD Display: True or False Game 131
LCD Character Display 131
I2C 131
I2C Backpack for the LCD Character Display 132
True or False Game Circuit 133
Setting Up the I2C Connection and Adding the Code 135
SPI Analog to Digital Input 141
Creating an Analog Value Using a Potentiometer 141
Analog-to-Digital Conversion 142
SPI (Serial Peripheral Interface Bus) 142
Potentiometer SPI Circuit 144
Accessing the ADC Using Python 145
More Input and Output 147
Chapter 6: Adding Control in Python and Linux 148
Taking the Next Steps in Python Programming 148
Creating Python Functions 151
Adding Disco Light Sequences Using Python Functions 151
Using a Python Main Function 154
Making Python Programs Executable 154
Handling Command-Line Arguments 155
Running Python Programs as a Service 157
Running Programs at Regular Intervals with Cron 158
Creating an Automated Lego Train Using Infrared 159
Dealing with Conflicts 163
Software to Control the Lego Train Using LIRC and GPIO Zero 164
Using the Internet of Things to Control the Model Train 165
Controlling Color Light Strips Using NeoPixels 172
Powering RGB LEDs 174
How the RGB LEDs Work 174
Installing the Python Module 174
Controlling RGB LEDs from Python 175
Creating a Graphical Application Using Pygame Zero 176
Adding an Icon to the Raspbian Desktop 184
More Linux and Programming 186
Chapter 7: Creating Video with a Pi Camera 188
Infrared Shutter Release 188
Designing the Film 193
Filming the Scenes 195
Editing the Video 196
Creating the Video on a Raspberry Pi 196
Editing the Video on a PC Using OpenShot 197
Adding Effects to the Video 199
Adding Special Effects Using GIMP 200
Making Changes to Video Frames 201
Using Green Screen Special Effects 202
Adding Sounds to the Video 206
Recording Sounds with Audacity 207
Making Your Own Background Music with Sonic Pi 208
Adding Sounds to OpenShot 208
More Video Editing 209
Chapter 8: Rolling Forward: Designing and Building a Robot 210
Selecting or Making a Robot Chassis 210
Two Motorized Wheels and Omnidirectional Wheel 211
Four Motorized Wheels 211
Caterpillar Tracks 211
Wheels that Steer 211
Buying a Kit or Making Your Own 211
Choosing a Raspberry Pi 212
Controlling the Motors 213
DC Motors and Stepper Motors 213
H-Bridge Motor Control 215
Controlling the Speed with Pulse Width Modulation (PWM) 219
Powering the Motors and the Raspberry Pi 220
Building the Circuit on a Breadboard 221
Add-On Motor Controller Boards 222
Controlling the Robot Using Python 223
Measuring the Distance Using an Ultrasonic Range Sensor 227
Controlling the Robot Using a Wii Remote 231
More Robotics 237
Chapter 9: Customize Your Gameplay: Minecraft Hardware Programming 238
Connecting to Minecraft with Python 238
Moving Around Using a Joystick 241
Building a House in Minecraft 244
Adding Status LEDs 248
Find the Glowstone Game 253
More Minecraft Hardware Programming 255
Chapter 10: Making Your Circuits Permanent 256
Soldering Basics 256
Gathering the Essential Tools 256
Choosing Solder 258
Safety Tips When Soldering 259
Soldering to a Printed Circuit Board 260
Soldering Direct to Leads 261
Stripboard 262
Perfboard 262
Raspberry Pi Prototyping Boards 262
Cases and Enclosures 264
Testing Tools 264
Multimeter 265
Oscilloscope 266
More Project Making 267
Chapter 11: Let the Innovation Begin: Designing Your Own Circuits 268
The Design Process in a Nutshell 268
Looking at Manufacturer Datasheets 269
Designing with Fritzing 272
Designing a Circuit Diagram/Schematic 272
Design Conventions 275
Creating a Breadboard Layout 276
Creating a Stripboard Layout 277
Designing a Printed Circuit Board 277
Powering the Raspberry Pi 281
78xx Linear Voltage Regulator 281
Buck Converter 281
Designing More Circuits 282
Appendix A: Required Tools and Components 283
Tools Required 283
Basic Breadboard Circuits 283
Crimping and Soldering Tools 283
Manufacturing Tools for Enclosures 284
Meters and Test Equipment 284
Components for Each Project 284
Chapter 1: Simple LED Circuit 284
Chapter 3: LED Circuit 285
Chapter 3: Switch Input Circuit 285
Chapter 3: Robot Soccer 285
Chapter 3: Mars Lander 285
Chapter 4: Brighter LED 286
Chapter 4: Brighter LEDs with Darlington Transistors 286
Chapter 4: Disco Lights 286
Chapter 5: PIR Sensor and Pi Camera 286
Chapter 5: Infrared Transmitter and Receiver 286
Chapter 5: I2C LCD Display True or False Game 287
Chapter 5: SPI Analog to Digital Input 287
Chapter 6: Automated Lego Train 287
Chapter 6: NeoPixels 287
Chapter 7: Video Capture 287
Chapter 8: Breadboard Based Robot 288
Chapter 8: Robot Using Ryanteck Motor Control Board 288
Chapter 8: CamJam Robot 288
Chapter 8: Robot with Ultrasonic Range Sensor 288
Chapter 9: Minecraft Hardware 288
Chapter 10: Permanent Circuits 288
Chapter 10: True or False Game 289
Chapter 11: Powering the Raspberry Pi 289
Appendix B: Electronic Components Quick Reference 290
Resistors 290
Variable Resistors 290
Switches 290
Diode 291
Light Emitting Diode (LED) 291
Multi-Colored LEDs 291
Bipolar Transistor 291
Darlington Transistor 292
MOSFET Transistor 292
Capacitor 292
Thyristor 292
Triac 292
Appendix C: Component Labeling 293
Resistor Color Codes 293
SMD Resistors 295
Electrolytic Capacitors 295
Polyester Capacitors 296
Ceramic Capacitors 297
Appendix D: GPIO Quick Reference 298
GPIO Pin Layouts 298
GPIO Ports with Alternative Functions 299
Index 301

Erscheint lt. Verlag 15.6.2016
Zusatzinfo XXIV, 290 p. 191 illus., 153 illus. in color.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Mathematik / Informatik Informatik Theorie / Studium
Informatik Weitere Themen Hardware
Schlagworte Arduino • Electronics • LEGO • Maker • Minecraft • programming • Redstone
ISBN-10 1-4842-1898-1 / 1484218981
ISBN-13 978-1-4842-1898-3 / 9781484218983
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 19,1 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich