Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi Projects for Kids
Raspberry Pi Projects for Kids

Raspberry Pi Projects for Kids: Start your own coding adventure with your kids by creating cool and exciting games and applications on the Raspberry Pi.

By Daniel Leonard Bates
$25.99
Book Mar 2014 96 pages 1st Edition
eBook
$16.99 $10.99
Print
$25.99
Subscription
$15.99 Monthly
eBook
$16.99 $10.99
Print
$25.99
Subscription
$15.99 Monthly

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Black & white paperback book shipped to your address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Mar 25, 2014
Length 96 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783982226
Vendor :
Raspberry Pi
Category :
Table of content icon View table of contents Preview book icon Preview Book

Raspberry Pi Projects for Kids

Chapter 1. Getting Started with the Raspberry Pi

In the mid-2000s, some of the staff at the University of Cambridge noticed that there were fewer and fewer students applying to study Computer Science each year, and that they had less and less experience. Something had to be done. The answer was the Raspberry Pi — a small, inexpensive computer that makes programming as accessible and as much fun as possible. The idea is that students can play with the Raspberry Pi during their spare time, and in the process, learn valuable core Computer Science skills. Since its creation, many other groups have discovered how useful the Raspberry Pi can be, including schools, adults who want to brush up on their skills with technology, and electronics hobbyists.

This chapter describes how to get a Raspberry Pi computer up and running. Once this is done, the Pi behaves just like any other ordinary computer, and is capable of standard tasks such as browsing the web and playing games. We will learn in later chapters that the Raspberry Pi is also capable of performing some tasks which ordinary computers can't do. The following figure shows a Raspberry Pi board:

Materials needed


This book assumes that a Raspberry Pi Model B is used, with its two USB ports and network connection (shown in the preceding figure). Model A (with one USB port and no network connection) will also work, but a USB hub (described later) will be needed to allow both a keyboard and a mouse to be used at the same time.

Along with a Raspberry Pi computer, you will need the following peripherals. In order to keep costs down, the Raspberry Pi was designed to work with devices that people already owned; so you may find many of these components around your house already. Just make sure they're not in use before you take them!

Note

http://elinux.org/RPi_VerifiedPeripherals is a useful website for checking whether a particular device will work with the Raspberry Pi.

Power supply

The Raspberry Pi requires a Micro-USB connection (shown in the following figure), which is capable of supplying at least 700 mA (or 0.7 A) at 5V. Power supplies that can provide 1000 mA and more are available (and will be more reliable), but your chosen supply must give exactly 5 V. Most standard mobile phone chargers are suitable, and have their capabilities written on them, so you can check. Do not attempt to power your Pi from a USB port of another computer or hub as they are often incapable of supplying the required current.

Storage

The operating system and all files are stored on a standard SD card (shown in the following figure), which you may find in a digital camera. You will need at least 4 GB of space (preferably 8 GB+). The Raspberry Pi Foundation sells very affordable 8 GB SD cards with the operating system preinstalled at http://swag.raspberrypi.org/. You will also need a way to write data to an SD card from another computer. Many computers have built-in SD writers, but it is possible to buy USB dongles which do the job too.

Input

For inputs, we will use a USB keyboard and mouse (as shown in the following figures):

Video

We will use a monitor or a television with HDMI or DVI input, and a video cable connected from the Pi's HDMI port to the screen's input, as shown in the following figures. It is possible to connect to an older VGA or composite screen, but this is more complicated (refer to the Verified Peripherals link at the start of this section).

Network

An Internet connection is not essential, but is very useful as it allows you to work directly on the Pi. The easiest approach is to use a wired Ethernet connection. It is also possible to use a USB Wi-Fi dongle. You will need a powered USB hub to provide additional USB ports, as shown in the following images:

You may also like to put your Raspberry Pi in a case to protect it, though this is certainly not necessary. There are many different companies that make many different styles, so choose one that suits you, or you could even make your own from Lego or card!

Preparing the SD card


The first thing we need to do is put an operating system on the SD card using another computer. You can buy SD cards with preinstalled software, but doing it yourself guarantees that you get the latest updates and is also a useful learning experience. These instructions assume that you are using a computer running Microsoft Windows or Mac OS X; if you are using another operating system or having difficulties, detailed instructions are available online at http://www.raspberrypi.org/downloads.

