Sunday, August 10, 2025

Getting to Know the Raspberry Pi

Getting to Know the Raspberry Pi


 You probably wouldn’t have picked up this book if you hadn’t already heard about the amazing, low-cost computer for everyone, the Raspberry Pi. Besides being inexpensive, what’s made the Raspberry Pi so appealing is that it’s pretty easy to use. You can even change it to do things its designers never dreamed of. Unlike most consumer electronics, tablets, and desktop computers, the Raspberry Pi is designed to let you investigate how it works and change how it operates by writing your own software programs.

This is all possible because the Raspberry Pi uses an inexpensive but powerful processor and a free operating system, which is based upon the popular Linux platform. In this chapter, we take a look at what you need to get going and show you how to set it up.

We also tell you where to get a Raspberry Pi and the accessories you need to run it. We explain how to set up the operating system, how to connect the hardware, and what to do if you run into any problems along the way. Before long, you’ll be able to make your Raspberry Pi say, “Hello, world!

Getting a Raspberry Pi

If you’re interested in building projects with a Raspberry Pi, you probably already have one. But if you don’t yet have your own Raspberry Pi, this is the section for you! You’ll be glad to know that there are a few places you can pick one up quickly and cheaply.

The Raspberry Pi comes in several versions: Model A is shown in Figure 1-1, and Model B is shown in Figure 1-2. There are other versions of the Raspberry Pi, though — Chapter 4 has a full rundown. The Model A and Model B use the same kind of processor, but the Model A is cheaper and uses less power; it has a single USB port and connections for your screen and audio. Model B has everything Model A has, plus an additional USB port and an Ethernet port for connecting to a network, so it costs a little more. For the projects in this book, you’ll want to get a Model B.

The newest model as of this writing is the Raspberry Pi 2 Model B, which replaced the Model B+, but we’ve kept all the projects in this book compatible with Model B and later.

The Raspberry Pi Foundation (which is technically a UK charity, not a business) created the Raspberry Pi. The Raspberry Pi Foundation licenses the manufacture of the Raspberry Pi to the biggest names in electronics in the UK, RS Component

If you simply can’t wait to get your hands on a Raspberry Pi, and you live in the UK, you can also walk in to any Maplin electronics shop, where they’re usually kept in stock. You’ll pay a bit more for the convenience of shopping in a store, but you can get personal advice from the salespeople, which can be pretty useful if you have questions. At the time of this writing, you can walk into a Radio Shack in the United States and buy a Raspberry Pi starter kit, but this may change because the company is restructuring.

You can also find the Raspberry Pi for sale on eBay. There are usually plenty of listings for just a Raspberry Pi or for bundles that include all the accessories you need in order to hook it up.

If you decide to buy a Raspberry Pi on eBay, be sure to purchase from a reputable seller with plenty of good feedback. There are knock-offs out there, and they can’t be guaranteed to be manufactured to the same standards as the real thing. We tend to think the cost savings isn’t worth the risk of buying from eBay.

Discovering What You Can and Can’t Do with a Raspberry Pi

This book shows you how to get going with Raspberry Pi projects. After you’ve done some, you’ll have a pretty good idea of what’s possible. But when you want to go a bit further with your ideas, it’s good to know what you can realistically expect to achieve.

The first thing you see when you get up and running is a text-based prompt on the screen. You can do a lot of things just with text, but

most people prefer to launch the familiar graphical user interface (GUI), the desktop environment you’re used to on any other computer. The operating system supports all the things you’d want to do in a desktop system, including playing games, browsing the web, word processing, using spreadsheets, editing photos, and playing audio and video.

But that’s not where the Raspberry Pi really shines. The great things you can do with the Pi come into play when you write your own programs and hook it up to electronics or other objects in the real world using the general-purpose input/output (GPIO) connector. Your Pi is well suited for this because these kinds of things don’t usually require the beefy processor in your desktop or laptop. Using your Pi for things you may not do with your usual computer is what makes it really fun — and that’s what this book is all about!

The Raspberry Pi uses a Broadcom BCM2835 central processing unit (CPU) and a VideoCore IV graphics processing unit (GPU) and shares the onboard memory between them. Either 256MB or 512MB of onboard memory is available. The CPU is an impressive piece of technology that enables fairly complex computing power at an extremely low price. The trade-off is that the Pi is not nearly as powerful as the full-fledged CPU in desktop and laptop computers — it’s a bit slower, roughly comparable to the capabilities of mainstream computers in the ’90s. You shouldn’t plan to do high-performance computing or run heavily graphics-intensive applications like gams or 3D modeling software — the Pi will run these, but they may be unusably slow.

You probably won’t be replacing your main computer with a Pi, but you can do a lot of experimentation with it that you may not try with your desktop or laptop, and you can easily connect your Raspberry Pi to sensors and motors in the real world, which we show you how to do in the projects in this book. And if you make any big mistakes that damage your Pi, it doesn’t cost a lot to get another one and start experimenting again!

Getting Familiar with Your Raspberry Pi

The Raspberry Pi is about the size of a credit card and has all the components that you need onboard so that you can connect it to a TV or display and start using it. These connections are shown in Figure 1-3

