Build an Automated Vehicle Locator

Several things inspired Electrical and Computer Engineering Professor Chris Coulston and his team at Penn State Erie, The Behrend College, to create an online vehicle-tracking system. Mainly, the team wanted to increase ridership on a shuttle bus the local transit authority provided to serve the expanding campus. Not enough students were “on board,” in part because it was difficult to know when the bus would be arriving at each stop.

So Coulston’s team created a system in which a mobile GPS tracker on the bus communicates its location over a radio link to a base station. Students, professors, or anyone else carrying a smartphone can call up the bus tracker web page, find out the bus’ current location, and receive reliable estimates of the bus’ arrival time at each of its stops. Coulston, computer engineering student Daniel Hankewycz, and computer science student Austin Kelleher wrote an article about the system, which appears in our June issue.

Circuit Cellar recently asked Coulston if the system, implemented in the fall 2013 semester, had accomplished its goals and might be expanded.

“The bus tracker team is tracking usage of the web site using Google Analytics,” Coulston said. “The data reveals that we get on average 100 hits a day during cold weather and fewer on warmer days. Ridership has increased during this past year, helping assure the long-term presence of the shuttle on our campus.”

“Over winter break, shuttle service was increased to a distant location on campus,” he added. “In order to better track the location of the shuttle, a second base station was added. The additional base station required a significant rework of the software architecture. The result is that the software is more modular and can accept an arbitrary number of base stations. There are no plans at present to add a second bus—a good thing, because this change would require another significant rework of the software architecture.”

Initially, Coulston looked to other real-time vehicle trackers for inspiration: “There are a variety of live bus trackers that motivated my early ideas, including the University of Utah’s Live Tracker  and the Chicago Transit Authority’s CTA Bus Tracker. Given our single bus route on campus, I was motivated to keep the interface simple and clean to minimize the amount of time needed to figure out where the bus is and how long it’s going to take to get to my stop.”

The system, as it was originally implemented in August 2013, is fully described in the June issue, now available for single-issue purchase or membership download. The following article excerpt provides a broad overview and a description of the team’s hardware choices.

THE BIG PICTURE
Figure 1 shows the bus tracker’s hardware, which consists of three components: the user’s smartphone, the base station placed at a fixed location on campus, and the mobile tracker that rides around on the bus.

The bus tracking system includes a Digi International XTend radio, a Microchip Technology PIC18F26K22 microcontroller, and a Raspberry Pi single-board computer.

Figure 1: The bus tracking system includes a Digi International XTend radio, a Microchip Technology PIC18F26K22 microcontroller, and a Raspberry Pi single-board computer.

Early on, we decided against a cellular-based solution (think cell phone) as the mobile tracker. While this concept would have benefited from wide-ranging cellular coverage, it would have incurred monthly cellar network access fees. Figure 1 shows the final concept, which utilizes a 900-MHz radio link between the mobile tracker and the base station.

Figure 2 shows the software architecture running on the hardware from Figure 1. When the user’s smartphone loads the bus tracker webpage, the JavaScript on the page instructs the user’s web browser to use the Google Maps JavaScript API to load the campus map. The smartphone also makes an XMLHttpRequests request for a file on the server (stamp.txt) containing the bus’ current location and breadcrumb index.

Figure 2: The bus tracker’s software architecture includes a GPS, the mobile tracker, a smartphone, and the base station.

Figure 2: The bus tracker’s software architecture includes a GPS, the mobile tracker, a smartphone, and the base station.

This information along with data about the bus stops is used to position the bus icon on the map, determine the bus’ next stop, and predict the bus’ arrival time at each of the seven bus stops. The bus’ location contained in stamp.txt is generated by a GPS receiver (EM-408) in the form of an NMEA string. This string is sent to a microcontroller and then parsed. When the microcontroller receives a request for the bus’ location, it formats a message and sends it over the 900-MHz radio link. The base station compares the bus position against a canonical tour of campus (breadcrumb) and writes the best match to stamp.txt.

Early in the project development, we decided to collect the bus’ position and heading information at 2-s intervals during the bus’ campus tour. This collection of strings is called “breadcrumbs” because, like the breadcrumbs dropped by Hansel and Gretel in the eponymously named story, we hope they will help us find our way around campus. Figure 3 shows a set of breadcrumbs (b1 through b10), which were collected as the bus traveled out and back along the same road.

Figure 3: Breadcrumbs (b1 through b10) containing the bus’ position and orientation information were taken every 2 s during a test-run campus tour.

Figure 3: Breadcrumbs (b1 through b10) containing the bus’ position and orientation information were taken every 2 s during a test-run campus tour.

The decision to collect breadcrumbs proved fortuitous as they serve an important role in each of the three hardware components shown in Figure 1.