There is a Troubleshooting section at the end of the chapter if you get stuck. We can prepare the SD card by performing the following steps:

  1. Download the SD association's formatting tool, SD Formatter, from http://www.sdcard.org/downloads/formatter_4/.

  2. Download the latest version of the NOOBS (offline install) operating system collection from http://www.raspberrypi.org/downloads.

  3. Insert the SD card into the SD card writer (shown in the following image):

  4. If the SD card writer is separate from your computer, plug it in.

  5. Install and run the SD Formatter (shown in the following screenshot). Select the SD card you just inserted and click on Format. In this example, the SD card is drive G, but this will vary from computer to computer.

    Note

    Make absolutely sure that you have the right SD card selected. All the data will be lost from the formatted card.

  6. Extract the contents of the NOOBS ZIP file to the SD card. The way this is done will vary depending on what software you have installed, but will typically involve double-clicking on NOOBS.zip, clicking on Extract or Extract to..., and selecting the SD card as the destination. There is a lot to extract, so this will take a few minutes to complete.

  7. Safely remove/eject the SD card and take it out of the SD writer, as shown in the following figure:

Starting up the Raspberry Pi


Now we can prepare the Raspberry Pi to start up for the first time. Place it securely on a desk or in a case. Make sure it is not in danger of falling on the floor, and do not rest it on top of the bag inside which it comes. We can start up the Rasberry Pi by performing the following steps:

  1. Plug the SD card, screen, keyboard, and mouse into the Raspberry Pi. Also plug in the Internet cable if you have one, as shown in the following figure:

  2. Plug the power cable into the Raspberry Pi. The red power light should come on, and the green Activity light should flash occasionally.

  3. If necessary, adjust the screen settings to display the images from the Raspberry Pi's input.

  4. You should see a selection of operating systems for you to install (refer to the following screenshot), each with a short description. This book relies on you having Raspbian installed, so select Raspbian and click on Install. You can always come back and select a different operating system later; I will explain how you can do this in the next section.

  5. Wait. Operating systems are quite large, so the installation will take a few minutes. You can sit back and read some of the tips shown to you or read the next few steps in this book.

  6. When the installation has completed, you should see a blue screen with a final list of options (shown in the following screenshot). This is the Raspberry Pi Software Configuration Tool. Most things should be set up the way we want them, but there are two useful settings to be changed. Select Enable Boot to Desktop/Scratch using the arrow keys and press Enter. Select the Desktop Log in option, and press Enter. You should now be back at the main menu. Next, select Internationalisation Options and choose your preferred language and keyboard layout. Use the right arrow key to move to Finish and press Enter. You can return to this menu any time by typing sudo raspi-config as a command line (refer to the next section for details).

  7. After a minute or so, the Raspberry Pi should finish rebooting, and you should see the Raspberry Pi desktop (shown in the following screenshot). This may be familiar to you. You can double-click on the icons to start programs, or select from a menu. We will mainly be using Scratch and Python in this book, but take a minute to explore what's available to you. In particular, there are several Python Games. These are the sorts of things that are possible after a little programming practice.

Using your Raspberry Pi


Now that your Raspberry Pi is up and running, you'll want to know how to keep it working properly and how to customize it to suit your needs.

The command line

Most of the time, it will be possible to do what you want to do using the mouse by clicking on different parts of the screen; however, at some point, you might find the need to use the command line, as shown in the following screenshot:

The command line is a completely text-based way of controlling a computer, and can be used to do just about anything that can be done by clicking and more. It is available on almost all computers, but is usually hidden away. Some computer users prefer using the command line because they can type faster than they can click the mouse!

