Seeeduino XIAO simple USB volume control with CircuitPython

round computer device with USB cable exiting at left. Small microcontroller at centreshowing wiring to LED ring and rotary encoder
Slightly blurry image of the underside of the device, showing the Seeeduino XIAO and the glow from the NeoPixel ring. And yes, the XIAO is really that small

Tod Kurt’s QTPy-knob: Simple USB knob w/ CircuitPython is a fairly simple USB input project that relies on the pin spacing of an Adafruit QT Py development board being the same as that on a Bourns Rotary Encoder. If you want to get fancy (and who wouldn’t?) you can add a NeoPixel Ring to get an RGB glow.

The QT Py is based on the Seeeduino XIAO, which is a slightly simpler device than the Adafruit derivative. It still runs CircuitPython, though, and is about the least expensive way of doing so. The XIAO is drop-in replacement for the Qt Py in this project, and it works really well! Everything you need for the project is described here: todbot/qtpy-knob: QT Py Media Knob using rotary encoder & neopixel ring

I found a couple of tiny glitches in the 3d printed parts, though:

  1. The diffuser ring for the LED ring is too thick for the encoder lock nut to fasten. It’s 2 mm thick, and there’s exactly 2 mm of thread left on the encoder.
  2. The D-shaft cutout in the top is too deep to allow the encoder shaft switch to trigger.

I bodged these by putting an indent in the middle of the diffuser, and filling the top D-shaft cutout with just enough Blu Tack.

Tod’s got a bunch of other projects for the Qt Py that I’m sure would work well with the XIAO: QT Py Tricks. And yes, there’s an “Output Farty Noises to DAC” one that, regrettably, does just that.

Maybe I’ll add some mass to the dial to make it scroll more smoothly like those buttery shuttle dials from old video editing consoles. The base could use a bit more weight to stop it skiting about the desk, so maybe I’ll use Vik’s trick of embedding BB gun shot into hot glue. For now, I’ve put some rubber feet on it, and it mostly stays put.


Hey! Unlike my last Seeed Studio device post, I paid for all the bits mentioned here.

SeeedStudio Wio Terminal

Small screen device showing geometric pattern
Wio Terminal displaying … some kind of nonsense of mine

Some months ago, when Chloe from Seeed Studio got in touch and asked me if I’d like to write about their new Wio Terminal device, I didn’t waste any time in saying yes. I mean, would you say no to all of this?

  • 120 / 200 MHz ARM Cortex-M4F core (MicroChip ATSAMD51P19: 512 KB Flash, 192 KB RAM) with additional 4 MB Flash program/data storage and micro-SD card slot;
  • 2.4″ 320 × 240 colour screen;
  • Realtek RTL8720DN wifi / Bluetooth transceiver;
  • buttons, joystick, accelerometer, RGB LED, light sensor and IR transmitter;
  • neat case (72 × 57 × 10.4 mm) with magnetic and screw mounts;
  • Grove connectors for wiring free sensor mounting.
Wio Terminal internals
Wio Terminal internals (from Wio Terminal User Manual)

It’s got a Raspberry Pi-type header that claims compatibility. The documentation for all the ports is a cut above the usual no-name ESP8266 / STM32 stuff:

Wio Terminal pinout
Wio Terminal pinout (from Wio Terminal User Manual)

The device is in a really tidy package. Its screen, although not a touchscreen, is super sharp.

individual pixels magnified from the Wio Terminal screen
The screen is very nice: individual pixels zoomed in

There are three ways of programming the Wio Terminal:

  1. Arduino
  2. SeeedStudio’s own ArduPy
  3. CircuitPython

Each of these have pros and cons.

Arduino (get started)

  • the fastest code execution: compiled ARM binary code
  • the only way to access wifi and Bluetooth (currently)
  • slow development cycle
    (… is it just me, or has the Arduino IDE got really 🦥🦥🦥 recently?)

ArduPy (get started)

  • SeeedStudio’s own ingenious port of MicroPython to the Arduino API, as MicroPython doesn’t (yet) support the SAMD51 chip
  • Works almost, but not quite, exactly like you’d expect MicroPython to work
  • It’s a great and amazing effort, but it’s essentially a solo project, so documentation and examples are few.

CircuitPython (install)

  • developed and maintained by Adafruit as a fork of an earlier version of MicroPython
  • very actively developed, with a huge library of supported devices.
CircuitPython text mode Mandelbrot set: about all I managed with that system. And yes, I did eventually take the screen protector sheet off

Here’s the major problem I have with all of these development toolkits for the Wio Terminal: none of them provide high-level access to the device’s sensors and outputs. Compare this with Adafruit, who create things like the Adafruit_CircuitPython_CircuitPlayground module. On that board, you can access the LEDs, speaker, etc without having to go back to the schematic to find out which pin each of them is connected to. Because of this, I’ve only been able to scratch the surface of what the Wio Terminal can do.

In summary:

  • It’s really nicely made, and the µC inside is very powerful
  • It’s not too expensive: US $29
  • All of the software stacks aren’t particularly mature
    (but it’s only been available since March 2020)
  • Documentation is at the “datasheet + trial/error” stage
  • The 40-pin connector isn’t completely compatible with Raspberry Pi:
    • Serial RX/TX aren’t crossed
    • ILI9341 display isn’t broken out to header
  • … although you can (and I verified this in a live demo at a user group) use a Wio Terminal as a tiny HMI (Human Machine Interface) USB display for Linux machines

The Wio Terminal is a little too powerful to be thought of as a simple micro-controller platform, but not quite powerful enough to be a standalone general purpose computer. I wish I could find a great application for it, though.


This post is modified from the talk I gave to the Toronto Raspberry Pi Meetup group in December 2020: SeeedStudio Wio Terminal: Applications with the Raspberry Pi. Thanks to Chloe and all at SeeedStudio for sending it to me.

Seeed is the IoT hardware enabler providing services over 10 years that empower makers to realize their projects and products. Seeed offers a wide array of hardware platforms and sensor modules ready to be integrated with existing IoT platforms and one-stop PCB fabrication and PCB assembly service. Seeed Studio provides a wide selection of electronic parts including Arduino  Raspberry Pi and many different development board platforms  Especially the Grove System help engineers and makers to avoid jumper wires problems. Seeed Studio has developed more than 280 Grove modules covering a wide range of applications that can fulfill a variety of needs. 

https://www.seeedstudio.com/

Disclosure: SeedStudio sent me this unit free of charge.