MOBILE TRACKER
The bus houses the mobile tracker (see Photo 1). Figure 4 shows the schematic, which is deceptively simple. What you see is the third iteration of the mobile tracker hardware.

Figure 4: The mobile tracker includes a Microchip Technology PIC18F26K22 microcontroller, a Micrel MIC5205 regulator, a Digi International XTend RF module, and a Texas Instruments TXS0102 bidirectional translator

Figure 4: The mobile tracker includes a Microchip Technology PIC18F26K22 microcontroller, a Micrel MIC5205 regulator, a Digi International XTend RF module, and a Texas Instruments TXS0102 bidirectional translator

An important starting point in the design was how to step down the bus’ 12-V supply to the 5-V required by our circuit. In terms of hardware, the best decision we made was to abandon the idea of trying to integrate a 12-to-5-V converter onto the mobile tracker PCB. Instead we purchased a $40 CUI VYB15W-T DC-DC converter and fed the mobile tracker 5-V inputs…

We used Micrel’s MIC5205 regulator to step down the 5 V for the 3.3-V GPS receiver, which easily supplied its peak 80 mA. Since we ran a Digi International XTend radio at 5 V for the best range, we ended up with mixed voltage signals. We used a Texas Instruments TXS0102 bidirectional voltage-level translator, which handles voltage-interfacing duties between the 5-V radio and the 3.3-V microcontroller.

The mobile tracker unit

Photo 1: The mobile tracker unit

We selected Microchip Technology’s PIC18F26K22 because it has two hardware serial ports, enabling it to simultaneously communicate with the GPS module and the radio modem when the bus is traveling around campus. We placed two switches in front of the serial ports. One switch toggles between the GPS module and the Microchip Technology PICkit 3 programming pins, which are necessary to program the microcontroller. The second switch toggles between the radio and a header connected to a PC serial port (via a Future Technology Devices FT232 USB-to-serial bridge). This is useful when debugging at your desk. An RGB LED in a compact PLCC4 package provides state information about the mobile tracker.

The XTend RF modules are the big brothers to Digi International’s popular XBee series. These radios come with an impressive 1 W of transmitting power over a 900-MHz frequency, enabling ranges up to a mile in our heavily wooded campus environment. The radios use a standard serial interface requiring three connections: TX, RX, and ground. They are simple to set up. You just drop them into the Command mode, set the module’s source and destination addresses, store this configuration in flash memory, and exit. You never have to deal with them again. Any character sent to the radio appears on the destination modem’s RX line.

The GPS receiver utilizes the CSR SiRFstarIII chipset, which is configured to output a recommended minimum specific (RMC) string every 2 s…

The mobile tracker’s firmware listens for commands over the serial port and generates appropriate replies. Commands are issued by the developer or by the base station…

Burning breadcrumbs into the mobile tracker’s flash memory proved to be a good design decision. With this capability, the mobile tracker can generate a simulated tour of campus while sitting on the lab bench.

BASE STATION
The base station consists of an XTend RF module connected to a Raspberry Pi’s serial port (see Photo 2). The software running on the Raspberry Pi does everything from running an Nginx open-source web server to making requests for data from the mobile tracker.

From Figure 1, the only additional hardware associated with the base station is the 900-MHz XTend radio connected to the Raspberry Pi over a dedicated serial port on pins 8 (TX) and 10 (RX) of the Raspberry Pi’s GPIO header.

The only code that runs on the base station is the Python program, which periodically queries the mobile tracker to get the bus’ position and heading. The program starts by configuring the serial port in the common 9600,8,N,1 mode. Next, the program is put into an infinite loop to query the mobile tracker’s position every 2 s.

Photo 2: The base station includes an interface board, a Raspberry Pi, and a radio modem.

Photo 2: The base station includes an interface board, a Raspberry Pi, and a radio modem.

Raspberry Pi-Based Network Monitoring Device

In 2012, Al Anderson, IT director at Salish Kootenai College in Pablo, MT, and his team wired the dorms and student housing units at the small tribal college with fiber and outdoor CAT 5 cable to provide reliable Internet service to students. “Our prior setup was wireless and did not provide very good service,” Anderson says.

The 25 housing units, each with a small unmanaged Ethernet switch, were daisy chained in several different paths. Anderson needed a way to monitor the links from the system’s Simple Network Management Protocol (SNMP) network monitoring software, Help/Systems’s InterMapper. He also wanted to ensure the switches installed inside the sun-exposed utility boxes wouldn’t get too hot.

The Raspberry Pi is a small SBC based on an ARM processor. Its many I/O ports make it very useful for embedded devices that need a little more power than the typical 8-bit microcontroller.

Photo 1: The Raspberry Pi is a small SBC based on an ARM processor. Its many I/O ports make it very useful for embedded devices that need a little more power than the typical 8-bit microcontroller.

