Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit QT Py: Examples, Pinouts, and Specs

Image of Adafruit QT PyDesign with Adafruit QT Py in Cirkit Designer

Introduction

The Adafruit QT Py is a compact, versatile development board based on the Microchip SAMD21E18 ARM Cortex-M0+ microcontroller. It is designed for ease of use and flexibility, featuring a USB-C connector for programming and power, a built-in RGB NeoPixel LED, and a variety of GPIO pins. The QT Py is compatible with CircuitPython and Arduino IDE, which allows it to be used in a wide range of projects, from simple LED controls to more complex IoT applications.

Explore Projects Built with Adafruit QT Py

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Adafruit MPU6050 and VL6180X Sensor Interface with Servo Control: A project utilizing Adafruit QT Py in a practical application
Adafruit MPU6050 and VL6180X Sensor Interface with Servo Control

This circuit features an Adafruit QT Py microcontroller interfaced with an Adafruit MPU6050 6-axis accelerometer/gyroscope and an Adafruit VL6180X Time of Flight (ToF) distance sensor, both connected via I2C communication. The QT Py also controls a Servomotor SG90, likely for physical actuation based on sensor inputs. The embedded code initializes the sensors, reads their data, and outputs the readings to a serial monitor, with the potential for motion control based on the sensor feedback.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin # Function Description
1 A0/D0 Analog input or digital I/O, PWM
2 A1/D1 Analog input or digital I/O, PWM, DAC
3 A2/D2 Analog input or digital I/O, PWM
4 A3/D3 Analog input or digital I/O, PWM
5 SDA I2C data line
6 SCL I2C clock line
7 TX UART transmit
8 RX UART receive
9 SCK SPI clock
10 MO SPI master out, slave in
11 MI SPI master in, slave out
- GND Ground
- 3V 3.3V power supply
- RST Reset pin
- USB USB-C for programming and power

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Board: Connect the USB-C cable to the QT Py and a power source or computer to power the board.
  2. Programming: Use the Arduino IDE or CircuitPython to write and upload code to the QT Py.
  3. Connecting Peripherals: Use the GPIO pins to connect sensors, actuators, or other peripherals. Ensure that the connected devices are compatible with the board's operating voltage (3.3V).

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can I power the QT Py with a battery? A: Yes, you can power the QT Py with a battery, but ensure that the voltage is within the recommended input voltage range.

Q: Is the QT Py breadboard-friendly? A: Yes, the QT Py is designed with breadboard-friendly spacing.

Q: How do I reset the board? A: Briefly press the RST button to reset the board. Double-press to enter the bootloader mode for firmware updates.

Example Code for Arduino UNO

Below is a simple example code that blinks the onboard NeoPixel LED on the Adafruit QT Py using the Arduino IDE.

#include <Adafruit_NeoPixel.h>

#define PIN        0  // Define the pin for the NeoPixel
#define NUMPIXELS  1  // Number of pixels in the NeoPixel

// Initialize the NeoPixel library.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pixels.begin(); // Initialize the NeoPixel
}

void loop() {
  pixels.setPixelColor(0, pixels.Color(150, 0, 0)); // Set the color to red
  pixels.show();   // Send the updated pixel colors to the hardware.
  delay(500);      // Wait for half a second
  pixels.clear();  // Turn off the NeoPixel
  pixels.show();
  delay(500);      // Wait for half a second
}

Remember to install the Adafruit_NeoPixel library through the Arduino Library Manager before uploading this code to the QT Py. This example assumes that the onboard NeoPixel is connected to pin 0, which is the default for the Adafruit QT Py.