RASPBERRY PI PROJECTS FOR KIDS
CREATE AN MP3 PLAYER, MOD MINECRAFT, HACK RADIO WAVES, AND MORE!
BY DAN ALDRED
SAN FRANCISCO
RASPBERRY PI PROJECTS FOR KIDS. Copyright 2020 by Dan Aldred.
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.
ISBN-10: 1-59327-946-9
ISBN-13: 978-1-59327-946-2
Publisher: William Pollock
Production Editor: Laurel Chun
Cover Illustration: Derek Yee
Photography: Nigel Whitfield
Interior Design: Beth Middleworth
Developmental Editor: Liz Chadwick
Technical Reviewer: Les Pounder
Copyeditor: Anne Marie Walker
Compositor: Happenstance Type-O-Rama
Proofreader: Lisa Devoto Farrell
Circuit diagrams made using Fritzing (http://fritzing.org/).
The following images are reproduced with permission:
The photo in ).
For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1.415.863.9900;
www.nostarch.com
Library of Congress Cataloging-in-Publication Data:
Names: Aldred, Dan, author.
Title: Raspberry Pi projects for kids : create an MP3 player, mod Minecraft,
hack radio waves, and more! / Dan Aldred.
Description: San Francisco : No Starch Press, Inc., [2019]
Identifiers: LCCN 2019023893 (print) | LCCN 2019023894 (ebook) | ISBN
9781593279462 (paperback) | ISBN 9781593279479 (ebook)
Subjects: LCSH: Raspberry Pi (Computer)--Juvenile literature. | Python
(Computer program language)--Juvenile literature. |
Microcomputers--Juvenile literature. | Computer programming--Juvenile
literature.
Classification: LCC QA76.8.R15 A53 2019 (print) | LCC QA76.8.R15 (ebook)
| DDC 005.13/3--dc23
LC record available at https://lccn.loc.gov/2019023893
LC ebook record available at https://lccn.loc.gov/2019023894
No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Raspberry Pi is a trademark of the Raspberry Pi Foundation. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The information in this book is distributed on an As Is basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it.
ABOUT THE AUTHOR
Dan Aldred is a Computer Science teacher, freelance writer, and hacker. He has championed the use of the Raspberry Pi as a tool for learning and creativity, and is a Raspberry Pi Certified Educator. Aldred led the winning team of students for the first Astro Pi competition whose code is now orbiting Earth aboard the International Space Station. He currently lives in the United Kingdom.
ABOUT THE TECH REVIEWER
Les Pounder is a Creative Technologist who solves problems using code and electronics. He has worked with the Raspberry Pi Foundation to deliver their teacher training program, and with schools and universities to help teachers create engaging projects in code. Les writes Raspberry Pi projects for magazines such as Linux Format, Linux User & Developer, MagPi, and Beanz. He also writes Raspberry Pi content for the sites Toms Hardware, Tech Radar, and Electromaker. Les blogs at https://bigl.es.
CONTENTS
ACKNOWLEDGMENTS
Thank you to the team at No Starch Press for continuing to be a pleasure to work with and proving that remote teleworking across continents works! A big shout out and thanks to Les who not only checked and reviewed the program code but who also has always been there for programming advice, support, and inspiration. It was his insightful advice in response to the question How do I get into freelance work? that kick-started my journey with this book. Thanks also to Nigel Whitfield for the photography and images.
There are countless other inspiring hackers, makers, and people who have taken the time to listen to me, develop my understanding, and create opportunities. To them all, I offer a nod of appreciation.
Finally, thanks to Kay, the most inspirational person that I know.
INTRODUCTION
WELCOME TO RASPBERRY PI PROJECTS FOR KIDS, WHICH WILL SHOW YOU HOW TO HARNESS THE POWER OF THE RASPBERRY PI COMPUTER AND PYTHON CODE TO CREATE 12 AWESOME PROJECTS. YOU CAN THEN TAKE THE NEW SKILLS AND TECHNIQUES YOU LEARN HERE AND APPLY THEM TO YOUR OWN PROJECTS. THIS BOOK IS AIMED AT BEGINNERS TO USING THE RASPBERRY PI AND BUILDING HACKS, AS WELL AS AT THOSE MORE EXPERIENCED WHO MAY BE LOOKING FOR A LITTLE INSPIRATION FOR THEIR OWN NEXT GREAT BUILD.
WHAT IS THIS BOOK ALL ABOUT?
Over the years, Ive gained a lot of enjoyment from the Raspberry Pi, a small but versatile $35 computer. In my role as a computer science teacher at a large school, Ive been fortunate to witness firsthand the positive and life-changing impact of Raspberry Pibased learning. Using the Pi develops programming skills and hones thinking skills, building confidence along the way. The Pi is enormously successful as an educational tool, and the key to this success is that the Pi is fun!
Coding is no longer about just typing out line after line of instructions. Instead, you can learn to code by hacking Minecraft, making an MP3 music player, or building a spy cam. When using the Raspberry Pi, youre not just building and coding a distance sensor youre creating a friend- or enemy-tracker.
Its this combination of fun and learning, and the Pis versatility, that makes it such a great tool for education.
In my spare time, I research, tinker, and create many of my own Raspberry Pi projects, which I build and share on my website www.tecoed.co.uk. I wrote this book because I want to share my passion for making. Most important, I wanted to write a book that lets you develop relevant skills through exciting and useful hacks.
WHATS IN THE BOOK
In each chapter of this book, youll learn Python programming skills through building cool, inspiring, and useful hacks that can be deployed around your home. Each chapter is divided into simple step-by-step instructions, with plenty of diagrams to build the project. Ill also encourage you to test your skills by developing your hacks further on your own.
This book requires no previous Raspberry Pi coding or experience.
I hope that you have as much fun building the projects as I did when writing this book. Heres a quick breakdown of the content in each chapter:
This first chapter provides all the information required for you to get started with your Raspberry Pi. It covers setting up the hardware, installing the operating system, accessing your Pi from another computer, and other useful skills. If you already know your way around the Pi and the Python programming language, you can jump straight into one of the hacks.