His Raspberry Pi-based solution is the subject of an article appearing in Circuit Cellar’s April issue. “We chose the Raspberry Pi because it was less expensive, we had several on hand, and I wanted to see what I could do with it,” Anderson says (see Photo 1).

The article walks readers through each phase of the project:

“I installed a Debian Linux distro, added an I2C TMP102 temperature sensor from SparkFun Electronics, wrote a small Python program to get the temperature via I2C and convert it to Fahrenheit, installed an SNMP server on Linux, added a custom SNMP rule to display the temperature from the script, and finally wrote a custom SNMP MIB to access the temperature information as a string and integer.”

Setting up the SBC and Linux was simple, Anderson says. “The prototype Raspberry Pi has now been running since September 2012 without any problems,” he says in his article. “It has been interesting to see how the temperature fluctuates with the time of day and the level of network activity. As budget and time permit, we will be installing more of these onto our network.”

In the following excerpt, Anderson discusses the project’s design, implementation, and OS installation and configuration. For more details on a project inspired, in part, by the desire to see what a low-cost SBC can do, read Anderson’s full article in the April issue.

DESIGN AND IMPLEMENTATION
Figure 1 shows the overall system design. The TMP102 is connected to the Raspberry Pi via I2C. The Raspberry Pi is connected to the network via its Ethernet port. The monitoring system uses TCP/IP over the Ethernet network to query the Raspberry Pi via SNMP. The system is encased in a small acrylic Adafruit Industries case, which we used because it is inexpensive and easy to customize for the sensor.

The system is designed around the Raspberry Pi SBC. The Raspberry Pi uses the I2C protocol to query the Texas Instruments TMP102 temperature sensor. The Raspberry Pi is queried via SNMP.

Figure 1: The system is designed around the Raspberry Pi SBC. The Raspberry Pi uses the I2C protocol to query the Texas Instruments TMP102 temperature sensor. The Raspberry Pi is queried via SNMP.

Our first step was to set up the Raspberry Pi. We started by installing the OS and the various software packages needed. Next, we wrote the Python script that queries the I2C temperature sensor. Then we configured the SNMP daemon to run the Python script when it is queried. With all that in place, we then set up the SNMP monitoring software that is configured with a custom MIB and a timed query. Finally, we modified the Raspberry Pi case to expose the temperature sensor to the air and installed the device in its permanent location.

OS INSTALLATION AND CONFIGURATION
The Raspberry Pi requires a Linux OS compiled to run on an ARM processor, which is the brain of the device, to be installed on an SD card. It does not have a hard drive. Setting up the SD card is straightforward, but you cannot simply copy the files onto the card. The OS has to be copied in such a way that the SD card has a boot sector and the Linux partitioning and file structure is properly maintained. Linux and Mac OS X users can use the dd command line utility to copy from the OS’s ISO image. Windows users can use a utility (e.g., Win32DiskImager) to accomplish the same thing. A couple of other utilities can be used to copy the OS onto the SD card, but I prefer using the command line.

A Debian-based distribution of Linux seems to be the most commonly used Linux distribution on the Raspberry Pi, with the Raspbian “wheezy” as the recommended distribution. However, for this project I chose Adafruit Learning Systems’s Occidentalis V0.2 Linux distribution because it had several hardware-hacker features rolled into the distribution, including the kernel modules for the temperature sensor. This saved me some work getting those installed and debugged.

Before you can copy the OS to the SD card, you need to download the ISO image. The Resources section of this article lists several sources including a link to the Adafruit Linux distribution. Once you have an ISO image downloaded, you can copy it to the SD card. The Resources section also includes a link to an Embedded Linux Wiki webpage, “RPi Easy SD Card Setup,” which details this copying process for several OSes.

The quick and dirty instructions are to somehow get the SD card hooked up to your computer, either using a built-in SD reader or a peripheral card reader. I used a USB attached reader. Then you need to format the card. The best format is FAT32, since it will get reformatted by the copy command anyway. Next, use your chosen method to copy the OS onto the card. On Linux or Mac OS X, the command:

dd bs=4M if=~/linux_distro.img of=/dev/sdd

will properly copy the OS onto the SD card.

You will need to change two important things in this command for your system. First, the
if parameter, which is the name the in file (i.e., your ISO image) needs to match the file you downloaded. Second, the of device (i.e., the out file or our SD drive in this case) needs to match the SD card. Everything, including devices, is a file in Linux, in case you are wondering why your SD drive is considered a file. We will see this again in a bit with the I2C device. You can toast your hard drive if you put the wrong device path in here. If you are unsure about this, you may want to use a GUI utility so you don’t overwrite your hard drive.

Once the OS is copied onto the SD card, it is time to boot up the Raspberry Pi. A default username and password are available from wherever you download the OS. With our OS, the defaults are “pi” and “raspberry.” Make it your first mission to change that password and maybe even add a new account if your project is going to be in production.

