The QT Py is a small, lightweight microcontroller board designed for easy integration with various sensors and components. It features a compact form factor, making it ideal for projects where space is limited. The QT Py is compatible with both CircuitPython and Arduino, offering flexibility for developers of all skill levels. Despite its small size, it is packed with powerful features, making it suitable for a wide range of applications.
The QT Py is based on the SAMD21 or RP2040 microcontroller (depending on the variant) and offers the following key specifications:
Specification | Details |
---|---|
Microcontroller | SAMD21 Cortex-M0+ (48 MHz) or RP2040 dual-core Cortex-M0+ (133 MHz) |
Flash Memory | 256 KB (SAMD21) or 2 MB (RP2040) |
RAM | 32 KB (SAMD21) or 264 KB (RP2040) |
Operating Voltage | 3.3V |
Input Voltage | 5V via USB-C |
GPIO Pins | 11 (including I2C, SPI, UART, and analog inputs) |
USB Interface | USB-C connector for power, programming, and data |
Dimensions | 22.9 mm x 17.8 mm |
Programming Support | CircuitPython, Arduino IDE, and MicroPython |
The QT Py features a total of 14 pins, including power, ground, and GPIO. Below is the pinout description:
Pin | Label | Function |
---|---|---|
1 | 3V | 3.3V power output |
2 | GND | Ground connection |
3 | A0 | Analog input or digital GPIO (ADC capable) |
4 | A1 | Analog input or digital GPIO (ADC capable) |
5 | SDA | I2C data line |
6 | SCL | I2C clock line |
7 | TX | UART transmit line |
8 | RX | UART receive line |
9 | SCK | SPI clock line |
10 | MISO | SPI master-in-slave-out line |
11 | MOSI | SPI master-out-slave-in line |
12 | D4 | Digital GPIO |
13 | D5 | Digital GPIO |
14 | USB-C | USB-C connector for power, programming, and data |
Powering the QT Py:
Connecting Components:
SDA
and SCL
pins. SCK
, MISO
, and MOSI
pins.Programming the QT Py:
.uf2
firmware file to the QT Py when it appears as a USB drive. Here is an example of how to blink an LED connected to pin D4
using the Arduino IDE:
// Define the pin for the LED
const int ledPin = 4; // Pin D4 on the QT Py
void setup() {
// Set the LED pin as an output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Turn the LED on
digitalWrite(ledPin, HIGH);
delay(1000); // Wait for 1 second
// Turn the LED off
digitalWrite(ledPin, LOW);
delay(1000); // Wait for 1 second
}
Here is an example of reading an analog sensor connected to pin A0
using CircuitPython:
import board
import analogio
import time
sensor = analogio.AnalogIn(board.A0)
def get_voltage(pin): # Convert the raw analog value to a voltage return (pin.value * 3.3) / 65536
while True: # Read and print the sensor voltage voltage = get_voltage(sensor) print("Sensor Voltage:", voltage) time.sleep(1) # Wait for 1 second
QT Py Not Recognized by Computer:
CircuitPython Drive Not Appearing:
.uf2
file to the drive that appears.Components Not Responding:
Overheating:
Q: Can I power the QT Py with a battery?
A: Yes, you can use a 3.7V LiPo battery with a suitable regulator to provide 3.3V to the board.
Q: Is the QT Py compatible with MicroPython?
A: Yes, the RP2040 variant supports MicroPython, while the SAMD21 variant is optimized for CircuitPython.
Q: How do I reset the QT Py?
A: Press the reset button once to restart the board. Double-tap the reset button to enter bootloader mode.
Q: Can I use the QT Py for audio processing?
A: While the QT Py is not specifically designed for audio processing, the RP2040 variant can handle basic audio tasks with external components.
By following this documentation, you can effectively integrate the QT Py into your projects and troubleshoot common issues.