Raspberry Pi SPI and I2C Tutorial
Resources and Going Further
For digging deeper into the concepts covered in this tutorial, please see the following:
- If you're really curious about the nitty-gritty internal details of I2C and SPI, you might want to read the source code of Wiring Pi, which you can clone from here.
- Additionally, you can learn about the Linux underpinnings of these interfaces documented at kernel.org. The SPI documentation seems to be more complete than its I2C sibling.
- If the example code here isn't working, you should check for updated versions on the 40-pin Pi Wedge GitHub Repository.
- The way that I2C and SPI devices are enabled in Raspbian has changed significantly in recent revisions. This forum post explains how to re-enable the interfaces if they disappeared in an upgrade.
- The HAT specifications and related information are hosted on GitHub. If you're designing a HAT, you'll want to start by reading the HAT Design Guide, and possibly perusing the B+ addons forum.
- Filezilla is a convenient FTP & SFTP client, which is useful for getting files to and from a Pi.
- PuTTY is a terminal program that has serial, telnet and SSH modes.
- The Pi gPIo tutorial explains how to use the digital I/O pins on your Pi.
- The Pi Wedge gives you a convenient way to access the SPI and I2C interfaces on your Pi.
For more information about the Raspberry Pi and the software described here, please visit their sites.
- The Raspberry Pi Foundation
- The Pi Foundation's B+ Addons forum.
- The Pi Foundation's GitHub repository for the Raspberry Pi B+ HATs.
- The eLinux.org Raspberry Pi peripherals guide
- RPi.GPIO module
- Some notes about increasing the available current from the B+ USB ports.
For more information on connecting hardware to the Raspberry Pi and inspiration for projects, check out the following guides:
Building Large LED Installations
Bark Back Interactive Pet Monitor
Raspberry Pi Zero Helmet Impact Force Monitor
Using Flask to Send Data to a Raspberry Pi
Python Programming Tutorial: Getting Started with the Raspberry Pi
Graph Sensor Data with Python and Matplotlib
Python GUI Guide: Introduction to Tkinter
If you have any problems or questions, our technical support department can help. Please don’t hesitate to contact us. We also love to hear about your projects!