Qwiic SHIM for Raspberry Pi Hookup Guide

Pages
Contributors: El Duderino, Ell C
Favorited Favorite 4

Introduction

The SparkFun Qwiic SHIM for Raspberry Pi is a small, easily removable breakout to add a Qwiic connector to your Raspberry Pi. The SHIM (short for Shove Hardware in the Middle) design allows you to plug directly to the Pi's I2C bus with no soldering required and the thin PCB design allows for it to be sandwiched on your Pi GPIO with other HATS. The Qwiic SHIM works great when you do not need the full capabilities of the Qwiic pHAT for Raspberry Pi or if you want to add a Qwiic connector to your Pi but do not have room for yet another HAT.

SparkFun Qwiic SHIM for Raspberry Pi

SparkFun Qwiic SHIM for Raspberry Pi

DEV-15794
$1.50
14

Required Materials

To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.

Single Board Computer

You will need Raspberry Pi with 2x20 male headers installed.

Raspberry Pi 4 Model B (4 GB)

Raspberry Pi 4 Model B (4 GB)

DEV-15447
$55.00
21
Raspberry Pi 4 Model B (2 GB)

Raspberry Pi 4 Model B (2 GB)

DEV-15446
$45.00
4
Raspberry Pi 3 B+

Raspberry Pi 3 B+

DEV-14643
$35.00
40

A Pi Zero W will also work but you will need to make sure to solder some male headers to it.

Raspberry Pi GPIO Male Header - 2x20

Raspberry Pi GPIO Male Header - 2x20

PRT-14275
$1.05
Raspberry Pi Zero W

Raspberry Pi Zero W

DEV-14277
$15.00
48

Or you could connect it to any single board computer (like the NVIDIA Jetson Nano) that utilizes the 40-pin Raspberry Pi GPIO header footprint.

NVIDIA Jetson Nano Developer Kit

DEV-15297
13 Retired
Google Coral Development Board

Google Coral Development Board

DEV-15318
2 Retired

Qwiic Board

Now you probably wouldn't buy the Qwiic SHIM if you didn't have any Qwiic products to use with it, right? If you don't have any Qwiic products, the following might not be a bad place to start.

SparkFun Atmospheric Sensor Breakout - BME280 (Qwiic)

SparkFun Atmospheric Sensor Breakout - BME280 (Qwiic)

SEN-15440
$16.50
2
SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic)

SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic)

SEN-15177
$7.50
1
SparkFun Qwiic Keypad - 12 Button

SparkFun Qwiic Keypad - 12 Button

COM-15290
$11.50
11

SparkFun Micro OLED Breakout (Qwiic)

LCD-14532
7 Retired

Finally, you'll need our handy Qwiic cables to easily connect sensors to your Qwiic SHIM. Below are a few options.

Qwiic Cable - 100mm

Qwiic Cable - 100mm

PRT-14427
$1.50
Qwiic Cable - 50mm

Qwiic Cable - 50mm

PRT-14426
$0.95

Qwiic Cable - 200mm

PRT-14428
Retired

Qwiic Cable - 500mm

PRT-14429
1 Retired

Required Setup Tools

If you are using your Pi (or other single-board computer) as a desktop, these peripherals are required:

Suggested Reading

If you aren't familiar with the Qwiic system, we recommend reading here for an overview of everything Qwiic:

Qwiic Connect System
Qwiic Connect System

We would also recommend taking a look at the following tutorials if you aren't familiar with the content covered in them.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

Serial Terminal Basics

This tutorial will show you how to communicate with your serial devices using a variety of terminal emulator applications.

Raspberry Pi 3 Starter Kit Hookup Guide

Guide for getting going with the Raspberry Pi 3 Model B and Raspberry Pi 3 Model B+ starter kit.

Getting Started with the Raspberry Pi Zero Wireless

Learn how to setup, configure and use the smallest Raspberry Pi yet, the Raspberry Pi Zero - Wireless.

Hardware Overview

The Qwiic SHIM uses a unique friction-based connector that wedges itself onto the GPIO header for a secure, solderless connection. As you would expect, it has a single Qwiic connector that connects to your Pi's I2C bus (SDA, SCL, 5V and Ground). The SHIM also has a 3.3V regulator so it will work with all Qwiic devices.

Top view of the qwiic shim.
Top View Photo of Qwiic SHIM