Going clockwise around the board from the top left, you’ll find the following connections:

  • General-purpose input/output (GPIO) connector: This is a port for getting electrical signals into and out of your Raspberry Pi, such as for reading sensors and controlling motors. It’s composed of two parallel rows of pins and is labeled P1 (for “Plug 1”). Different models of Raspberry Pi use these pins slightly differently due to the way the pins are routed on the board.
  • Composite video output: This jack is used for connecting your Raspberry Pi to a composite video (standard TV) connection using an RCA cable.
  • Audio output: This is a black 3.5mm jack on the upper right of the board.
  • USB port(s): These ports allow you to connect USB accessories (such as a keyboard and mouse and external storage devices) to your board. The Model A has only one USB port to reduce costs. The Model B has two USB ports.
  • Ethernet port (Model B only): This port is for connecting your Raspberry Pi to an Ethernet network and for accessing the Internet.
  • Camera serial interface (CSI) connector: This slim black connector between the Ethernet jack and the HDMI output is for connecting a small camera such as a webcam. CSI connectors are available from the Raspberry Pi store.
  • HDMI output: This port is used for sending digital video to a computer monitor. The HDMI output also can route your audio, so you may not need to use the audio output port.
  • Power input: On the lower-left side is the micro USB power socket. The power is provided via a micro USB power supply that plugs into this port.
  • Display serial interface (DSI) connector: In the middle of the left side of the board is a slim connector for connecting high-speed displays. It’s used for connecting a small LCD panel directly to your Raspberry Pi. You can use it for touch-based input as well!

Selecting Your Accessories

You probably have some of the important accessories lying around the house already, which was exactly what its creators had in mind. You can just use old stuff that’s gathering dust — you don’t have to buy anything, which keeps the cost down. You don’t have to get all the accessories shown in Figure 1-4 to complete the projects in this book. But at a bare minimum, you’ll need a display and a keyboard to get things going. Here’s what you see in Figure 1-4:

  • Monitor: The Raspberry Pi’s onboard HDMI output allows you to connect a high-definition feed to just about any modern computer display. If your display has an HDMI input, all you need is a cable between the two.

    If your monitor doesn’t have an HDMI input, it probably supports DVI, which has a larger, wider connector. You can buy adapters that convert from HDMI to DVI that will allow you to use your DVI monitor. You can also use a VGA monitor (the VGA input contains three rows of holes), though these aren’t officially supported. If you want to use VGA, make sure to get an adapter that is specifically meant to work with a Raspberry Pi.

.

  • If you don’t want to use a computer display and you have an old TV, you can use it as a display. Your Raspberry Pi has an RCA connection, which allows you to use a composite video signal to a TV with a composite video input. The picture won’t be as sharp as with a display, and text can be hard to read, so we recommend using a monitor if you can.

  • Ethernet cable: Some of the projects in this book require connecting your Raspberry Pi to a network. For these projects, you’ll need an Ethernet cable.
  • Case: You can use your Raspberry Pi as is, right out of the box. It’s pretty durable, but accidents happen, so lots of people have fun making cool cases to protect the circuit board from spills and dust. Some cases are even enhanced with glowing LEDs. The designer of the Raspberry Pi logo, Paul Beech, has designed some cool cases — check out http://shop.pimoroni.com to find them.
  • Mouse: Any USB mouse will work fine. The Model A only has one USB port, so if you’re using a Model A, you’ll need to use a USB hub so that you can plug in both your mouse and your keyboard. You can also plug your mouse into your keyboard, if the keyboard has an extra USB port on it.
  • Keyboard: There is a USB port on the Raspberry Pi circuit board, so you can plug in a USB keyboard. If you have an older keyboard with a round (PS/2) connector, you can use it, but you’ll need a small adapter plug to convert between PS/2 and USB.
  • SD card: Your Raspberry Pi doesn’t have a hard drive, so you’ll need to use some kind of external storage. An onboard SD card slot is provided for this purpose. When you plug in an SD card, your Raspberry Pi treats it just like a hard drive. SD cards are pretty cheap, so go for one with at least 8GB or 16GB of storage. SD cards have class numbers to indicate how fast they can read and write data. We recommend you get a Class 6 SD card or better.
  • USB hub: If you’re using a Model A Raspberry Pi, you may need a USB hub to connect your keyboard and mouse (see the preceding bullet). If you’re using a Model B, you don’t need a USB hub, but you’ll probably want extra USB inputs into your Pi, because your keyboard and mouse will take up the two USB ports. Make sure to get a USB hub that has its own power source — the Raspberry Pi can provide only limited power output via USB.
  • USB memory stick (not shown): Memory sticks (also called memory keys or flash drives) can provide a great deal of extra storage that is fast and reliable. They’re also handy for moving files from another computer or laptop to your Raspberry Pi.
  • SD card writer (not shown): The Linux operating system for your Raspberry Pi is stored on an SD card. You can buy SD cards with the operating system already loaded, but you’ll probably want to write your own at some point, so you need to make sure your computer has an SD card slot. Most desktops and laptops have one these days, but if yours doesn’t, you should get an SD card writer. It plugs into your USB port and allows your computer to see what’s on the card and write files to it.
  • Speakers (not shown): Your Raspberry Pi has a 3.5mm audio jack so you can plug in headphones or external speakers. If you’re using the HDMI connection and HDMI monitor as a display, the audio is sent over that cable to your screen.
  • Micro USB power supply (not shown): Your Raspberry Pi gets its power via the micro USB connector on the side. You can use just about any power charger that fits this port, but it needs to supply 700 milliamperes (mA) of current (check the specifications printed on the side of the charger). Most good mobile phone chargers will work fine, as long as they supply 5V 700mA (3.5 watts). We recommend a Raspberry Pi–compatible power adapter, which should be available from the supplier of your Raspberry Pi.
  • No comments:

    Post a Comment

    Getting to Know the Raspberry Pi

    Getting to Know the Raspberry Pi  You probably wouldn’t have picked up this book if you hadn’t already heard about the amazing, low-cost com...