Introducing the Raspberry Pi
In This Chapter
The Raspberry Pi is a tiny, single-board computer. It’s inexpensive, easy to work with, and adaptable to a variety of fun and creative projects. Originally released in 2012, the Raspberry Pi was created by a nonprofit, the Raspberry Pi Foundation, looking to get computers into the hands of young students. But electronics hobbyists have since latched on too because it’s so simple to use and flexible in its capabilities.
At just $20 for the Model A+ and $35 for B, B+, and 2, the Raspberry Pi is one of the most economical computers available. It’s about the size of a credit card; runs free, open-source software; and can be set up in a matter of minutes. It’s so inexpensive because you don’t get a case, a monitor, or even a keyboard, but you can probably use the accessories you already own with it.
The Raspberry Pi is built and priced so it’s affordable and pliable enough for use with all kinds of single-purpose projects. We’re going to look at a lot of those projects throughout this book. But first, we need to learn the basics of the Raspberry Pi’s hardware and how it came to be.
A single-board computer (SBC) is a computer built on one circuit board. It has a microprocessor, memory, inputs, outputs, and everything else it needs to work all built onto a single board. This differs from a traditional desktop personal computer, in which all those components are separate pieces.
DEFINITION
Open-source software is computer software whose source code is available to the public. This means multiple people can develop the software collaboratively. Typically, open-source software is free and without regional restrictions so anyone can use it anywhere in the world. A microprocessor includes all the functions of a central processing unit (CPU; the “brains” of a computer) on a single circuit. This means one processor can have multiple functions. It works a lot like your laptop or desktop computer, but it’s smaller and a little slower.
The Raspberry Pi is built so the processor, graphics processor, and memory are all on the single, credit card–size board. Because everything is condensed in such a small space, it’s not super powerful, but it is inexpensive to manufacture.
The Raspberry Pi is a single-board computer about the size of a credit card that has myriad options for customization.
The lack of processing power also means it doesn’t take a lot of electricity to run the Raspberry Pi. All you need to turn it on is an inexpensive, 5-volt mobile phone power cord. Unlike a traditional computer, the Raspberry Pi doesn’t use that much energy when it’s running, so it’s a good way to keep power consumption down in the home.
In addition to the Raspberry Pi, other popular single-board computers include the Arduino Intel Galileo, BeagleBoard, and other computers used to power systems like video poker and digital kiosks. These computers work very similar to the Raspberry Pi, although they typically have different components and run other operating systems. It’d be wrong to say they directly compete with each other, but they certainly exist in the same space and are used for similar types of projects.
Single-board systems are popular with electronics hobbyists—especially the do-it-yourselfers—because they’re an affordable way to prototype ideas and don’t require a ton of technical skill to use. Almost anyone can create a simple electronics system with a single-board computer because they’re easy to develop for and cost-efficient to experiment with. Even better, it’s almost impossible to mess up the operating system because the code and software are rarely stored on the device itself.
Raspberry Pi Hardware
A few different versions of the Raspberry Pi are available as of this writing, the Model A+ (which replaced the Model A), the Model B, the Model B+, and the Model 2. The basics of the hardware are pretty much the same across all four models:
A Broadcom BCM2835 system on a chip (SoC): This is your Pi’s main processor, or brain. It includes a 700MHz ARM-based processor that handles all the actual computing done on the Pi. Its initial purpose was for mobile products. The Model 2 has a new chip, the BCM2836 ARMv7, which runs at 900MHz—significantly faster than previous models.
VideoCore IV GPU: This is your Raspberry Pi’s graphics processing unit (GPU). It’s integrated into the SoC and works with the processor to display graphics, including 1080p HD video.
256 to 1GB RAM: The original Raspberry Pi (the Model A) launched with 256MB RAM (random access memory), which is also what the Model A+ has, but subsequent versions (Models B and B+) have 512MB. The Model 2 doubles that with 1GB RAM. The extra RAM makes it possible for the newer Raspberry Pis to display better graphics, process higher-quality video, and run more advanced applications.
That’s a brief look at the Raspberry Pi hardware for now. We’ll dig into the specifics of the hardware for each different model more in the next chapter.
The Raspberry Pi Foundation
Established in 2009 in the United Kingdom, the Raspberry Pi Foundation is a charity designed to encourage computer science in schools and ensure people all over the world can have access to cheap computers and learn computer science at a young age. According to the foundation’s website, its mission is to “promote the study of computer science and related topics, especially at school level, and to put the fun back in learning computing.”
The foundation also is responsible for the production of the Raspberry Pi as well as the nonprofit programs that helped create the computer. The organization itself is actually two parts: the charity portion and the engineering portion. The engineering portion handles the actual manufacturing and distribution of the Raspberry Pi.
Eben Upton, Rob Mullins, Jack Lang, Alan Mycroft, Pete Lomas, and David Braben founded the Raspberry Pi Foundation. Upton was the main face of the Raspberry Pi during its production and launch, and he also was responsible for the software and hardware architecture. As a co-founder of the foundation, he, along with the other co-founders, worked to get the Raspberry Pi into the hands of as many people as possible at launch.
Currently, the foundation’s website (raspberrypi.org) hosts resources for students and teachers to learn the basics of computer science, as well as most of the files necessary to get the Raspberry Pi up and running. The foundation also does outreach to schools in both the United Kingdom and the United States to provide related resources for students.
Most of the lessons and resources for teachers are open source. The Foundation has also worked with Cambridge University Press to create a free, massive open online course (MOOC) that teaches basic computer science with the Raspberry Pi.
Although the Raspberry Pi has gone on to be used in many different ways beyond enabling students to learn about computers, the Raspberry Pi Foundation’s main purpose is still to support teaching computer science to young people.
On top of that, it’s also about getting a computer into the hands of as many people as possible. The Raspberry Pi Foundation wants to ensure every person can have a personal computer without spending hundreds of dollars for it. From there, the Foundation hopes to bring more people into computer science as well as provide a good foundation for learning the basic computer skills necessary to work in the future.
How the Raspberry Pi Came to Be
A small team of people from the University of Cambridge’s Computer Laboratory initially created the Raspberry Pi. The team noticed a decline in the number of students enrolling in the computer science program, and their solution was to create a small, inexpensive computer to get more people, especially children, interested in computing.
In 2008, the team started to work with Pete Lomas of Norcott Technologies and David Braben, co-author of the video game Elite. Together, they began working on what would become the Raspberry Pi by prototyping a number of different boards.
In 2011, the team started working with the RISC OS Open Ltd. (ROOL) community to create a version of the operating system Linux that would work well on the Raspberry Pi. This would eventually be replaced with Raspbian, the most popular operating system for the Raspberry Pi. (I show you how to install and get Raspbian running in Chapter 8.)
In 2012, as they got closer to production, the founders partnered with Premier Farnell, Allied Electronics, and Sony’s Technology Package in Wales to create the Raspberry Pi.
PI POINTER
Where did the name Raspberry Pi come from? In a 2012 interview, Raspberry Pi Foundation co-founder Eben Upton explained:
Raspberry is a reference to a fruit naming tradition in the old days of microcomputers. A lot of computer companies were named after fruit. There’s Tangerine Computer Systems, Apricot Computers, and the old British company Acorn, which is a family of fruit.
Pi is because originally we were going to produce a computer that could only really run Python. So the Pi in there is for Python. Now you can run Python on the Raspberry Pi but the design we ended up going with is much more capable than the original we thought of, so it’s kind of outlived its name a little bit.
The original purpose of the Raspberry Pi was to make available a cheap computer anyone could afford. To further that goal, it supports a number of free, Linux-based operating systems, so there’s no cost of purchasing an operating system to worry about. Because of this, you can choose between wide varieties of operating systems for your Raspberry Pi. The most popular operating system is Raspbian. If you’re not familiar with Linux, the way it works is a bit confusing, but I talk more about this in Chapter 7.
PI POINTER
The Linux thing can be confusing. The Raspberry Pi does run Linux, but Linux is just a blanket term for operating system distributions built on Linux. So Raspbian is an operating system that uses the core of Linux (mostly just the kernel) but is otherwise its own thing. (I explain this more in-depth in Chapter 7.)
But there’s a little more to it than just that.
In the 1980s, computers weren’t as user friendly as they are today, so people had to learn basic programming just to use a computer. As a result, some of those folks grew up and became interested in computer science.
Nowadays, however, most tasks on computers are so much easier, and that spark isn’t quite as strong as it once was. The Raspberry Pi hopes to change this. The creators made the Raspberry Pi easy enough to use that children can learn programming and other computer tricks with it. However, it’s not as simple to use as more advanced operating systems like Windows or Apple’s OS X. Therefore, it’s nearly impossible to complete a project with the Raspberry Pi without learning something, which was a design intention from the start.
Throughout this book, you’ll explore many different projects for the Raspberry Pi, and each will teach you a little something about computer science along the way. In some cases, this is as simple as learning how your Wi-Fi adapter works on your computer. In others, you’ll dig into basic programming to get everything working. Don’t let any of that scare you though. It might sound difficult now, but you’ll have a pretty good grasp of it all by the end.
After all, the original goal of the Raspberry Pi remains the same today: to show people how computers really work, how they can use them to manipulate the world around them, and how to program.
The Raspberry Pi’s initial designs were based both on the Raspberry Pi’s mission statement and a single goal: to release a $25 model as well as a $35 model. These target prices helped shape the design of the Pi. The designers wanted the Raspberry Pi to run Linux initially, along with programming software like Scratch and Python—another factor that influenced the final design.
DEFINITION
Scratch is a programming language for kids that uses flowcharts and animations to teach basic programming skills. Unlike most programming languages, it doesn’t require a lot of text input and instead relies on graphics to make programs. Python is a much more complicated programming language and is used to create all kinds of software. The goal of Python is simplicity, so it tends to use less lines of code than other programming languages. This makes it a good fit for the Raspberry Pi because it’s great for beginners.
The design of the Raspberry Pi was all about subtraction. The creators had two unavoidable costs: the RAM and the processor. From there, they had to add and remove different functions until they got something working at the price point they wanted. Because of this, the Raspberry Pi lacks a few modern conveniences. For example, a 5-volt USB socket handles the power. Not having an internal power supply keeps the cost down, but it also means there’s no power switch. The Pi is missing other common features, too, like flash memory, Wi-Fi, and a traditional hard drive. An SD card handles all the storage.
It’s not just the big stuff; the Raspberry Pi cuts all kinds of corners to keep the price down. It doesn’t have a battery-based clock, for instance, so it has to grab the time and date from a network or from the user every time it’s powered on.
All that work resulted in a computer that’s useable right out of the box for $35 or less. You can add most functions (like Wi-Fi) to suit your needs with the USB ports for just a few dollars more.
HARDWARE HELPER
One of the initial designs of the Raspberry Pi used a 22.1MHz processor and could only generate a 320×240 video signal. The final version has a 700MHz processor and can output a full HD-quality signal.
The Launch of the Raspberry Pi
From conception to launch, it took 7 years to bring the Raspberry Pi to market. In late 2011, the early alpha versions of the Raspberry Pi were being tested, and by January 2012, the beta versions were auctioned off to raise money for the charity.
By April 2012, the first Raspberry Pis began shipping with a limit of one per customer. Those restrictions were lifted by July of the same year as production increased to keep up with demand.
In November, the Model B of the Raspberry Pi was announced and released. It was the same basic board as the first version, but it had 512MB RAM, an additional USB port (two total), and an Ethernet port, all for a cost of $35. As a result, the Model A dropped to $25.
By October, 2 million Raspberry Pi units had been sold, and by June 2014, they hit the 3 million mark.
In July 2014, the Raspberry Pi Model B+ was released. In this model, the design was overhauled with more headers, two more USB ports (four total), a micro SD card slot, better audio, and a new design. The Model B+ and Model B both took on the $35 price tag.
In November 2014, the Model A+ was announced as a replacement for the original Model A. Like the B+, it features more GPIO pins, a micro SD card slot, and better audio. It retails for $20.
In February 2015, the Model 2 was announced and released. This model keeps the same design, USB ports, and micro SD card slot of the B+ but doubles the RAM and features a new, faster processor.
PI POINTER
The Raspberry Pi was always intended as an education device, but the creators figured out early on that hobbyists would be the driving force financially. The initial launch of the Pi marketed the device to these hobbyists, and it quickly became a go-to device for all kinds of do-it-yourself projects.
What’s Next for the Raspberry Pi
As of this writing, no immediate plans are in the works for an updated model, according to the Raspberry Pi Foundation’s website, which states:
… [A] new model may be released in 2–3 years, but this is not a firm schedule. A new model would inherently undo much of the community work that has been done to date on the Raspberry Pi, which would be counter-productive to our educational aims. We concentrate our engineering effort on making the software that runs on the Raspberry Pi faster and better all the time.
So dig in and feel confident that the work you’re doing to learn the ins and outs of the Raspberry Pi now won’t quickly be outdated with a new model release.
The Least You Need to Know