{"id":12623,"date":"2025-04-28T09:08:07","date_gmt":"2025-04-28T13:08:07","guid":{"rendered":"https:\/\/itp.nyu.edu\/physcomp\/?page_id=12623"},"modified":"2025-05-03T10:29:03","modified_gmt":"2025-05-03T14:29:03","slug":"intro-to-sparkfun-qwiic-i2c-shield-for-arduino-nano","status":"publish","type":"page","link":"https:\/\/itp.nyu.edu\/physcomp\/lessons\/intro-to-sparkfun-qwiic-i2c-shield-for-arduino-nano\/","title":{"rendered":"Intro to SparkFun Qwiic I2C Shield for Arduino Nano"},"content":{"rendered":"\n<p>In this tutorial, you\u2019ll explore the capabilities of the <a href=\"https:\/\/learn.sparkfun.com\/tutorials\/sparkfun-qwiic-shield-for-arduino-nano-hookup-guide\/all\">SparkFun Qwiic Shield for Arduino Nano<\/a>\u2014a modular shield designed to extend the functionality of the Arduino Nano. This shield enables seamless communication between your microcontroller and various I2c-based peripherals like sensors and some displays. It&#8217;s a standard connector type that&#8217;s been informally adopted by a few other hardware module manufacturers as well.  We\u2019ll cover everything from physical setup and orientation to practical demos using sensors available in <a href=\"https:\/\/shop.itp.io\/\">the ITP shop<\/a>.<\/p>\n\n\n\n<p>It\u2019s also worth noting that SparkFun\u2019s Qwiic system is fully compatible with <a href=\"https:\/\/learn.adafruit.com\/introducing-adafruit-stemma-qt\/what-is-stemma\">Adafruit\u2019s STEMMA QT<\/a> ecosystem, which uses the same connector and wiring convention. Beyond SparkFun and Adafruit, other companies such as <a href=\"https:\/\/shop.pimoroni.com\/products\/breakout-garden-to-qwiic-adaptor?variant=39308382339155\">Pimoroni<\/a>, <a href=\"https:\/\/wiki.seeedstudio.com\/Grove-Qwiic-Hub\/\">Seeed Studio<\/a>, and <a href=\"https:\/\/www.pololu.com\/product\/5391\">Pololu<\/a> have begun integrating this connector into their I2C sensor and breakout boards as well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Youll_Need_to_Know\"><\/span>What You\u2019ll Need to Know<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before diving in, you should be comfortable with <a href=\"https:\/\/itp.nyu.edu\/physcomp\/labs\/labs-arduino-digital-and-analog\/digital-input-and-output-with-an-arduino\/\">basic Arduino programming<\/a> and understand the fundamentals of I2C communication. If you need a refresher, review the <a href=\"https:\/\/itp.nyu.edu\/physcomp\/i2c-communication-with-a-time-of-flight-distance-sensor\/#i2c-connections\">I2C Communication Labs<\/a> for in-depth details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Things_Youll_Need\"><\/span>Things You\u2019ll Need<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For this tutorial, gather the following components (see Figures 1\u20136 for reference images):<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-style-longdesc\"><img loading=\"lazy\" decoding=\"async\" width=\"2224\" height=\"1668\" data-id=\"5921\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/pcomp-kit-f2019-arduino-nano-33-iot.jpg\" alt=\"Photo of an Arduino Nano 33 IoT module. The USB connector is at the top of the image, and the physical pins are numbered in a U-shape from top left to bottom left, then from bottom right to top right.\" class=\"wp-image-5921\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/pcomp-kit-f2019-arduino-nano-33-iot.jpg 2224w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/pcomp-kit-f2019-arduino-nano-33-iot-768x576.jpg 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/pcomp-kit-f2019-arduino-nano-33-iot-1280x960.jpg 1280w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">Figure 1. Arduino Nano 33 IoT or other Arduino Nano Board<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"700\" data-id=\"12636\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SparkFun-Qwiic-Shield-for-Arduino-Nano.jpg\" alt=\"SparkFun Qwiic Shield for Arduino Nano\n\" class=\"wp-image-12636\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SparkFun-Qwiic-Shield-for-Arduino-Nano.jpg 700w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SparkFun-Qwiic-Shield-for-Arduino-Nano-150x150.jpg 150w\" sizes=\"(max-width: 700px) 85vw, 700px\" \/><figcaption class=\"wp-element-caption\">Figure 2. SparkFun Qwiic Shield for Arduino Nano<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-style-longdesc\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"640\" data-id=\"12637\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/PRT-14425.jpg\" alt=\"Photo of Qwiic Jumper Adapter Cable\" class=\"wp-image-12637\" title=\"\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/PRT-14425.jpg 640w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/PRT-14425-150x150.jpg 150w\" sizes=\"(max-width: 640px) 85vw, 640px\" \/><figcaption class=\"wp-element-caption\">Figure 3. Qwiic Jumper Adapter Cable<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"500\" data-id=\"12645\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SparkFun-Qwiic-Cable-Kit-Hook-Up-I2C-Qwiic-Development-Boards-in-no-ti.jpg\" alt=\"Photo of Qwiic Cable\" class=\"wp-image-12645\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SparkFun-Qwiic-Cable-Kit-Hook-Up-I2C-Qwiic-Development-Boards-in-no-ti.jpg 500w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SparkFun-Qwiic-Cable-Kit-Hook-Up-I2C-Qwiic-Development-Boards-in-no-ti-150x150.jpg 150w\" sizes=\"(max-width: 500px) 85vw, 500px\" \/><figcaption class=\"wp-element-caption\">Figure 4. Qwiic Cable<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"728\" data-id=\"12642\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SHTC3_Temperature__Humidity_Sensor.jpg\" alt=\"Photo of SHTC3 Temperature Humidity Sensor\" class=\"wp-image-12642\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SHTC3_Temperature__Humidity_Sensor.jpg 970w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/SHTC3_Temperature__Humidity_Sensor-768x576.jpg 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">Figure 5. SHTC3 Temperature Humidity Sensor<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"580\" height=\"580\" data-id=\"12638\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/ITPERCH-Equipment-I2C-OLED-Display-Module-0.96-inches.jpg\" alt=\"Photo of \nI2C OLED Display Module 0.96 inches\" class=\"wp-image-12638\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/ITPERCH-Equipment-I2C-OLED-Display-Module-0.96-inches.jpg 580w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/ITPERCH-Equipment-I2C-OLED-Display-Module-0.96-inches-150x150.jpg 150w\" sizes=\"(max-width: 580px) 85vw, 580px\" \/><figcaption class=\"wp-element-caption\">Figure 6. I2C OLED Display Module 0.96 inches<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Shield_Orientation_and_Setup\"><\/span>Shield Orientation and Setup<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Physical_Orientation\"><\/span><strong>Physical Orientation<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Although the SparkFun Qwiic Shield for Arduino Nano is pinned out exactly like a standard Arduino Nano, it\u2019s still important to verify that you have the correct orientation when mounting the shield. We often reference the 3.3V pin as a quick visual cue to ensure you align everything properly. The shield includes a configurable logic shifting circuit set by the IOREF jumper, which defaults to 3.3V (ideal for boards like the Arduino Nano 33 BLE). If you\u2019re using a 5V Nano variant (such as the Arduino Nano Every), you\u2019ll need to switch the jumper to 5V so that the logic levels match your board\u2019s operating voltage.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1440\" height=\"1080\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/Pin-alignment-guide-edited-1.png\" alt=\"Top-down view of two unconnected boards: an Arduino Nano 33 IoT on the left and a SparkFun Nano Qwiic Shield on the right. Black arrows label and point from specific pins on the Nano to the corresponding pins on the Qwiic Shield: 3.3V (top) and GND (bottom).\" class=\"wp-image-12945\" style=\"object-fit:cover\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/Pin-alignment-guide-edited-1.png 1440w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/Pin-alignment-guide-edited-1-768x576.png 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/Pin-alignment-guide-edited-1-1200x900.png 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 7.<\/em> Pin alignment guide for powering the SparkFun Qwiic Shield using the Arduino Nano 33 IoT. Ensure that the GND and 3.3V pins are correctly connected to provide stable power and enable Qwiic-based I2C communication.<\/figcaption><\/figure>\n\n\n\n<p><br>The Qwiic shield is designed to be mounted below the Nano with which it&#8217;s paired. To mount it below would require reversing the standard pin arrangement on the Nano (they are usually on the side of the board without components) and reversing the sockets on the shield. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1277\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08672.jpg\" alt=\"Side view of an Arduino Nano 33 IoT mounted on a SparkFun Qwiic Shield, which is inserted into a white solderless breadboard. A USB cable powers the setup. A Qwiic cable extends from the shield to a connected breakout sensor (likely an APDS-9960 or similar), which rests off the breadboard surface. The setup is placed on a light-colored tabletop, with the wiring clearly visible.\" class=\"wp-image-12742\" style=\"width:698px\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08672.jpg 1920w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08672-768x511.jpg 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08672-1536x1022.jpg 1536w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08672-1200x798.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 8.<\/em> Arduino on top of the Qwiic shield<\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Closer_Look_at_the_Adapter\"><\/span><strong>Closer Look at the Adapter<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The Qwiic adapter is populated with two&nbsp;<a href=\"https:\/\/www.sparkfun.com\/products\/14417\">4-pin 1mm JST connectors<\/a>. These connectors are polarized to prevent incorrect insertion, and the pin order follows the Qwiic standard: GND, 3.3V, SDA, and SCL. When mounting the adapter onto the Nano Qwiic Shield, ensure that the labeled side of the adapter aligns with the corresponding pins on the shield to maintain correct orientation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"416\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/QwiicPinoutGraphic.jpg\" alt=\"Illustration of a Qwiic connector pinout on a red breakout board. The black 4-pin JST connector is shown with corresponding labeled lines pointing to each pin: SCL (yellow wire), SDA (blue wire), 3.3V (red wire), and GND (black wire). The connector is part of a SparkFun Qwiic-enabled board, with the \u201cQWIIC\u201d logo visible below the connector.\" class=\"wp-image-12720\"\/><figcaption class=\"wp-element-caption\"><em>Figure 9.<\/em> Qwiic connector pinout diagram showing the standard I2C wire order: SCL, SDA, 3.3V, and GND. The polarized JST connector ensures correct orientation, enabling plug-and-play communication between Qwiic-compatible devices without soldering. <a href=\"https:\/\/news.sparkfun.com\/8292\">source<\/a><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1287\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08556-scaled.jpg\" alt=\"Close-up top-down view of a SparkFun Nano Qwiic Shield. The red breakout board has labeled black headers for inserting an Arduino Nano. A Qwiic cable is connected to the right-hand JST port, with four color-coded wires\u2014yellow (SCL), blue (SDA), red (3.3V), and black (GND)\u2014extending outward. The board is labeled with clear markings for power rails and I2C ports.\" class=\"wp-image-12721\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08556-scaled.jpg 2560w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08556-768x386.jpg 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08556-1536x772.jpg 1536w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08556-2048x1030.jpg 2048w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08556-1200x603.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 10.<\/em> A SparkFun Nano Qwiic Shield with a Qwiic cable connected, showing the standard I2C wire orientation.&nbsp;<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9580-1-edited-1-scaled.jpeg\" alt=\"Close-up view of a side-by-side comparison between a SparkFun Qwiic Shield\u2019s female JST connector (left) and a matching male 4-pin JST Qwiic cable connector (right), held in place by a metal alligator clip. The connectors are aligned to demonstrate the proper orientation for connection. Four color-coded wires (black, red, blue, and yellow) extend from the cable.\" class=\"wp-image-12943\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9580-1-edited-1-scaled.jpeg 2560w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9580-1-edited-1-768x576.jpeg 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9580-1-edited-1-1536x1152.jpeg 1536w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9580-1-edited-1-2048x1536.jpeg 2048w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9580-1-edited-1-1200x900.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 11.<\/em> Connector alignment for Qwiic interface: the 4-pin JST cable is shown in correct orientation for insertion into the Qwiic Shield\u2019s port<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connection_Diagram\"><\/span><strong>Connection Diagram<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Figure 12 shows the connections between the Qwiic Nano shield and a few typical components. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"993\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/diagram-1.png\" alt=\"Simple wiring diagram showing a SparkFun Nano Qwiic Shield connected to an SHTC3 sensor (bottom left) and an SSD1306 OLED display (bottom right) using Qwiic-compatible 4-wire cables. The color-coded wires represent SCL (yellow), SDA (blue), 3.3V (red), and GND (black), maintaining consistent I2C bus connections.\" class=\"wp-image-12823\"\/><figcaption class=\"wp-element-caption\"><br>Figure 12. Wiring diagram for a basic Qwiic I2C setup (Arduino below the shield is not shown in this diagram)<\/figcaption><\/figure>\n\n\n\n<p>Note that while the Arduino Nano is not shown here, it is connected directly on top of the shield. Note also the placement of I2C communication pins (SDA and SCL). Ensuring the correct physical orientation prevents damage and guarantees reliable operation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"I2C_Communication_Overview\"><\/span><strong>I2C Communication Overview<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The SparkFun Qwiic Shield leverages the I2C protocol\u2014a standard for connecting multiple devices with just two wires (SDA and SCL). This tutorial assumes that you\u2019ve reviewed the <a href=\"https:\/\/itp.nyu.edu\/physcomp\/i2c-communication-with-a-time-of-flight-distance-sensor\/#i2c-connections\">ITP I2C Communication Labs<\/a> or Related videos: <a href=\"https:\/\/vimeo.com\/380370070\" target=\"_blank\" rel=\"noopener noreferrer\">Intro to Synchronous Serial<\/a>, <a href=\"https:\/\/vimeo.com\/380369693\" target=\"_blank\" rel=\"noopener noreferrer\">I2C<\/a> for background on the protocol.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"I2C_Basics\"><\/span>I2C Basics<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Two-Wire Protocol:<\/strong> Communication occurs over SDA (data) and SCL (clock) lines.<\/li>\n\n\n\n<li><strong>Device Addressing:<\/strong> Each device on the I2C bus is identified by a unique 7-bit address.<\/li>\n\n\n\n<li><strong>Pull-up Resistors:<\/strong> These ensure proper voltage levels on the bus and are often integrated on breakout boards.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Demo_Project_Reading_Temperature_and_Humidity_on_an_OLED_Display\"><\/span><strong>Demo Project: Reading Temperature and Humidity on an OLED Display<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><br>In this project, we\u2019ll read data from SHTC3 (Humidity and Temp Sensor) and display it on an <strong>SSD1306 OLED screen<\/strong>. All components communicate via <strong>I2C<\/strong> and connect using <strong>Qwiic cables<\/strong>\u2014no breadboards or soldering are required.<\/p>\n\n\n\n<p>&#x26a0;&#xfe0f; <strong>Note:<\/strong> Many I2C sensors from providers like SparkFun (Qwiic) and Adafruit (STEMMA QT) come in two variants:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Qwiic\/STEMMA QT-compatible versions<\/strong>, which feature JST connectors for plug-and-play wiring (see Figure 13 below) or<\/li>\n\n\n\n<li><strong>Standard breakout boards<\/strong>, which expose I2C pins (SDA, SCL, VCC, GND) but require jumper wires or soldering (see Figure 13 below)<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"546\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/3595-06-1-edited.jpg\" alt=\"Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor - STEMMA QT \/ Qwiic\" class=\"wp-image-12946\" style=\"width:500px\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/3595-06-1-edited.jpg 970w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/3595-06-1-edited-768x432.jpg 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 13.<\/em> Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor &#8211; with STEMMA QT \/ Qwiic connector <a href=\"https:\/\/www.adafruit.com\/product\/3595\">source<\/a><\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/NewImage-36-edited.png\" alt=\"Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor\" class=\"wp-image-12947\" style=\"width:500px\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/NewImage-36-edited.png 1200w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/NewImage-36-edited-768x432.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 14.<\/em> Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor (without STEMMA QT \/ Qwiic connector) <a href=\"https:\/\/learn.adafruit.com\/adafruit-apds9960-breakout\/overview\">source<\/a><\/figcaption><\/figure><\/div>\n\n\n<p>For this demo, we\u2019re using the <strong>Qwiic-compatible versions<\/strong>, enabling quick, tool-free connections. However, you can also use standard versions of the same sensors as long as you connect them properly to the corresponding I2C pins.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Hardware_Setup\"><\/span>Hardware Setup<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Mount_the_Shield\"><\/span><strong>Mount the Shield<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Carefully align the Arduino Nano 33 IoT (or other Nano variant) with the SparkFun Qwiic Shield for Arduino Nano.<\/li>\n\n\n\n<li>Ensure the 3.3V pins line up correctly to avoid damaging your board.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connect_the_Sensors\"><\/span><strong>Connect the Sensor<\/strong>s<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect sensors to any available Qwiic port using Qwiic cables.<\/li>\n\n\n\n<li>Daisy-chain sensors as needed for project layout.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Attach_the_OLED_Display\"><\/span><strong>Attach the OLED Display<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If the OLED display includes a Qwiic connector, directly connect it to a free port or daisy-chain.<\/li>\n\n\n\n<li>If not, use a Qwiic Jumper Adapter Cable to connect the necessary pins.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Power_and_Ground\"><\/span><strong>Power and Ground<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The Nano\u2019s USB port powers the setup, with the Qwiic Shield distributing 3.3V and GND.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1604\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08548-1-scaled.jpg\" alt=\"Top-down view of an electronics setup featuring an Arduino Nano 33 IoT mounted on a SparkFun Qwiic Shield. The board is connected via Qwiic cable to an SHTC3 humidity and temperature sensor. The sensor is then wired to a small SSD1306 OLED display using jumper wires. The setup rests on a clean, white surface, and all components are connected with color-coded cables.\" class=\"wp-image-12726\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08548-1-scaled.jpg 2560w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08548-1-768x481.jpg 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08548-1-1536x962.jpg 1536w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08548-1-2048x1283.jpg 2048w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08548-1-1200x752.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 15.<\/em> A compact I2C sensor-to-display demo using the Arduino Nano 33 IoT and SparkFun Qwiic Shield.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install_the_External_Libraries\"><\/span>Install the External Libraries<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In the Arduino IDE\u2019s <strong>Library Manager<\/strong> (Sketch &gt; Include Library &gt; Manage Libraries\u2026), install the following libraries and dependencies if needed.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\">Adafruit SHTC3<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\">Adafruit SSD1306<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Program_the_Microcontroller\"><\/span>Program the Microcontroller<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In the demo code below, we begin by importing the necessary libraries and defining display parameters such as screen size and I2C address. In the <code>setup()<\/code> function, we initialize both the SHTC3 sensor and the OLED display, and configure display settings including text size, font, and color. In the <code>loop()<\/code>, the code reads humidity and temperature data from the sensor every three seconds and updates the OLED screen to show the latest values.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; title: ; notranslate\" title=\"\">\n\/\/ Libraries for sensor and display communication\n#include &lt;SPI.h&gt;\n#include &lt;Wire.h&gt;\n#include &lt;Adafruit_GFX.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n#include &lt;Adafruit_SHTC3.h&gt;\n\n\/\/ Instantiate sensor object\nAdafruit_SHTC3 shtc3 = Adafruit_SHTC3();\n\n\/\/ OLED display resolution and initialization\n#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 64\n#define OLED_RESET -1 \/\/ because the reset pin on the OLED is not being used\n#define SCREEN_ADDRESS 0x3C\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, OLED_RESET);\n\nvoid setup() {\n  \/\/ initialize serial communication\n  Serial.begin(9600);\n  \/\/ wait 3 seconds if the serial monitor is not open:\n  if (!Serial) delay(3000);\n\n  \/\/ Initialize SHTC3 sensor, loop indefinitely if this fails:\n  if (!shtc3.begin()) {\n    Serial.println(&quot;Couldn&#039;t find SHTC3&quot;);\n    \/\/ stop forever if the sensor is not available:\n    while (true);\n  }\n  Serial.println(&quot;Found SHTC3 sensor&quot;);\n\n  \/\/ Initialize OLED display, halt program if allocation fails\n  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {\n    Serial.println(F(&quot;Couldn&#039;t find SSD1306 screen&quot;));\n    \/\/ stop forever if the display fails:\n    while (true);\n  }\n\n  \/\/ Configure display settings\n  display.setTextSize(1);\n  display.setTextColor(SSD1306_WHITE);\n  display.cp437(true);\n}\n\nvoid loop() {\n  \/\/ make instances of the sensor elements from the sensor library:\n  sensors_event_t humidity, temp;\n\n  \/\/ Get fresh data from sensor\n  shtc3.getEvent(&amp;humidity, &amp;temp);\n\n  \/\/ Clear OLED display and set cursor to start\n  display.clearDisplay();\n  display.setCursor(0, 0);\n\n  \/\/ Display temperature readings\n  display.println(&quot;Temperature: &quot;);\n  display.print(temp.temperature);\n  display.println(&quot; \u00b0C&quot;);\n  display.println(&quot;&quot;);\n\n  \/\/ Display humidity readings\n  display.println(&quot;Humidity: &quot;);\n  display.print(humidity.relative_humidity);\n  display.println(&quot;% rH&quot;);\n\n  \/\/ Update display with new data\n  display.display();\n\n  \/\/ Wait for 3 seconds before refreshing\n  delay(3000);\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Final_Result\"><\/span>Final Result<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"720\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9578.gif\" alt=\"Animated GIF showing an Arduino Nano connected to a SparkFun Qwiic Shield, which is wired to a black rectangular sensor bar, a small SHTC3 temperature and humidity sensor, and an SSD1306 OLED display. The display is actively updating, showing the current temperature and humidity readings. All components are connected using Qwiic cables, and the setup is powered via a USB-C cable plugged into the microcontroller. The entire setup rests on a white tabletop.\" class=\"wp-image-12718\"\/><figcaption class=\"wp-element-caption\"><br><em>Figure 16.<\/em> Real-time environmental monitoring demo using an Arduino Nano with SparkFun\u2019s Qwiic Shield. The SHTC3 sensor measures temperature and humidity, displaying live data on the SSD1306 OLED screen<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Further_Use_Cases\"><\/span>Further Use Cases<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For a more advanced setup, we can expand the I2C chain by adding more sensors or devices. In the demo below, there is an APDS-9960 gesture sensor and a BMP388 pressure sensor alongside the SHTC3 temperature and humidity sensor. The user can change the data display on the screen by simple hand movement.  You can find examples for these sensors at this <a href=\"https:\/\/gist.github.com\/ankycheng\/a524dccf804112d3802cbefb058b401a\">link<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1746\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08529-1-scaled.jpg\" alt=\"A top-down view of an electronics setup featuring an Arduino Nano 33 IoT (far right) connected via jumper wires and Qwiic cables to multiple sensors and an OLED display. The components include three I2C Qwiic-compatible breakout boards from SparkFun (center to left), connected in series using Qwiic cables. At the bottom left, an SSD1306 OLED screen is also connected. The wiring is color-coded and neatly laid out on a light-colored surface.\" class=\"wp-image-12701\" srcset=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08529-1-scaled.jpg 2560w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08529-1-768x524.jpg 768w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08529-1-1536x1048.jpg 1536w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08529-1-2048x1397.jpg 2048w, https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/DSC08529-1-1200x819.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 17.<\/em> Chain of I2C sensors and display connected to an Arduino Nano 33 IoT using SparkFun\u2019s Qwiic system.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"1067\" src=\"https:\/\/itp.nyu.edu\/physcomp\/wp-content\/uploads\/IMG_9554.gif\" alt=\"Animated GIF showing an SSD1306 OLED display updating live temperature and humidity readings from an SHTC3 sensor.  The SHTC3 (humidity and temperature sensor) is connected via Qwiic cable to another sensor, the APDS-9960, which detects proximity, gesture, ambient light, and color. All components are arranged on a light-colored tabletop and connected using color-coded Qwiic cables.\" class=\"wp-image-12686\"\/><figcaption class=\"wp-element-caption\"><em>Figure 18.<\/em> Live sensor data in action\u2014temperature and humidity readings from an SHTC3 sensor are displayed on an OLED screen, while an APDS-9960 gesture and proximity sensor is also daisy-chained via Qwiic. This setup demonstrates how multiple I2C devices can work together seamlessly over a single bus.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Sparkfun Qwiic Shield can simplify sensor integration and communication with Arduino Nano variants. It&#8217;s not the only way to connect IC components, but if you are, and if you&#8217;re using a Nano, it&#8217;s a handy tool. Whether you\u2019re building a simple temperature monitor or a more complex interactive installation, understanding the practicalities of shield orientation, I2C communication, and connection strategies is key.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you\u2019ll explore the capabilities of the SparkFun Qwiic Shield for Arduino Nano\u2014a modular shield designed to extend the functionality of the Arduino Nano. This shield enables seamless communication between your microcontroller and various I2c-based peripherals like sensors and some displays. It&#8217;s a standard connector type that&#8217;s been informally adopted by a few &hellip; <a href=\"https:\/\/itp.nyu.edu\/physcomp\/lessons\/intro-to-sparkfun-qwiic-i2c-shield-for-arduino-nano\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Intro to SparkFun Qwiic I2C Shield for Arduino Nano&#8221;<\/span><\/a><\/p>\n","protected":false},"author":96,"featured_media":0,"parent":13,"menu_order":312,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[41,15,7],"tags":[61,106,108,107],"class_list":["post-12623","page","type-page","status-publish","hentry","category-i2c","category-lab","category-sensors","tag-i2c","tag-qwiic","tag-sensor","tag-stemma"],"_links":{"self":[{"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/pages\/12623"}],"collection":[{"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/users\/96"}],"replies":[{"embeddable":true,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/comments?post=12623"}],"version-history":[{"count":55,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/pages\/12623\/revisions"}],"predecessor-version":[{"id":12950,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/pages\/12623\/revisions\/12950"}],"up":[{"embeddable":true,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/pages\/13"}],"wp:attachment":[{"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/media?parent=12623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/categories?post=12623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itp.nyu.edu\/physcomp\/wp-json\/wp\/v2\/tags?post=12623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}