Raspberry Pi — the little computer that could

In the last few years, we’ve seen a slew of single board computers (SBC’s): Arduino, Beagle Board, Raspberry Pi…. They all have their place, and we’ll speak a bit later about what those places are. But I’m here to tell you that for all-around computer science use and mega bang-for-the-buck, you just can’t beat the Raspberry Pi.

By now, most people know about its back story, springing out of Cambridge University and a desire of their CS profs to acquaint their students with what a computer actually IS. There’s no doubt that computers are easy to use today, but that very ease of use has taken away some of the fun and excitement of learning how a computer works and how to get it to do what you want it to do. I’m totally dating myself here, but I do remember getting a Commodore 64 (cue the “backintheday” music as Grandpa regales the young’ns with tales of yesteryear). When the 64 first came out, there was a dearth of software available. But it did come with a thick spiral bound book called “Commodore Basic”. The expectation was that anyone who bought a computer would certainly want to program her own software, not just buy stuff off the shelf. And there were several magazines on the newstands that had “type-in” programs that ran several pages. I think some of it was even in assembly language! But the thinking was that computers helped you get stuff done, play games, etc., but also were things that you could use to make your own stuff.

Today, computers are a black-box technology, like a car. How does a computer work? I love asking that question and seeing the blank faces of my students! It’s easy, Mr I, you push the button! My personal favorite answer is “gypsy magic”; top points for creativity. But that doesn’t get us any closer to understanding what a computer actually is! Though it’s a wonderful fulfilment of Arthur C Clarke’s saying that any technology that we don’t understand is the same as magic. So if we can start to figure out how it works and get it to do stuff that we want it to do, then I guess we’re wizards! All right!

So this little credit-card sized, $35 computer is getting us closer to being magicians, and probably better than anything else available today. So how does it do this, exactly?

First of all, it’s not in a box. You can see the motherboard, the CPU, the traces on the board… You can plug sensors and wires into its 40 GPIO pins, which provide voltage and “channels” you can use to code attachments. And the attachments are plentiful and not too expensive, running the gamut from sensors to lights to buzzers to cameras to audio devices to… whatever! You can see both sides of the USB ports, so the mystery of the inside of the computer is laid bare.

The Raspberry Pi Foundation provides an updated OS, as well, called Raspian. It’s an offshoot of Linux (but so is the Apple OS, so don’t be scared). This OS has a modern looking GUI (graphical user interface) and comes with a host of programs that you can run right away. So it’s not too scary looking to students familiar with Windows and Apple: desktop, menus, icons, left and right clicks, etc. Pretty intuitive, we’d say. However, some tasks require digging into the terminal, a CLI (command line interface), which goes way back. And while that’s new and different to many students, it’s not impossible. Though, as I often remind them, spelling counts!

And it comes with an ever-changing assortment of free, open-source software (and that can actually be an interesting discussion. Why is this software free? Who writes and maintains it? I love seeing the students eyes widen as the catch a glimpse of an economic model that’s an alternative to individualized capitalism…). The current version as of this writing (Stretch, and yes, all of the versions of RP are named after characters in the Toy Story series. So if you had any doubts about how cool this all is….) includes the Libre Office productivity suite, Mathematica, a browser, some games, and most importantly for our purposes, a host of programming tools and environments. Scratch 1.4 and 2.0, Python 2 and 3, Java, Greenfoot. An older version of Minecraft is included FREE, and though it’s not the latest and greatest, it’s perfect for learning coding. Check out my chapter on that. And there’s even a live music coding application called Sonic Pi. While I wouldn’t use it for my everyday computer, it can do a lot that an everyday computer can’t do, like physical computing and attaching to other machines.

One thing that the Pi doesn’t have is a hard drive. In order to keep the form factor small and the cost down, they work by loading the OS (Raspian) from an SD card, which autoboots when the Pi is powered. Programs are saved to the SD card as well. So it’s a little bit of a throwback to DOS.

So what do you need to get started with RP in your classroom? Well, that $35 computer thing isn’t entirely accurate. You’ll need a few other things, but the RP people rightly figure that everybody already has a keyboard, mouse and monitor. All of these are plug and play. Latest version of the Pi has 4 USB ports and an HDMI port. You’ll also need some sort of power source, and the wall wart variety are available and usually come in a RP kit. In my classroom, I power them from power bars that have USB slots, which I’ve found preferable to having 25 wall warts to take care of. I use the power bar to power the monitor and the other computers I have in my room, which all run Windows 10.

How do you get Raspian on an SD card? Fortunately, www.raspberrypi.org has download links for the latest version, as well as instructions for how to download it and install it on an SD card. Once you put Raspian on the SD card, put the card in the Pi, and power it up, the installation software takes over, prompting you from time to time for your preferences. Don’t worry, all of the preferences can be changed from the settings menu on the Pi.

Because it’s based on Linux, which is based on Unix, which is a user-based system, the Pi requires a login. The initial default username is pi, and the password is raspberry. You should change that as soon as you can. One advantage to this is that if you have multiple students using the same Pi and the same SD card, you can set up different users so they don’t all save to the same folder. It’s not necessary but you might save yourself and your students some serious grief. I’m not sure why, but students sometimes all use the same filename when they save their Scratch game (“game” is a favorite). And if that happens, Johnny will overwrite Suzie’s Scratch “game”. Ouch.