This is the chapter web page to support the content in Chapter 9 of the book: Exploring Raspberry Pi – Interfacing to the Real World with Embedded Linux. The summary introduction to the chapter is as follows:

This chapter describes how the input/output interface capabilities of the Raspberry Pi (RPi) can be enhanced and extended using low-cost modules, integrated circuits (ICs), and USB devices. The RPi is a competent interfacing and physical computing device, but analog interfacing functionality is absent, and other input/output capabilities may need to be expanded for your applications. This chapter begins by describing how you can utilize the RPi’s buses to add analog-to-digital and digital-to-analog conversion capabilities to the RPi. The chapter then describes how you can expand the number of available pulse-width modulation (PWM) outputs and general-purpose inputs/outputs (GPIOs) on the RPi. The chapter finishes with a discussion on the use of USB-to-TTL devices, which can be used to expand the number of available serial UART devices. This chapter also provides you with further experience of interfacing to SPI and I2C bus devices.

After completing this chapter, you should hopefully be able to do the following:

  • Extend the input/output capability of the RPi to include analog inputs by using SPI ADCs.
  • Interface simple resistance-based sensors, where a voltage/current is required for sensor excitation.
  • Extend the input/output capability of the RPi to include analog outputs using both I2C and SPI DACs.
  • Expand the number of PWMs available on the RPi using a low-cost SPI module.
  • Increase the number of available GPIOs on the RPi using both I2C and SPI GPIO expanders, and utilize the interrupt functionality that is available on such devices.
  • Increase the number of available serial UART devices on the RPi using low-cost USB-to-TTL devices.

Digital Media Resources

Below are some high-resolution images of the circuits described in the book. They are reproduced in colour and can be printed at high resolution to facilitate you in building the circuits.

The SPI ADC Configuration



The PWM driver

Adding GPIOs to the RPi


None for the moment