Another thing you may have to change is the IP address configuration on the Ethernet interface. By default, these distributions use DHCP to obtain an address. Unless you have a need otherwise, it is best to leave that be. If you need to use a static IP address, I have included a link in the Resources section with instructions on how to do this in Linux.

To access your Raspberry Pi, hook up a local keyboard and monitor to get to a command line. Once you have the network running and you know the IP address, you can use the SSH utility to gain access via the network.

To get SNMP working on the Raspberry Pi, you need to install two Debian packages: snmpd and snmp. The snmpd package is the actual SNMP server software that will enable other devices to query for SNMP on this device. The second package, snmp, is the client. It is nice to have this installed for local troubleshooting.

We used the Debian package manager, apt-get, to install these packages. The commands also must be run as the root or superuser.

The sudo apt-get install snmpd command installs the snmpd software. The sudo part runs the apt-get command as the superuser. The install and snmpd parts of the command are the arguments for the apt-get command.

Next we issued the
sudo apt-get install snmp command, which installed the SNMP client. Issue the ps -ax | grep snmpd command to see if the snmpd daemon is running after the install. You should see something like this:

1444 ? S 14:22 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid

If you do not see a line similar to this, you can issue the sudo /etc/init.d/snmpd command start to start the service. Once it is running, it is time to turn your attention to the Python script that reads the temperature sensor. Configure the SNMP daemon after you get the Python script running.

The Raspberry Pi’s final installation is shown. The clear acrylic case can be seen along with the Texas Instruments TMP102 temperature sensor, which is glued below the air hole drilled into the case. We used a modified ribbon cable to connect the various TMP102 pins to the Raspberry Pi.

The Raspberry Pi’s final installation is shown. The clear acrylic case can be seen along with the Texas Instruments TMP102 temperature sensor, which is glued below the air hole drilled into the case. We used a modified ribbon cable to connect the various TMP102 pins to the Raspberry Pi.

Low-Cost SBCs Could Revolutionize Robotics Education

For my entire life, my mother has been a technology trainer for various educational institutions, so it’s probably no surprise that I ended up as an engineer with a passion for STEM education. When I heard about the Raspberry Pi, a diminutive $25 computer, my thoughts immediately turned to creating low-cost mobile computing labs. These labs could be easily and quickly loaded with a variety of programming environments, walking students through a step-by-step curriculum to teach them about computer hardware and software.

However, my time in the robotics field has made me realize that this endeavor could be so much more than a traditional computer lab. By adding actuators and sensors, these low-cost SBCs could become fully fledged robotic platforms. Leveraging the common I2C protocol, adding chains of these sensors would be incredibly easy. The SBCs could even be paired with microcontrollers to add more functionality and introduce students to embedded design.

rover_webThere are many ways to introduce students to programming robot-computers, but I believe that a web-based interface is ideal. By setting up each computer as a web server, students can easily access the interface for their robot directly though the computer itself, or remotely from any web-enabled device (e.g., a smartphone or tablet). Through a web browser, these devices provide a uniform interface for remote control and even programming robotic platforms.

A server-side language (e.g., Python or PHP) can handle direct serial/I2C communications with actuators and sensors. It can also wrap more complicated robotic concepts into easily accessible functions. For example, the server-side language could handle PID and odometry control for a small rover, then provide the user functions such as “right, “left,“ and “forward“ to move the robot. These functions could be accessed through an AJAX interface directly controlled through a web browser, enabling the robot to perform simple tasks.

This web-based approach is great for an educational environment, as students can systematically pull back programming layers to learn more. Beginning students would be able to string preprogrammed movements together to make the robot perform simple tasks. Each movement could then be dissected into more basic commands, teaching students how to make their own movements by combining, rearranging, and altering these commands.

By adding more complex commands, students can even introduce autonomous behaviors into their robotic platforms. Eventually, students can be given access to the HTML user interfaces and begin to alter and customize the user interface. This small superficial step can give students insight into what they can do, spurring them ahead into the next phase.
Students can start as end users of this robotic framework, but can eventually graduate to become its developers. By mapping different commands to different functions in the server side code, students can begin to understand the links between the web interface and the code that runs it.

Kyle Granat

Kyle Granat, who wrote this essay for Circuit Cellar,  is a hardware engineer at Trossen Robotics, headquarted in Downers Grove, IL. Kyle graduated from Purdue University with a degree in Computer Engineering. Kyle, who lives in Valparaiso, IN, specializes in embedded system design and is dedicated to STEM education.

Students will delve deeper into the server-side code, eventually directly controlling actuators and sensors. Once students begin to understand the electronics at a much more basic level, they will be able to improve this robotic infrastructure by adding more features and languages. While the Raspberry Pi is one of today’s more popular SBCs, a variety of SBCs (e.g., the BeagleBone and the pcDuino) lend themselves nicely to building educational robotic platforms. As the cost of these platforms decreases, it becomes even more feasible for advanced students to recreate the experience on many platforms.

