Single-board computers

Single-Board Computers (SBCs) are complete computers built on a single circuit board. They include all the usual pieces of a functional computer—the Central Processing Unit (CPU), Random Access Memory (RAM), non-volatile storage, and input/output ports.

SBCs are capable of running full-featured operating systems. Linux is commonly used.

The Raspberry Pi Zero W, for example, is an SBC measuring just 2.6 by 1.2 inches. It has 512 MB of RAM built-in and uses a micro SD card for storage. Wi-Fi and Bluetooth connectivity is also included. The Raspberry Pi Zero W currently retails for about $10 (USD).

The following photo shows a Raspberry Pi Zero W:

Because SBCs run normal desktop operating systems, such as Linux, programming them is easy. In fact, all of the network programs we've developed throughout this book are applicable.

In addition to standard computer connectors for video, audio, and USB, SBCs usually have some General-Purpose Input/Output (GPIO) pins to work with. This gives them some basic microcontroller-like functionality. These GPIO pins are capable of reading a digital input signal and providing a digital output signal. On the Raspberry Pi, some pins are also able to provide Pulse Width Modulation (PWM) outputs, as well as various board-level serial protocols—Serial Peripheral Interface (SPI), Inter-Integrated Circuit (I2C), and Asynchronous Serial.

Although SBCs are very easy to get started with, they do have a few drawbacks. They are relatively expensive, they require a lot of power, and their use of general-purpose operating systems isn't always ideal for embedded systems. Microcontrollers, by comparison, are much cheaper and optimized to handle real-time performance constraints.