Press Fit Header

The Press Fit Header on the Qwiic SHIM allows you to easily place the Qwiic SHIM on to your Pi (or other Single-Board Computer with the Pi GPIO) aligning the square pin on the Qwiic SHIM with Pin 1 of your GPIO. Pin one on the GPIO can be identified by the square pin or the beveled corner on the silkscreen. We will cover that in more detail in the Hardware Hookup section.

Press Fit Header highlighted.
Press Fit Header

Voltage Regulator

For you savvy readers out there, you may wonder why not just connect directly to the 3.3V rail on the Pi GPIO? A simple answer is the Pi's 5V rail is able to source more current than the 3.3V rail so the regulator allows you to connect more devices to the I2C bus without needing to worry about overtaxing your Pi.The on board AP2112K 3.3V regulator provides a clean 3.3V out for all attached Qwiic devices and can source up to 600mA@3.3V so you should have plenty of available current for your Qwiic project.

Voltage regulator is on the right side of the top of the board, between two capacitors

Voltage Regulator


Board Dimensions

Eagle File Photo with Dimensions.

Eagle File Photo with dimensions

Hardware Hookup

Getting started with the Qwiic SHIM is a snap (well, actually it's more like a push but you get the idea). Making sure to align the Qwiic SHIM's Pin 1 with Pin 1 on your Pi's GPIO header, press the Qwiic SHIM down onto the header. Pin 1 on both the Qwiic SHIM and the Pi GPIO will be marked with a square pin. There is also a beveled corner on the Pi GPIO header indicating Pin 1 from the top of your Pi. That's it! With the SHIM in place you can now attach all your Qwiic devices to your Pi with space to spare for other Pi HATs.

Old and New Pi Model Pinouts

GPIO Configuration for old and new model Raspberry Pi from the Raspberry Pi GPIO Tutorial.



With your Qwiic SHIM mounted on your Pi it should look like this:

Qwiic SHIM mounted on a Pi 4. Qwiic SHIM mounted on a Pi Zero W.
Qwiic SHIM mounted on a Pi 4. Qwiic SHIM mounted on a Pi Zero W.


With the Qwiic SHIM in place, you can now stack all the HATs you would like on top. With a HAT on top of the SHIM, the press fit header will make an even better connection and the thin PCB allows any HAT to still connect fully to the GPIO header.

The Qwiic SHIM on a Pi 4 with the SparkFun Pulsed Radar Breakout.

The Qwiic SHIM is seen here nicely wedged by the SparkFun Pulsed Radar Breakout

Shim Sandwiched between

And here you can see it shoved in the middle with the SparkFun Pi Servo HAT.

Getting an OS

We recommend checking out the Raspberry Pi 4 Hookup Guide to install the operating system to flash the image to your microSD card for detailed instructions.

Raspberry Pi 4 Kit Hookup Guide

March 14, 2020

Guide for hooking up your Raspberry Pi 4 Model B basic, desktop, or hardware starter kit together.

If you're starting from scratch with a blank microSD card, you'll want to install Raspbian. If you've already got a working Raspbian system, skip ahead to the next section. Be patient — each of these steps can take a while depending on the speed of your microSD card.

  1. Download an Image — Download your favorite Linux distribution. For beginners, we recommend getting NOOBS image.
  2. Flashing the Image — Follow the instructions from the Raspberry Pi 4 Kit Hookup Guide to flash your microSD card. You can also follow the official Raspberry Pi installation instructions.

Configuring the Pi

The peripherals are not turned on by default. For those using Qwiic-enabled devices, you will want to enable I2C port. There are two methods to adjust the settings. This is outlined in our Raspberry Pi I2C tutorial.

Raspberry Pi SPI and I2C Tutorial

October 29, 2015

Learn how to use serial I2C and SPI buses on your Raspberry Pi using the wiringPi I/O library for C/C++ and spidev/smbus for Python.

We've included the following instructions from the tutorial. To enable it, follow the steps below.

Raspberry Pi Configuration via Desktop GUI

You can use the Desktop GUI by heading to the Pi Start Menu > Preferences > Raspberry Pi Configuration.

Raspberry Pi Configuration via GUI

Click on image for a closer view.

A window will pop up with different tabs to adjust settings. What we are interested is the Interfaces tab. Click on the tab and select Enable for I2C. At this point, you can enable additional interfaces depending on your project needs. Click on the OK button to same.

Adjusting Interfaces via Interface Tab

Click on image for a closer view.

We recommend restarting your Pi to ensure that the changes to take effect. Click on the Pi Start Menu > Preferences > Shutdown. Since we just need to restart, click on the Restart button.

Shutdown Turn Off, Restart, Log Off

Click on images for a closer view.

raspi-config Tool via Terminal

Again, we can use raspi-config to enable it.

  1. Run sudo raspi-config.
  2. Use the down arrow to select 5 Interfacing Options
  3. Arrow down to P5 I2C.
  4. Select yes when it asks you to enable I2C
  5. Also select yes if it asks about automatically loading the kernel module.
  6. Use the right arrow to select the <Finish> button.
  7. Select yes when it asks to reboot.

Enabling I2C on the Raspberry Pi

Raspi-config for I2C

The system will reboot. When it comes back up, log in and enter the following command

language:bash
ls /dev/*i2c*

The Pi should respond with

language:bash
/dev/i2c-1

Which represents the user-mode I2C interface.

Scanning for I2C Devices

If you are using the Raspberry Pi to quickly connect to I2C devices, the best place to start would be to scan for an I2C device on the bus.

Utilities

There is a set of command-line utility programs that can help get an I2C interface working. You can get them with the apt package manager.

language:bash
sudo apt-get install -y i2c-tools

In particular, the i2cdetect program will probe all the addresses on a bus, and report whether any devices are present. Enter the following command in the command line. The -y flag will disable interactive mode so that you do not have to wait for confirmation. The 1 indicates that we are scanning for I2C devices on I2C bus 1 (e.g. i2c-1).

language:bash
i2cdetect -y 1

You will get an output from your Raspberry Pi similar to the output below.

language:bash
pi@raspberrypi:~/$ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

This map indicates that there is a peripheral at address 0x60. Your address may vary depending on what is connected to the I2C bus. For advanced users, you can try to read and write its registers using the i2cget, i2cset and i2cdump commands.

Qwiic Py Drivers

Now that you have I2C set up on your Pi, you can start programming your Qwiic devices on your Pi or if you'd like to start with some examples, we have a host of Python drivers for Qwiic breakouts available in the GitHub repository linked below. You can read more about Python for the SparkFun Qwiic system in this blog post.

Resources and Going Further

For more information, check out the resources below:

Now that you have your Qwiic SHIM ready to go, it's time to check out some of Qwiic enabled products.

SparkFun Artemis Development Kit with Camera

KIT-17071
1
SparkFun GPS-RTK Dead Reckoning Breakout  - ZED-F9R, SMA (Qwiic)

SparkFun GPS-RTK Dead Reckoning Breakout - ZED-F9R, SMA (Qwiic)

GPS-22660
$289.95
2
SparkFun Mini Human Presence and Motion Sensor - STHS34PF80 (Qwiic)

SparkFun Mini Human Presence and Motion Sensor - STHS34PF80 (Qwiic)

SEN-23253
$15.50
SparkFun Qwiic Directional Pad

SparkFun Qwiic Directional Pad

PRT-26851
$5.95

If you are unsure what Qwiic devices to start with, check out the Qwiic SHIM Kit Hookup Guide for Raspberry Pi with a 9DoF and SerLCD for more information.

Qwiic SHIM Kit for Raspberry Pi Hookup Guide

February 16, 2021

Get started with the Serial LCD with RGB backlight and 9DoF IMU (ICM-20948) via I2C using the Qwiic system and Python on a Raspberry Pi! Take sensor readings and display them in the serial terminal or SerLCD.

But I Already Have Sensors!

If you already have a handful of SparkFun sensors and parts? SparkFun has been putting our standard GND/VCC/SDA/SCL pinout on all our I2C boards for many years. This makes it possible to attach a Qwiic Adapter that will get your SparkFun I2C sensor or actuator onto the Qwiic system.

Here is the list of the boards that have the standard I2C pinout and will work with the Qwiic adapter board:

Check out this related tutorial:

Raspberry Pi SPI and I2C Tutorial

October 29, 2015

Learn how to use serial I2C and SPI buses on your Raspberry Pi using the wiringPi I/O library for C/C++ and spidev/smbus for Python.