We’re already seeing web-based interfaces (e.g., ArduinoPi and WebIOPi) lay down the beginnings of a web-based framework to interact with hardware on SBCs. As these frameworks evolve, and as the costs of hardware drops even further, I’m confident we’ll see educational robotic platforms built by the open-source community.

Two Campuses, Two Problems, Two Solutions

In some ways, Salish Kootenai College (SKC)  based in Pablo, MT, and Penn State Erie, The Behrend College in Erie, PA, couldn’t be more different

SKC, whose main campus is on the Flathead Reservation, is open to all students but primarily serves Native Americans of the Bitterroot Salish, Kootenai, and Pend d’Orellies tribes. It has an enrollment of approximately 1,400. Penn State Erie has roughly 4,300.

But one thing the schools have in common is enterprising employees and students who recognized a problem on their campuses and came up with technical solutions. Al Anderson, IT director at the SKC, and Chris Coulston, head of the Computer Science and Software Engineering department at Penn State Erie, and his team have written articles about their “campus solutions” to be published in upcoming issues of Circuit Cellar.

In the summer of 2012, Anderson and the IT department he supervises direct-wired the SKC dorms and student housing units with fiber and outdoor CAT-5 cable to provide students better  Ethernet service.

The system is designed around the Raspberry Pi device. The Raspberry Pi queries the TMP102 temperature sensor. The Raspberry Pi is queried via the SNMP protocol.

The system is designed around the Raspberry Pi device. The Raspberry Pi queries the TMP102 temperature sensor. The Raspberry Pi is queried via the SNMP protocol.

“Prior to this, students accessed the Internet via a wireless network that provided very poor service.” Anderson says. “We wired 25 housing units, each with a small unmanaged Ethernet switch. These switches are daisy chained in several different paths back to a central switch.”

To maintain the best service, the IT department needed to monitor the system’s links from Intermapper, a simple network management protocol (SNMP) software. Also, the department had to monitor the temperature inside the utility boxes, because their exposure to the sun could cause the switches to get too hot.

This is the final installation of the Raspberry Pi. The clear acrylic case can be seen along with the TMP102 glued below the air hole drilled into the case. A ribbon cable was modified to connect the various pins of the TMP102 to the Raspberry Pi.

This is the final installation of the Raspberry Pi in the SKC system. The clear acrylic case can be seen along with the TMP102 glued below the air hole drilled into the case. A ribbon cable was modified to connect the various pins of the TMP102 to the Raspberry Pi.

“We decided to build our own monitoring system using a Raspberry Pi to gather temperature data and monitor the network,” Anderson says. “We installed a Debian Linux distro on the Raspberry Pi, added an I2C Texas Instruments TMP102 temperature sensor…, wrote a small Python program to get the temperature via I2C and convert it to Fahrenheit, installed SNMP server software on the Raspberry Pi, added a custom SNMP rule to display the temperature from the script, and finally wrote a custom SNMP MIB to access the temperature information as a string and integer.”

Anderson, 49, who has a BS in Computer Science, did all this even as he earned his MS in Computer Science, Networking, and Telecommunications through the Johns Hopkins University Engineering Professionals program.

Anderson’s article covers the SNMP server installation; I2C TMP102 temperature integration; Python temperature monitoring script; SNMP extension rule; and accessing the SNMP Extension via a custom MIB.

“It has worked flawlessly, and made it through the hot summer fine,” Anderson said recently. “We designed it with robustness in mind.”

Meanwhile, Chris Coulston, head of the Computer Science and Software Engineering department at Penn State Erie, and his team noticed that the shuttle bus

The mobile unit to be installed in the bus. bus

The mobile unit to be installed in the bus.

introduced as his school expanded had low ridership. Part of cause was the unpredictable timing of the bus, which has seven regular stops but also picks up students who flag it down.

“In order to address the issues of low ridership, a team of engineering students and faculty constructed an automated vehicle locator (AVL), an application to track the campus shuttle and to provide accurate estimates when the shuttle will arrive at each stop,” Coulston says.

The system’s three main hardware components are a user’s smartphone; a base station on campus; and a mobile tracker that stays on the traveling bus.

The base station consists of an XTend 900 MHz wireless modem connected to a Raspberry Pi, Coulston says. The Pi runs a web server to handle requests from the user’s smart phones. The mobile tracker consists of a GPS receiver, a Microchip Technology PIC 18F26K22 and an XTend 900 MHz wireless modem.

Coulston and his team completed a functional prototype by the time classes started in August. As a result, a student can call up a bus locater web page on his smartphone. The browser can load a map of the campus via the Google Maps JavaScript API, and JavaScript code overlays the bus and bus stops. You can see the bus locater page between 7:40 a.m. to 7 p.m. EST Monday through Friday.