Here is a very quick overview of some common commands. Open a command line by double-clicking on the LXTerminal icon on the desktop, and try these out. You will need to press Enter to inform the Raspberry Pi that your command has been executed. A longer introduction, including information on how to watch a movie in the command line, can be found online at http://www.techradar.com/news/computing/pc/1161712.

  • ls: This lists directory contents. (Directory is Linux's word for a folder.) This command will list all the files and directories available to you in the current directory.

  • cd <directory name>: This changes the directory and allows you to move into another directory, so you can see its contents in the same way that double-clicking on a directory icon moves you into that directory. You can move through multiple levels of directories in one go by separating the directory names with /, and you can go up to the parent directory (the directory that contains the current directory) using the special .. directory name.

  • man <program name>: This opens the manual and brings up lots of information about a particular program, including what it does and how to use it. It is very useful if you forget how to use something! Try man ls to see some advanced information about the ls command we tried earlier, and press q to quit. You can scroll through the information using the arrow keys or the Space bar.

  • <program name> [extra information]: This starts the program, and optionally passes some extra information to it. Try typing in scratch to start the Scratch program (we'll cover more about this in the next chapter); or, if you are connected to the Internet, navigate to midori www.raspberrypi.org to open the Midori web browser and go straight to the Raspberry Pi home page.

  • Tab: This key automatically completes a word. Even if you have not completely typed in the name of a program or file or folder, try pressing Tab. If there is only one option available that begins with the letters you have typed so far, the whole word will be completed for you. If there are multiple options (or none), nothing will change; you can press Tab again to display a list of possibilities.

Updating and installing new software

The Raspberry Pi is an unusual sort of computer, so if you want to install a program, you either need to download a version that is specifically for the Raspberry Pi, or use Raspbian's package system.

A package is a program or a part of a program, and many versions of Linux (including Raspbian) maintain a list of all compatible packages, making it easy to keep all of your software up to date. You can update to the latest version of this list if you have an Internet connection by typing sudo apt-get update in the command line.

Note

Be very careful when using the sudo command. It forces the Raspberry Pi to do exactly what you tell it to do, without checking to make sure that the command is sensible. The command is useful in situations like this, where we want to make changes to the installed programs, but it also allows you to delete essential files. Double check your spelling before continuing.

You can search for available packages with keywords using the apt-cache search <keywords> command. Try apt-cache search game, for example, to see a list of the free games available. You could even try installing one (XBubble is good, for example). The name of the package is the first word of the line, and you can install a package using sudo apt-get install <package name>.

To update all the installed packages to the latest available version, type sudo apt-get upgrade.

Other uses for Raspberry Pi

Although the Raspberry Pi was designed to get people interested in computing, its cost and power make sure that it is also popular for other reasons. Since the Raspberry Pi is a general-purpose computer, it is capable of everything a traditional computer can do, but perhaps a little slower. There is a web browser (Midori), word processors, and web servers that are available. A common use case is similar to a media center, to watch films and view pictures.

There are many different operating systems included within the NOOBS package. You can see them if you click on Shift when the Raspberry Pi first starts to boot, as shown in the following screenshot:

This will take you back to the list you saw earlier when you started your Raspberry Pi for the first time. Each operating system comes with a short description. There are a couple of different flavors of Linux, the very fast RISC OS, and two different media centers, OpenELEC and Raspbmc.

If you want to try one of these operating systems, make sure you first back up all of your data as it will be erased when the new operating system is installed.

Troubleshooting

One of the main strengths of the Raspberry Pi is its fantastic community. If you ever have any difficulties, consider stopping by the Raspberry Pi forums at http://www.raspberrypi.org/forum/. Your question may have already been asked; if not, there are thousands of enthusiastic Pi owners on hand to help. The following are the most common issues:

  • My Raspberry Pi doesn't boot – only the red power light shows: This suggests that the SD card was not written correctly. Try following the instructions again, and if that fails, try a new SD card.

  • My Raspberry Pi randomly restarts by itself: This is usually because the Pi is not receiving enough power. Double check that your power supply is capable of supplying at least 700 mA (0.7A) at 5V. This should be written somewhere on the supply. Perhaps you can try upgrading to a 1000 mA (1.0A) supply if you continue to have problems. Also, make sure that you do not have particularly power-hungry peripherals plugged into your Raspberry Pi. For example, some Wi-Fi dongles and keyboards with very bright LEDs can cause problems.

  • I can't enter my password in the login screen: Nothing is displayed when the password is entered (not even stars) to minimize the information that others can gain from seeing the screen. It is likely that the keys are still being recognized; try typing in the whole password blindly and pressing Enter.

  • The display does not fill my screen or extends beyond the edges: This is because of overscan settings. Many old televisions had cabinets that overlapped a part of the screen, so images were given black borders to ensure that no part of the picture was lost. Many modern monitors, however, do not have this problem, so the black bars are just a nuisance. First try enabling or disabling the overscan settings by typing sudo raspi-config at a command line and selecting the appropriate option. If this still does not work, search on the Internet for Raspberry Pi overscan troubleshooting for detailed guides.

  • I can't see anything at all on the screen: If the Pi is definitely on and the OK/ACT light is lit or flashing, try pressing 1, 2, 3, or 4 on your keyboard to select different video modes.

Summary


In this chapter, we learned how to connect up a Raspberry Pi computer, write its operating system to an SD card, and start everything up. We learned that the Raspberry Pi is capable of doing everything a normal computer can do (and more), and that it is targeted at programming.

In the next chapter, we will use one of the provided programming languages, Scratch, to create our own version of Angry Birds.

Left arrow icon Right arrow icon

Key benefits

What you will learn

Learn how to set up your own Raspberry Pi device Explore the world of programming by learning about Scratch and Python Program with Scratch to develop your own version of Angry Birds Get handson with some electronics to build your own reaction game Develop with Python in order to build your own version of Google Maps

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Black & white paperback book shipped to your address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Mar 25, 2014
Length 96 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783982226
Vendor :
Raspberry Pi
Category :

Table of Contents

11 Chapters
Raspberry Pi Projects for Kids Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Getting Started with the Raspberry Pi Chevron down icon Chevron up icon
Making Your Own Angry Birds Game Chevron down icon Chevron up icon
Testing Your Speed Chevron down icon Chevron up icon
Making an Interactive Map of Your City Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela