Qwiic pHAT for Raspberry Pi Hookup Guide Datasheet

”H a7 9%3023" spalkfim SE” ’ $3.9 "qwiic quf 03*
Qwiic pHAT for Raspberry Pi Hookup Guide
Introduction
This Qwiic pHAT [v2.0 and v1.0] for Raspberry Pi is based on the Qwiic Hat. The board adds the quickest and
easiest way to utilize SparkFun's Qwiic ecosystem while still using that Raspberry Pi that you've come to know and
love. This Qwiic pHAT connects the I C bus (GND, 3.3V, SDA, and SCL) on your Raspberry Pi to an array of Qwiic
connectors. Since the Qwiic system allows for daisy chaining (as long as your devices are on different addresses),
you can stack as many sensors as you'd like to create a tower of sensing power!
2
SparkFun Qwiic pHAT V2.0 for Raspberry Pi
DEV-15945
SparkFun Qwiic pHAT for Raspberry Pi
DEV-15351
Product Showcase: SparkFun Qwiic pHAT V2.0 for RProduct Showcase: SparkFun Qwiic pHAT V2.0 for R
Product Showcase: SparkFun Qwiic pHAT for RaspbProduct Showcase: SparkFun Qwiic pHAT for Raspb
Click on the video's full screen button for a closer view.
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. For those that are using an enclosure with the
Raspberry Pi, you'll want to get two rows of 1x20 stackable headers in order to help extend the pins outside of the
enclosure.
A Pi Zero W will also work but you will need to make sure to solder some male headers to it.
Or you could stack it on any single board computer (like the NVIDIA Jetson Nano) that utilizes the 40-pin
Raspberry Pi header footprint.
Raspberry Pi 3 B+
DEV-14643
ESP32 Thing Stackable Header Set
PRT-14311
Raspberry Pi GPIO Male Header - 2x20
PRT-14275
Raspberry Pi Zero W
DEV-14277
Qwiic Board
Now you probably didn't buy the Qwiic pHAT 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.
Finally, you'll need our handy Qwiic cables to easily connect sensors to your Qwiic pHAT. Below are a few options.
NVIDIA Jetson Nano Developer Kit
DEV-15297
Google Coral Development Board
DEV-15318
SparkFun Environmental Combo Breakout -
CCS811/BME280 (Qwiic)
SEN-14348
SparkFun GPS Breakout - XA1110 (Qwiic)
GPS-14414
SparkFun Spectral Sensor Breakout - AS7262
Visible (Qwiic)
SEN-14347
SparkFun Qwiic Adapter
DEV-14495
/ 9" / F? @ qWIIc
Required Setup Tools
As a desktop, these devices are required:
USB Mouse
USB Keyboard
HDMI monitor/TV/adapted VGA
5V Power Supply
Suggested Reading
If you aren't familiar with the Qwiic system, we recommend reading here for an overview.
Qwiic Connect System
We would also recommend taking a look at the following tutorials if you aren't familiar with them.
Qwiic Cable - 100mm
PRT-14427
Qwiic Cable - 200mm
PRT-14428
Qwiic Cable - 50mm
PRT-14426
Qwiic Cable - 500mm
PRT-14429
m‘<—i( 0="" wi="" 132mm="" fl“="" 3="" gjjlggwmg="" i="" sparklluncm="" phat="" 5v="" 0="" *zqzni:="" plilul:="" o="" mfgrzflimfi="" o="" wsparkfun="" i="" 5v="" vowsn="" jn="" r”="" t="" .="" “qwificfip.="" a="" _="" .="">
Hardware Overview
There are two pHAT versions out in the wild! Overall, they function the same to Qwiic-ly connect your I C devices
to your single board computer. However, there are small differences between the two boards. Click on one of the
images below to explore the hardware for your respective Qwiic pHAT.
Qwiic pHAT v2.0 Qwiic pHAT v1.0
Qwiic pHAT v2.0
I C Pins
The Qwiic pHAT has 4x Qwiic connect ports, all on the same I C bus. There are two vertical Qwiic connectors
located at the center and two horizontal connectors on the right side.
5V Power
If you need to power a device with 5V, we have broken out the Raspberry Pi's 5V and GND pins on the side with a
screw terminal. Depending on your project, you can also solder to the PTH pads.
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.
2
2
2
General Purpose Button
Included on the board is a general purpose button connected to GPIO17. You can use the button however you
would like but we found it useful to shutdown or reboot a Raspberry Pi with a Python script.
Jumpers
There are built-in pull-up resistors on board. If necessary, you can cut the traces to disable depending on the
number of boards connected to the I C bus.
Board Dimensions
The board is about 65.00mm x 30.50mm. There are six mounting holes on the board. Two pairs of mounting holes
were optimized to easily mount Qwiic devices that have the standard 1.0"x1.0" sized board.
Qwiic pHAT v1.0
I C Pins
2
2
jE‘133833888833 g ii'sparkgun cm pHat O 0 mu 1‘ J L44 my #1:. sparkgunL-‘m ;‘ pHat “ ‘
The Qwiic pHAT has 4x Qwiic connect ports, all on the same I C bus. A 3.3V regulator is included to regulate
voltage down for any Qwiic boards connected.
Jumpers
There are built-in pull-up resistors on board. If necessary, you can cut the traces to disable depending on the
number of boards connected to the I C bus.
Board Dimensions
The board is about 65.00mm x 30.50mm. There are six mounting holes on the board.
Hardware Assembly
To get started with your Qwiic pHAT, simply plug it into the headers on the Raspberry Pi with the letters facing you.
We'll use the Qwiic pHAT v1.0 in the following images to connect a Qwiic device.
2
2
Once the pHAT is plugged in, you can start plugging in any Qwiic enabled sensors.
Note: The Qwiic pHat is also compatible with single board computers (like the NVIDIA Jetson Nano or the
Google Coral) that utilize the 40-pin Raspberry Pi header footprint. Below are images of v2.0 and v1.0
stacked on the different single board computers.
Standoffs and Mounting Holes
qwiic mm 7
Depending on your project, you can mount a qwiic enabled board on the mounting holes using standoffs. Below
are two images showing Qwiic devices mounted on each version of the Qwiic pHAT.
Qwiic Devices Mounted on v2.0 Qwiic Device Mounted on v1.0
Stackable Headers
When placing a Raspberry Pi and the pHat in an enclosure (like the Pi Tin), we noticed that the pHAT was not fully
inserted in Pi's header pins. You will need an additional pair of stackable headers for a secure connection
depending on your enclosure. Otherwise, the original Qwiic HAT would be better if you need to using the boards in
an enclosure.
I2C on Raspberry Pi
OS and Library Install
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 step 3.
1. Download the NOOBS image. As of this writing, it's at version 2.4.4.
2. Follow the official installation instructions.
3. Follow the Wiring Pi Instructions to get git, update and upgrade your Rasbpian packages, then install
WiringPi.
Be patient -- each of these steps takes a while.
Once you've got wiringPi installed, run the gpio commands shown below.
>gpio -v
>gpio readall
It should respond with some information about the wiringPi version and the Pi that its running on, then draw a table
illustrating the configuration for the pins in the 40-pin connector.
Configuration
Like the SPI peripheral, I2C is not turned on by default. 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. Select OK and then Finish
Once you return to terminal, enter this command:
>ls /dev/*i2c*
The Pi should respond with:
/dev/i2c-1
Which represents the user-mode I2C interface.
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.
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. Call i2cdetect -y 1 to probe the first I C bus, which is what the Qwiic pHAT is connected to.
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. We can read and write its registers using the
i2cget , i2cset and i2cdump commands.
Resources and Going Further
2
For more information, check out the resources below:
Qwiic pHAT V2.0
Schematic (PDF)
Eagle Files (ZIP)
Board Dimensions (PNG)
GitHub Repo
SFE Product Showcase
Qwiic pHAT V1.0
Schematic (PDF)
Eagle Files (ZIP)
Board Dimensions (PNG)
GitHub Repo
SFE Product Showcase
Now that you have your Qwiic pHAT ready to go, it's time to check out some of Qwiic enabled products.
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 I C boards for many years. This makes it possible to attach a Qwiic Adapter
that will get your SparkFun I C sensor or actuator onto the Qwiic system.
SparkFun RedBoard Edge
DEV-14525
SparkFun Micro OLED Breakout (Qwiic)
LCD-14532
SparkFun Triad Spectroscopy Sensor -
AS7265x (Qwiic)
SEN-15050
SparkFun GPS Breakout - Chip Antenna, SAM-
M8Q (Qwiic)
GPS-15210
2
2
Here is the list of the boards that have the standard I C pinout and will work with the Qwiic adapter board:
9DoF Stick IMU - LSM9DS1
9DoF IMU - MPU-9250
6DoF IMU - LSM303C
6DoF IMU - LSM6DS3
Triple Axis Accelerometer - LIS3DH
Triple Axis Magnetometer - MAG3110
Triple Axis Magnetometer - MLX90393
Compass Module - HMC6343
Atmospheric Sensor - BME280
Barometric Pressure Sensor - MS5803-14BA
Barometric Pressure Sensor - T5403
Humidity and Temperature Sensor - Si7021
Digital Temperature Sensor - TMP102
Particle Sensor - MAX30105
Air Quality Sensor - CCS811
ToF Range Finder - VL6180
Haptic Motor Driver - DRV2605L
Micro OLED Display
RGB and Gesture Sensor - APDS-9960
RGB Light Sensor - ISL29125
LED Driver - LP55231
DAC Breakout - MCP4725
16 Output I/O Expander - SX1509
Battery Babysitter - BQ24075
Looking for inspiration? Check out this related tutorials to use I C devices on a Raspberry Pi:
2
2
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.
Qwiic Kit for Raspberry Pi Hookup Guide
JULY 4, 2019
Get started with the CCS811, BME280, VCNL4040, and microOLED via I2C
using the Qwiic system and Python on a Raspberry Pi! Take sensor readings
from the enviroment and display them on the microOLED, serial terminal, or the
cloud with Cayenne!