# Raspberry Pi

## Summary


Raspberry Pi is a credit-card-sized single-board computer (SBC) designed in the UK. It was started with the idea of making computers affordable, accessible and fun to a new generation of programmers.  

Since its first release in 2012, many variant models of the Pi have been released, from $5 to $35. By 2018, more than 20 million units of the Pi were sold. 

Though it was conceived as an educational tool, Raspberry Pi has since been used for home automation, in industrial systems and even on the International Space Station. It's managed by the *Raspberry Pi Foundation*. The schematics are available but the board itself is not open hardware.

## Discussion

### What are some applications where Raspberry Pi is suitable?

It's ideal for beginners to learn about computers and programming. With Raspbian as the OS, Python and Scratch come by default. You can make music with Sonic Pi. Those interested in gaming, can play and even tweak Python-based games. You can setup a web server on the Pi. For scientific computing, start using Mathematica. The Pi can also handle streaming video, play audio/video or be used as a media centre. 

It's also a good platform to learn electronics, interface to sensors and build IoT projects. Many have used it for home automation projects. The small form factor and lower power requirements of Pi Zero enable battery-powered applications, possibly in remote areas. It can be used as an IoT gateway. With the increasing need for edge processing and analytics, the Pi has been used for such purposes. 

In general, while a microcontroller-based system (such as Arduino) is good at input/output, the Pi is more suitable for applications that require lot more data processing, involve media streaming, network with other devices, or manage multiple processes. 


### What interfaces does a Raspberry Pi expose?

While some models remove some of these interfaces, the following are present on Pi 3 Model B+: 4 x USB 2.0, Gigabit Ethernet, HDMI, analogue audio/video 3.5mm jack, Camera Serial Interface (CSI), Display Serial Interface (DSI) and a 40-pin GPIO header. CSI can connect to a camera. DSI can connect to a touchscreen display. For wireless networking, there's 802.11ac, Bluetooth 4.2 and BLE. 

GPIO header supports common digital interfaces: I2C, SPI and UART. There are 17 pins for GPIO. There's also an I2S interface for audio output. All GPIO run on 3.3V and can give maximum 20mA. Due to these interfaces, the Pi's being used for IoT and robotics applications. 

One interface that the Pi lacks is Analog-to-Digital Converter (ADC). An external ADC must therefore be used to interface to analogue sensors. The Pi can also be expanded with **HAT (Hardware Attached on Top)** expansion boards. 


### What hardware variants of the Raspberry Pi have been released to date?

There have been to date four generations of Raspberry Pi: 

    + Gen1: Model B, Model A, Model B+, Model A+, Compute Module 1
    + Gen2: Pi 2 Model B, Pi Zero
    + Gen3: Pi 3 Model B, Pi 3 Model B+, Pi 3 Model A+, Pi Zero W, Pi Zero WH, Compute Module 3, Compute Module 3 Lite, Compute Module 3+
    + Gen4: Pi 4 Model B (1/2/4GB)Compute Module is for industrial applications. 

Higher generation boards have faster CPU and more memory. In terms of form factor, cost and capability, in decreasing order are B, A and Zero models. The "plus" variants are better than the plain ones of that generation. Wireless connectivity was introduced for the first time in third generation models. Hence, both Pi Zero W and WH belong here. 

SocialCompare gives a feature comparison of most variants. RasPi.TV gives a nice picture of all the boards.


### How does one go about setting up a Raspberry Pi?

Raspberry Pi is just the processing module. It offers a number of interfaces to connect peripherals. HDMI can be used to connect to a display monitor or TV screen. For older displays, there's an analogue video interface. USB ports can be use to connect mouse and keyboard. 

Ethernet port is for a wired LAN connection. Otherwise, on-board Wi-Fi of Pi 3 models can be used to connect to a wireless LAN. With older models, a USB-based Wi-Fi dongle can be used instead. 

There's a micro USB to power up the Pi. However, Pi won't do anything without an operating system and software to run it. These should be loaded into an SD card. Online instructions can guide you to prepare the SD card.

To use the Pi from your desktop/laptop, read about headless mode and VNC.


### How is the software support for Raspberry Pi?

Raspberry Pi needs an operating system (OS). The official OS supported by the Foundation is **Raspbian**, which is based on Debian Linux distribution. Some Linux-based alternatives are Ubuntu MATE, Snappy Ubuntu Core and RaspBSD. There's also Windows 10 IoT Core, Android Things, PiNet, Weather Station and IchigoJam Pi.  

To use Pi as a media centre, we can use OpenELEC, LibreELEC or OSMC. RISC OS, developed in the 1980s for ARM processors, can be used. For those who prefer a command line interface, try Plan 9. To use Pi for gaming, try RetroPie, RecalBox, Lakka and PiPlay. 

