MicroMod Qwiic Pro Kit Project Guide
2023-01-10 | By SparkFun Electronics
License: See Original Project
Courtesy of SparkFun
Guide by BBOYHO
Introduction
Note: If you are looking for the previous version of this tutorial, head over to the Qwiic Pro Kit Project Guide.
The MicroMod Qwiic Pro Kit was designed to allow users to get started with Arduino without the need for soldering or a breadboard. We've included three inputs (a joystick, accelerometer, and proximity sensor) and one display that can be daisy chained to your Arduino. Hooking up a handful of inputs and outputs to an Arduino has never been so easy with the MicroMod and Qwiic ecosystems!
SparkFun MicroMod Qwiic Pro Kit
Suggested Reading
If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview. We recommend reading here for an overview if you decide to take advantage of the Qwiic connector.
We would also recommend taking a look at the following tutorials to set up the RedBoard Turbo and get a feel for each Qwiic component.
Qwiic Carrier Board Hookup Guide
The Qwiic carrier board is the latest way to rapid prototype with the included M.2 socket to swap processor boards and Qwiic connectors to easily connect I2C devices.
MicroMod SAMD51 Processor Board Hookup Guide
This tutorial covers the basic functionality of the MicroMod SAMD51 and highlights the features of the ARM Cortex-M4F development board.
- Qwiic Micro OLED Hookup Guide: Get started displaying things with the Qwiic Micro OLED.
- Qwiic Joystick Hookup Guide: Looking for an easy way to implement a joystick to your next Arduino or Raspberry Pi project? This hookup guide will walk you through using the Qwiic Joystick with the Arduino IDE on a RedBoard Qwiic and in Python on a Raspberry Pi.
- Qwiic Proximity Sensor (VCNL4040) Hookup Guide: The SparkFun Qwiic Proximity Sensor is a great, qualitative proximity (up to 20 cm) and light sensor. This hookup guide covers a few examples to retrieve basic sensor readings.
- Qwiic 9DoF - ISM330DHCX, MMC5983MA Hookup Guide: Find all your degrees of freedom with this little Qwiic breakout board combining the ISM330DHCX 6Dof and the MMC5983MA Magnetometer!
Kit Contents
You will find the following parts in the kit.
- 1x MicroMod Qwiic Carrier Board - Single
- 1x MicroMod SAMD51 Processor
- 1x Reversible USB A to USB C Cable - 0.8 Meter
- 1x MicroMod Screwdriver
- Inputs
- Outputs
- Qwiic Cables
- 2x 50mm
- 2x 100mm
- 1x 200mm
- 1x 500mm
- 1x SparkFun Mini Screwdriver
Note: Prior to MicroMod Qwiic Pro Kit was the Qwiic Pro Kit. Instead of the RedBoard Turbo with SAMD21 and USB micro-b cable, the MicroMod Qwiic Pro Kit includes the MicroMod SAMD51 Processor Board, Qwiic Carrier Board - Single, USB C Cable, and a MicroMod screwdriver. The Qwiic Triple Axis Accelerometer Breakout - MMA8452Q is also replaced by the 9DoF IMU Breakout - ISM330DHCX, MMC5983MA (Qwiic).
Hardware Hookup
If you have not already, make sure to check out the Getting Started with MicroMod: Hardware Hookup for information on inserting your Processor Board to your Carrier Board. The MicroMod Qwiic Carrier Board Hookup Guide also goes over how to connect the boards together as well!
Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!
Remove the screw across from the MicroMod Qwiic Carrier Board - Single. Then insert the MicroMod SAMD51 Processor Board into the M.2 socket. The Processor Board will stick up at an angle (at around 25°), as seen here.
Hold the board down and tighten the screw with a Philip's head.
Once connected, your board should be secured to the MicroMod Qwiic Carrier Board - Single like the image shown below.
Insert the Qwiic cable of your choice between each to each of the boards. You can daisy chain the boards any way you like. However, we found it easier to control the 9DoF's accelerometer by having it at the end and connecting a longer Qwiic cable. Depending on the player, you will need to orient the 9DoF's accelerometer with respect to the paddle. The vertical and horizontal Qwiic connectors also connect to the same port so you can connect to either one. We also found it easier to connect the Qwiic Distance Sensor with VCNL4040 to the other end as well. Then connect the USB cable between your computer and MicroMod Qwiic Carrier Board - Single.
Warning! You will need to connect all of the boards together when using the demo code in this tutorial. Otherwise, you will need to comment out lines of code for the Qwiic board that is not connected to the daisy chain.
Mounting Qwiic Boards to the Standoffs
You can also mount the Qwiic Micro OLED breakout to the end of the two standoffs as shown below. Remove the yellow tape that is covering the mounting holes. Align the mounting hole with the standoffs. Insert a 4-40 screw between the Qwiic Micro OLED's mounting hole and tighten. You'll need to use some elbow grease to drive each 4-40 screw into the standoffs since they are slightly offset. Make sure to be careful with the Qwiic connector that is closest to the mounting holes. The height of the standoffs and the position of the connector can make the connector push against the end of the Qwiic Carrier Board - Single. However, it was enough to hold the display down.
We recommend not mounting the Qwiic Distance Sensor, Qwiic Joystick, and Qwiic 9DoF so that users that are sitting across from each other are able to control their paddle on their side without getting in the way of the display.
Note: The code used in this tutorial is also compatible with Atmega328P-based Arduinos like the RedBoard Qwiic! If you purchased the components separately or Qwiic Ideation Kit, the setup is the same. Instead of the MicroMod SAMD51 Processor Board, you would be using the RedBoard Qwiic. Check the note below for more information when compiling for the Atmega328P-based microcontrollers! You can also swap out different MicroMod Processor Boards with Arduino Cores as well!
Installing the Board Add-Ons and Drivers
Note: This code/library has been written and tested on Arduino IDE version v1.8.12. Otherwise, make sure you are using the latest stable version of the Arduino IDE on your desktop. If this is your first-time using Arduino, please review our tutorial on installing the Arduino IDE.
There are a few board add-ons to install before you are able to upload code to your MicroMod SAMD51 Processor Board. If you have not already, make sure to check out the MicroMod SAMD51 Processor Board hookup guide to install the SAMD51 and SparkFun board add-ons.
INSTALLING THE SAMD AND SPARKFUN BOARD ADD-ONS
Drivers
Heads up! Please be aware that the MicroMod SAMD51 Processor Board is NOT currently supported on Windows 8 due to a lack of support drivers for those specific OS's.
The MicroMod SAMD51 Processor Board is now easier than ever to program, thanks the UF2 bootloader. With this bootloader, the MicroMod SAMD51 Processor Board shows up on your computer as a USB storage device without having to install drivers for Windows 10, Mac, and Linux!
Installing the Libraries
Note: If you have not previously installed an Arduino library, please check out our installation guide.
SparkFun has written a library for the Qwiic enabled joystick, 9DoF IMU (ISM330DHCX, MMC5983MA), proximity sensor (VCNL4040), and 64x48 micro OLED. You can obtain these libraries through the Arduino Library Manager. Search for the following terms to automatically install the latest versions of each library. If you have issues compiling, you may need to download the respective library versions listed below.
- SparkFun Joystick (v1.0.4)
- SparkFun 6DoF ISM330DHCX - Accelerometer and Gyro (v1.0.0)
- SparkFun MMC5983MA - Magnetometer (v1.0.0)
- SparkFun VCNL4040 (v1.0.2)
- SparkFun micro OLED (v1.2.5)
If you prefer downloading the libraries manually, you can grab them from each of the respective GitHub repositories.
SPARKFUN QWIIC JOYSTICK ARDUINO LIBRARY (ZIP)
SPARKFUN 6DOF ISM330DHCX - ACCELEROMETER AND GYRO ARDUINO LIBRARY (ZIP)
SPARKFUN MMC5983MA - MAGNETOMETER ARDUINO LIBRARY (ZIP)
SPARKFUN VCNL4040 ARDUINO LIBRARY (ZIP)
SPARKFUN MICRO OLED ARDUINO LIBRARY (ZIP)
Note: The demo code currently just uses the accelerometer to control the paddle. We have linked the library in this section in case you use the magnetometer in case you decide to use it as well!
Example Code
We recommend grabbing the code from its the GitHub repository. Otherwise, you can download the zipped file from the link below.
DOWNLOAD THE MICROMOD QWIIC PRO KIT CODE (ZIP)
After downloading, unzip the files and open the MicroModQwiicStarterExample.ino sketch. It should be located in the downloads folder similar to this path: .../Firmware/Arduino/MicroModQwiicStarterExample/MicroModQwiicStarterExample.ino. Open the code up in the Arduino IDE, select the board (i.e., the SparkFun SAMD51 MicroMod), and the COM port that the board enumerated on. Then hit the upload button.
With a friend, try rocking the 9DoF back and forth along the x-axis or moving your hand above the proximity sensor to control each paddle. You can also take a PCB or flat object as shown in the GIF below to make it easier to control. Remember, you will need to orient the 9DoF's accelerometer with respect to the paddle (if you notice in the GIF, player 1 had the board oriented in a way that had the paddle controls were reversed). You will need to orient the micro OLED so that the paddle is on the side of the player's Qwiic board. The game will continue as long as the ball hits the paddle and bounces to the other side. A player will win a round as soon as the other player fails to bounce the ball back to the other side. The current score will be briefly displayed before the next game. Try to rack up more points than your opponent!
Heads up! As with any distance sensor, there is a minimum distance at which the sensor can detect an object accurately. If your hand or finger is too close to the sensor, the readings for the distance can jump to a higher value causing the paddle to move off the screen. Make sure to be within the range to successfully hit the ball or try adjusting the code to include a minimum and maximum range for the paddle.
The default code uses the 9DoF's accelerometer as player 1 and the proximity sensor as player 2. Try adjusting the code to use the joystick for one of the players by adding and removing the single line comments. The joystick will control the paddle along the "vertical" y-axis. Each board can only have one player assigned. See if you can try to remove the unused Qwiic board from the daisy chain and commenting out each instance of the related board. Or try adjusting the code to control the paddle with the magnetometer and a magnet!
Troubleshooting
Not working as expected and need help?
If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.
SPARKFUN TECHNICAL ASSISTANCE PAGE
If you don't find what you need there, the SparkFun Forums are a great place to find and ask for help. If this is your first visit, you'll need to create a Forum Account to search product forums and post questions.
CREATE NEW FORUM ACCOUNT LOG INTO SPARKFUN FORUMS
Resources and Going Further
Now that you've successfully got your MicroMod Qwiic Pro Kit up and running, what will else will you build? For more information, check out the resource below:
- Arduino Libraries
- SparkFun Joystick
- SparkFun 6DoF ISM330DHCX - Accelerometer and Gyro
- SparkFun MMC5983MA - Magnetometer
- SparkFun VCNL4040 - Proximity Sensor
- SparkFun Micro OLED
- MicroMod Qwiic Pro Kit Code
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum