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 I2C DAC
The SPI DAC
The PWM driver
Adding GPIOs to the RPi
None for the moment
The book is great. I have the BBB book and you did it again. I do have a question about ps2pdf. It’s referred to on page 371 in the grey box. ps2pdf does not seem to be on my R pi 3. I tried looking for instructions to down load to the PI with no luck. Any suggestions.
Thanks Andrew! I don’t remember having to install it on the earlier RPi image but you have to do it now. The ps2pdf tool comes bundled with GhostScript. You can install it using:
It’s about 50MB in total. Hope that helps, Derek.
The book is great. But we expecting new edition with Python programming.