Many of these can be installed using the **NOOBS** installer. You could also install them directly. 

Further software support depends on the OS used. For example, Raspbian comes pre-installed with Python, Scratch, Sonic Pi, Java, and more. Python libraries Rpi.GPIO and Wiring Pi are useful for IoT programming. 


### What resources can help a beginner learn Raspberry Pi?

The official website is a good place to start. The FAQ page will clarify many basic questions.

Get involved in the Pi community. Read the blog. Subscribe to the newsletter. *Raspberry Jams* are local meetups for sharing knowledge or collaborating on Pi projects. Use the Pi Forums to ask or give help. Get inspired by Pi projects that others have created.

Search online for tutorials, books, and projects posted on community websites. Programming the Raspberry Pi by Simon Monk is recommended for beginners. For inspiration, visit Instructables and Hackaday. 

On Pi Day 2018, one blogger shared 314 useful resources for Raspberry Pi enthusiasts.

## Milestones

1980

In the 1980s, BBC Micro in the UK and Commodore 64 in the US make computers accessible to home users. BASIC programming language could be used to program these computers. 

2006

Eben Upton at the University of Cambridge notices how fewer students are applying for computer science courses. He blames it on the lack of affordable computers for educational purpose. Children have access to only games consoles (and tablets and smartphones in later years). They have become consumers of content rather than programmers. Upton builds a computer using off-the-shelf parts and a soldering iron. It runs on an Atmel microcontroller. 

Oct  
2008

At a meeting involving Eben Upton (now an SoC architect at Broadcom), Alan Mycroft and Pete Lomas, the vision for Raspberry Pi takes shape. It's not about giving kids a black box. It should be a bare board that helps them know its components, tinker into open source code and learn how computers work. The second prototype is built using Broadcom components. The name **Raspberry Pi** is also coined, "Pi" because it boots into Python. A logo is selected later in 2011 via an open competition. 

May  
2009

To develop the Raspberry Pi and promote basic computer science in schools, **Raspberry Pi Foundation** is formed as a charity. Despite having the Foundation, the next two years would prove difficult for realizing the hardware at its desired price point of $35. 

May  
2011

A thumb-drive prototype of the Raspberry Pi is released in the UK. A YouTube video of the same picks up 600,000 views in just two days. This is made possible by a low-cost **ARM-based Broadcom SoC BCM2835** released in early 2011. The SoC was meant for applications such as electronic devices and digital signs, but now reimagined to power Raspberry Pi. 

Aug  
2011

The first 50 Raspberry Pi Alpha boards are released, built by Broadcom. The board has many features and interfaces that would become standard in later versions. However, it's $110 a piece plus slightly larger than the desired size of a credit card. Many design decisions are made to achieve the final $35 credit-card-sized Pi. The beta boards come out in December. 

Feb  
2012

The first Raspberry Pi **Model B** is released. Orders quickly reach 100,000. A simpler and cheaper variant of this called **Model A** is released in 2013. This has only 1 USB port and no Ethernet port. 

2014

Raspberry Pi **Model B+** and **Model A+** are released. GPIO header increases from 26 to 40 pins. The new boards also use less power. Upton later comments that Model B+ is the one they intended to make back in 2012. The success of earlier models and high volumes driving down costs (2.5 million by February 2014), have helped achieve Model B+ at a retail price of $35. 

Feb  
2015

**Raspberry Pi 2 Model B** is released. Compared to Model B+, it doubles the RAM size from 512MB to 1GB. Speed increases from 700MHz to 900MHz. There are four USB ports rather than two, thus removing the need to get a USB hub. The SoC is based on quad-core ARM Cortex-A7. 

Nov  
2015

For applications that require fewer interfaces, there's already Model A and Model A+. By removing the pinout header, removing more interfaces, and reducing HDMI and USB to smaller form factors, **Raspberry Pi Zero** is released. It retails at only $5. It draws less than 1 Watt of power. In 2017, **Zero W** includes wireless connectivity. In 2018, **Zero WH** includes the GPIO pinout header. 

Feb  
2016

**Raspberry Pi 3 Model B** is released. It uses a 64-bit SoC. This becomes the first model to add wireless connectivity: Wi-Fi 802.11n and Bluetooth 4.1. This can also boot from a USB. In 2018, variants **Pi 3 Model B+** and **Pi 3 Model A+** are introduced with 802.11ac and Bluetooth 4.2. 

2019

By end of February, 25 million units of Raspberry Pi are sold worldwide. In June, **Raspberry Pi 4 Model B** is released with support for 4K video.