“The system works remarkably well, providing reliable, accurate information about our campus bus,” Coulston says. “Best of all, it does this autonomously, with very little supervision on our part.  It has worked so well, we have received additional funding to add another base station to campus to cover an extended route coming next year.”

The base station for the mobile tracker is a sandwich of Raspberry Pi, interface board, and wireless modem.

The base station for the mobile tracker is a sandwich of Raspberry Pi, interface board, and wireless modem.

And while the system has helped Penn State Erie students make it to class on time, what does Coulston and his team’s article about it offer Circuit Cellar readers?

“This article should appeal to readers because it’s a web-enabled embedded application,” Coulston says. “We plan on providing users with enough information so that they can create their own embedded web applications.”

Look for the article in an upcoming issue. In the meantime, if you have a DIY wireless project you’d like to share with Circuit Cellar, please e-mail editor@circuitcellar.com.

 

 

 

 

Q&A: Peter Lomas – Raspberry Pi: One Year Later, 1 Million Sold

Peter Lomas

Clemens Valens, Editor-in-Chief of Elektor Online and head of Elektor Labs, caught up with Peter Lomas, hardware designer for the Raspberry Pi single-board computer, earlier this year at the Embedded World 2013 trade show in Nuremberg, Germany. This is a longer version of an interview with Lomas published in Elektor’s May 2013 issue. The Lomas interview provided a one-year update on the rapid growth of interest in the Raspberry Pi since Elektor’s April 2012 interview with Eben Upton, one of the founders and trustees of the Raspberry Pi Foundation. The UK-based charitable foundation developed the inexpensive, credit card-sized computer to encourage the study of basic computer science in schools. In early 2012, the Raspberry Pi’s first production batches were arriving. Since then, more than 1 million boards have been sold.

CLEMENS: Raspberry Pi, the phenomena. It is quite amazing what happened.

PETER: It is, and lots of people keep asking me, why has Raspberry Pi done what it has done, what makes it different? I think it’s something we’ve really been trying to grasp. The first thing that happened with Raspberry Pi, which I think is important, is that we had one of our very first prototypes on a UK blog for one of the BBC correspondents, Rory Cellan-Jones, and they made a little video, a YouTube video, and that got 600,000 hits. So I guess that if you look at it from one aspect, that created a viral marketing, a very viral marketing campaign for Raspberry Pi. The other I think, the name, Raspberry Pi was key. And the logo that Paul Beach did for us is absolutely key because it has become iconic.

CLEMENS: Yes, it’s very recognizable.

PETER: Very recognizable. If I show you that, you know exactly what it is, in the electronics circle. So I think the brand has been very important. But you know, we shouldn’t forget the amount of work that Liz Upton’s been doing with the blogs and on our website, keeping people informed about what we’re doing. Then, I think we’ve got the fact we are a charity… that we are focused on the education of computing and electronics and that’s our motive—not actually to make boards and to make money except to fund the foundation.

CLEMENS: I looked at the Raspberry Pi website, and it doesn’t look easy to me. You target education, children, and on the website it’s hard to find what Raspberry Pi exactly is. It’s not really explained. You have to know it. There are several distributions, so you have to know Linux and you have to program in Python.

PETER: Well, that’s true and, in a weird way, that’s part of its success, because you actually have to be active. In order to do something with Pi, you can’t just get it out of a shiny box, put it on the desk and press “on.” You have to do some mental work. You have to figure some things out. Now, I actually think that there’s a bit of a benefit there, because when it actually works, you have some achievement. You’ve done something. Not “we’ve done something.” You’ve done it personally, and there is a gratification from doing it.

CLEMENS: But it’s not the easiest platform.

PETER: No, but with our educational proposition, the whole object now is to package that up in easier-to-use bundles. We can make the SD card boot straight to Scratch (a website project and simple programming language developed at the Massachusetts Institute of Technology Media Lab), so Linux becomes temporarily invisible, and there’s a set of worksheets and instructions. But we’re never going to take away, hopefully, the fact that you have to put your wires in, and I do think that is part of the importance and the attraction of it.

CLEMENS: Because of all these layers of complexity and having to program it in English (Python is in English), for the non-English population it is yet another hurdle. That’s why Arduino was so successful; they made the programming really easy. They had cheap hardware but also a way to easily program it.

PETER: There’s no doubt Arduino is a brilliant product. You are right, it enables people to get to what I call “Hello World” very easily. But, in fact, on a Raspberry Pi, after you’ve made those connections and plugged the card in, you can get to an equivalent “Hello World.” But ours is the Scratch cat. Once you’ve moved the Scratch cat, you can go in a few different directions: you can move it some more, or you can use Scratch with an I/O interface to make an LED light up or you can press a button to make the Scratch cat move. There are endless directions you can go. I’ve found, and I think Eben has similarly experienced, that kids just get it. As long as you don’t make it too complicated, the kids just get it. It’s the adults who have more problems.

