Exploring the Raspberry Pi through real-world projects
Pi Are Squared
The single-circuit-board Raspberry Pi computer, only as big as a credit card, makes it easy to gain experience with embedded Linux systems. We'll show you some hands-on examples of how to use the Raspberry Pi in an everyday environment.
British engineer Eben Upton and a team of like-minded hardware hackers started the Raspberry Pi project as a means for providing affordable computer technology for interested young people [1]. The objective was to develop and market a single-board, credit-card-sized computer compatible with the often-narrow budget of the target group (see the "History" box).
History
In 2006, Eben Upton and his team developed the first concepts for the Raspberry Pi based on the Atmel ATmega. The idea of getting young people interested in the mini-computer was already part of the program. In 2009, the members officially established the Raspberry Pi Foundation.
In August 2011, the alpha series of around 50 boards left production. They served primarily as a platform for developers, for debugging and for demonstration purposes. In December 2011, the beta series of 25 boards followed, which were already based on the production layout. The developers eliminated the last flaws. In an online auction in January 2012, 10 boards from this beta series were sold for a total of UK£ 16,336.
On February 29, 2012, at 7:00am Central European Time, the web servers of the foundation and of the two distributors were overloaded within a few minutes by the storm of requests. Many customers waited for hours to submit a pre-order.
If you find yourself reminded of the first home computers, you are not completely off-target: The explicit goal of the founders was to recolonize basements, garages, and classrooms with the spirit of the generation that had grown up with the Atari 400/800, ZX80/81, or VC20/C64.
Almost one year after the Raspberry Pi appeared, it is appropriate to look back over what has happened between the first series of approximately 10,000 pieces and the present status approaching 1,000,000 pieces delivered: How successful has the project been? What capabilities does the hardware offer? What is possible, and what is not (yet) possible? This article explores the Raspberry Pi system through three real-world projects:
- a multimedia, video playback system,
- a wireless access point, and
- an embedded temperature controller unit.
The first project is an example of the Raspberry Pi system serving as a replacement for a standard desktop computer. The latter two examples showcase the Raspberry Pi as an embedded system, which will require a little programming knowledge but, also, will give you a glimpse into the versatility of this mighty little mini-computer. Perhaps all three examples will help you imagine other do-it-yourself projects you could create with your own Raspberry Pi.
Shopping List
Originally, the designers had planned an A and B model, which were to differ mainly in the number of USB ports (one or two), the availability of an Ethernet port, and, of course, price (US$ 25/35). At this time, only model B is available. See Table 1 for a summary of Raspberry Pi components.
Table 1
Raspberry Pi Technical Data
Component | Type |
---|---|
SoC |
Broadcom BCM2835 (system on chip) |
CPU |
ARM1176JZF-S, 700 MHz |
GPU |
Broadcom VideoCore IV (OpenGL ES 2.0, OpenVG, 1080p30, H.264 high-profile encode/decode) |
RAM |
512MB of RAM |
Ports |
|
USB |
2 x USB 2.0 |
Ethernet |
1 x 10/100 Mbps |
SD/MMC |
1 x slot |
Audio |
1 x stereo analog out |
Video |
1 x composite out, 1 x HDMI out |
To get the Raspberry Pi (or RasPi for short) up and running, you need to make a list of the basic components. The Internet has more for tips on advanced operations [2] [3]. Currently, only two global distributors have the board in their catalog [4] [5]. Although delivery times of a few months were not unusual in the spring of 2012, you now generally only have to wait a few weeks.
Besides the board itself, you will need the following components:
- A USB power supply with no less than 700mA. If you want to power additional hardware through USB, you should plan at least 1 amp.
- An SD(HC) card with at least 2GB capacity; however, 4GB would be better. Depending on what you intend to do, that still might not be enough. Because the system is also housed on the SD card, it is advisable to choose a card with a high read and write speed.
- For wireless access, a WLAN adapter in the form of a USB stick would be practical. But in practice, a USB WLAN adapter is often a significant factor in power consumption. If you are considering using a USB adapter, be sure the driver is supported and choose a slim design that does not block the second USB port.
- In view of the low number of USB ports, a wireless keyboard and mouse would be a worthwhile investment that would also save unnecessary load on the limited resources of the USB power adapter.
In addition to these items, you will also need various cables, such as HDMI or Ethernet, depending on the planned use. As far as the HDMI cable is concerned, the shorter the better. You do have the option of increasing the output of the driver, but that also increases power usage. If you plan on listening to music or watching videos, you will also need headphones or speakers.
The third project (an embedded temperature controller) uses an expansion board that requires some additional hardware [6].
Getting Started
A Debian-based Linux distribution known as Raspbian is tailored for duty as an on-board operating system for Raspberry Pi. The Raspberry Pi foundation recommends the Raspbian "Wheezy" [7] release, which is used in this workshop.
Start by downloading the Raspbian "Wheezy" image file, which is a complete system image consisting of a 60MB boot partition and a root filesystem of around 2GB. Unpack the file and move it to an SD card with the following command:
$ sudo dd bs=1M if=2012-08-16-wheezy-raspbian.imgof=SD_card_device_filename
Now, plug the SD card, keyboard, mouse, and monitor into the Raspberry Pi system and boot by connecting the USB power supply. The configuration menu then appears, and if you are not using a standard English keyboard, it would be best first to change the settings under the menu items configure-keyboard and change_locale to the keyboard and language of your choice; otherwise, you will encounter problems as soon as the login is required. The default username is pi; the password is raspberry.
Other useful menu items include change_timezone, to set the correct time zone; ssh to enable safe access to the terminal via network; and expand_rootfs, to change the size of the root filesystem from 2GB to the actual size of the SD card. Finally, you should update the system in the typical Debian manner:
$ sudo apt-get update $ sudo apt-get upgrade
You can start the configuration tool anytime using sudo raspi-config
.
Project 1: Playing Video
Entering startx
will take you to the LXDE graphical desktop, which is optimized for lean systems. Playing an HD video is certainly the ultimate test for the hardware. The usual video players, however, are of no help because the GPU on the board is optimized for decoding audio and video data. Accordingly, you need a player that uses Broadcom's own program library (found under /opt/vc
). Currently, the only one that does that is the pre-installed command-line program omxplayer
[8].
If possible, simply mount the directory containing the files over your network. NFS offers faster access to your video collection, but SSHFS is less complicated. The appropriate packages are installed, as shown in Listing 1. You then start playback with the omxplayer
command.
Listing 1
Setting Up a Video Player
$ sudo apt-get sshfs $ sudo adduser pi fuse $ mkdir myVideos $ sshfs username@host_name:/directory_name myVideos
After a short hiccup in picture and sound, the software played the test HD video in 720p format with a 5.1 Dolby Digital audio track – of course, mixed down to two channels – without any jerkiness. And that's all as far as the spartan Omxplayer is concerned. The program does demonstrate impressive capabilities for decoding audio and video, but nothing more. There are also two more drawbacks: The video library mentioned above is not open source software, and you must purchase licenses for the MPEG-2 and VC-1 formats.
Energy use, on the other hand, is surprisingly low: The average load while rendering the HD video was only 3.8 watts, despite the demanding task of transmitting via the network. The programs Omxplayer, SSH, and SSHFS create the biggest load for the CPU and memory, whereas the player claims the larger share for itself. However, if you want to play HD video with 1080i or 1080p, it is worth connecting the network drive via NFS.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.