CLEMENS: I saw that there are at least three different distributions for the boards. So what are the differences between the three? Why isn’t there just one?

PETER: Well, they all offer subtly different features. The whole idea was to make Raspberry Pi as an undergraduate tool. You give it to Cambridge University, hopefully Manchester University, and undergraduates can view the science before they start it. They have the summer. They can work on it, come back, and say: “Look, I did this on this board.” That’s where it all started.

CLEMENS: OK. So, you were already on quite a high level.

PETER: Well we were on a high level, that’s true. We were on a high level, so Scratch wouldn’t have been on the agenda. It was really just Python—that’s actually where the Pi comes from.
What has really happened is that we’ve developed this community and this ecosystem around Pi. So we have to be able to support the, if you like, “different roots” of people wanting to use Pi. Now we’ve got the RISC OS that you can use. And people are even doing bare-metal programming. If we just gave one distribution, I guess we’re closing it up. I fully approve of having different distributions.

CLEMENS: From the website, it’s not clear to me what is different in these distributions. For the first one, it is written: “If you’re just starting out.”

PETER: I think maybe we do need to put some more material in there to explain to people the difference. I have to explain: I’m the hardware guy. I’m the guy who sat there connecting the tracks up, connecting the components up. My expertise with the operating systems, with the distributions that we have, is really limited to the graphical interface because that’s what I use day in, day out.

CLEMENS: Once you have chosen your distribution and you want to control an LED, you have to open a driver or something, I suppose?

PETER: Well, you’ve got the library; you just have to make a library call. Again, it’s not easy. You have to go and find the libraries and you have to download them. Which is where things such as the Pi-Face (add-on board) come in, because that comes with an interactive library that will go onto Scratch. And you’ve got the Gertboard (another extension board) and that comes with the libraries to drive it and some tutorial examples and then you can wind that back to just the bare metal interface on the GPIOs.

CLEMENS: So the simplicity is now coming from the add-on boards?

PETER: Some of the add-on boards can make it simpler, where they give you the switches and they give you the LEDs. You don’t need to do any wiring. My view is that I’m trying to make it like an onion: You can start with the surface and you can do something, and then you can peel away the layers. The more interested you get, the more layers you can peel away and the more different directions you can go (in what you do with it). You must have seen the diverse things that can be done.

CLEMENS: I’ve looked at some projects. I was surprised by the number of media centers. That’s how RS Components (which distributes the Raspberry Pi) is promoting the board. Aren’t you disappointed with that? It seems to be, for a lot of people, a cheap platform to do a Linux application on. They just want to have a media center.

PETER: I know exactly what you mean. And I suppose I should be disappointed that some people buy it, they make it into a media center, and that’s all it does. But I think if only 5% or 10% of those people who make it into a media center will think: “Well, that was easy, maybe I’ll get another and see if I can do something else with it,” then it’s a success.

CLEMENS: It would be an enabler.

PETER: Getting the technology in front of people is the first problem. Getting the “Hello World” so they’ve got a sense of achievement is the second problem. Then turning them over from doing that to “Okay, well what if I try and do this?”  then that’s  Nirvana. Certainly for the kids that’s crucial, because we’re changing them from doing what they’re told, to start doing things that they think they might be able to do—and trying it. That makes them into engineers.

CLEMENS: Let’s move on to the board’s hardware.

PETER: Sure.

CLEMENS: So, you chose a Broadcom processor. Because Eben worked at Broadcom?

PETER: He still works within Broadcom. It would be hard for me to argue that that wasn’t an influence on the decision, because Eben said: “Oh look, here’s the bright shiny chip. It can do all the things that we want, why wouldn’t we use it?” The decision we made is we nailed our credentials and our reputations to the website by saying it will cost $35—it will cost $25 for the basic one. And there was no way on Earth any of us were going to go back on that… We had a spreadsheet, the basic numbers looked plausible, we just had to do a lot of work to chop it down—to hone it, to get it tight so it would actually meet the prices. So, I think if we’d gone another way, like maybe with Samsung, that would have blown the budget.

CLEMENS: Did Broadcom help in any way to make this possible?

PETER: Every semiconductor manufacturer helped the project by making the chips available. Also, the price point of the chips is important. I think some of the people who helped us took an educated gamble and gave us good pricing from day one. Because the big problem you get with trying to bootstrap any project, is that if you don’t know what your volume is going to be. You have to be conservative.

So, initially, we priced for a thousand boards, but quickly we priced for 20,000 boards, but nowhere in our wildest dreams did we think we were going to get to a 200,000-board requirement on launch day and be so tantalizingly close to selling a million after our first year. So that’s helped in a lot of ways, because obviously it’s driven the price of all the components down. I’m not going to pretend it doesn’t please the vendors of the components that had faith in us from day one, because they’ve obviously made some money out of it.

We always had the rationale that we had to have a sustainable model where the foundation, our community that is buying the boards, and our suppliers were all making a living and could feed themselves. It would have been a total disaster if someone such as Broadcom had said: “Tell you what guys, let’s give you the processors. We’ll give you the first 20,000.” And so, we could have provided all sorts of extra bells and whistles to the design. Then, when we would have sold these 20,000 boards, we’re going to raise the price of everything by $12. That would’ve been the end of Raspberry Pi.

CLEMENS: If Eben and the others had not worked for Broadcom…

PETER: Would we have used a different chip? Well, I sort of speculated about this and I went around and had a look and, at the time for the price point, we couldn’t find anything that would’ve met our requirements as well as that chip. So I was comfortable that was the one that would allow us to get to where we wanted to be, and I think the big key crunch for that was the high-definition multimedia interface (HDMI). From a technical point of view, one of the challenges we had was getting the breakout under the BGA, because blind and buried vias on PCBs are very expensive.

CLEMENS: How many layers is the board?

PETER: Six, which is a pretty bog-standard layer count. The only little trick that we used was to put blind vias only on layers one and two—so we had an extra drilling stage—but only one bonding stage. So that added $0.02 onto the cost of the board. But, because the next layer down was a ground plane, it meant that a lot of the connections that come out of the Broadcom processor just go down one layer. And that meant that I could have space underneath to route other things and actually make it all happen.

CLEMENS: Don’t they have guidelines at Broadcom?

PETER: Oh, they do have guidelines! Use blind and buried vias or vias in pads. Our first prototype was all singing, all dancing, but it would have cost $100 to $110 to manufacture. So we got the machete out and started hacking down all the things that we didn’t need. So you’ve got all the functionality that you want. You can get the performance that you want, you can get the compliance, but it’s got nothing extra.

CLEMENS: Have you been thinking about the future of Raspberry Pi?

PETER: Well, yeah… In our industry, you know, Moore’s law guarantees that everything is old-hat in two years’ time. So we’re thinking about it, but that’s all we’re doing. We’re trying to improve our educational release. I mean, let’s face it, I’m not going to pretend that the Raspberry Pi is perfect. We only made one modification to the board from design to release. We’ve only made some minor modifications under the V2 release. Some of that is to fix some anomalies, some of that was also to help our new manufacturing partner, Sony (in Pencoed, Wales), take it. Their process needed some slight changes to the board to make it easier to manufacture.

CLEMENS: About the original idea of Raspberry Pi, the educational thing. I had a look at the forum and there are lots of forums about technical details, quite a lot of questions and topics about start-up problems. But the educational forum is pretty small.

PETER: You’re right. You’re absolutely right. A lot of that work has been going on slowly and carefully in the background. To be completely honest with you, we were caught on the hub with the interest with Raspberry Pi, and so I’ve certainly spent the last 12 months making sure that we can deliver the product to our community so that they can develop with it and perhaps talk a little bit about our educational goals. But we’re absolutely refocusing on that.

CLEMENS: First, get the hardware into people’s hands and then focus on the education.

PETER: Exactly. And of course, we’ve also released the first computers in schools as manual teaching tools. But also we’ve got Clive, who is a full-time employee helping with the educational deployment. And it’s great that we’ve had all this support (from Google Giving) to get 15,000 kits into schools. I won’t pretend we don’t have a lot of work to do but, I think of where we were a year ago, just still trying to launch.

CLEMENS: It all went really fast.

PETER: Oh yes, it’s gone like a rocket!

CLEMENS: Have you personally learned something valuable from it?

PETER: Well, I’ve learned lots of things. I think the most valuable, maybe not a lesson, but a reinforcement of something I already thought, is that education doesn’t just exist in the classroom. It exists all around us. The opportunity to learn and the opportunity to teach exists every day in almost every aspect in what we do. You know, there are people who spend their lives trying to keep every secret, keep everything to themselves. But there are also people who just give. And I’ve met so many people who are just givers. I suppose I’ve learned there is a whole new system of education that goes on outside of the standard curriculum that helps people do what they want to do.

Editor’s Note: Interview by Clemens Valens, Transcription by Joshua Walbey.

RESOURCES

  • Embedded Linux Wiki, “RPi Gertboard,” elinux.org/RPi_Gertboard
  • W. Hettinga, “What Are You Doing? The Raspberry Pi $25 Computer,” Elektor April 2012.
  • Massachusetts Institute of Technology Media Lab, “Scratch,” scratch.mit.edu
  • University of Manchester School of Computer Science, Projects Using Raspberry Pi, “Pi-Face Digital Interface,” http://pi.cs.man.ac.uk/interface.htm