Getting Started

Adafruit Playground is a wonderful and safe place to share your interests with Adafruit's vibrant community of makers and doers. Have a cool project you are working on? Have a bit of code that you think others will find useful? Want to show off your electronics workbench? You have come to the right place.
The goal of Adafruit Playground is to make it as simple as possible to share your work. On the Adafruit Playground users can create Notes. A note is a single-page space where you can document your topic using Adafruit's easy-to-use editor. Notes are like Guides on the Adafruit Learning System but guides are high-fidelity content curated and maintained by Adafuit. Notes are whatever you want them to be. Have fun and be kind.
Click here to learn more about Adafruit Playground and how to get started.
-
Guide: Build a WiFi Matrix Keypad Remote Circuit Diagram
The diagram below provides a general visual reference for wiring of the components once you get to the Assembly page. This diagram was created using the software package Fritzing. Note that we will be using all available GPIO pads on the QT Py, so there will be a good bit of soldering involved.
Overview
Modern electronics are capable of incredible things. Even the simplest gadgets now have clocks, gyroscopes, radios, GPS, touch screens, literally anything you can imagine, built right in. Sometimes though, the devices that are capable of doing several things don't do all of them particularly well. Touch screens are often bolted onto things that really don't benefit from them, or even worse, detract from the experience. Anyone who has accidentally grazed the touch panel on an Apple TV remote while grasping for it in the dark knows exactly what I'm talking about. Sometimes I just want to have a remote with a few simple buttons I can press to make things happen, and that's it!
Most of the lights in my apartment are WiFi-connected, and offer MQTT capability. I took advantage of this and set up a local MQTT broker (https://mosquitto.org/) on a Raspberry Pi 4 wired to an old Apple Airport router/hub I had lying around (my internet provider makes me use their router for my internet). Now, it's easier than ever to control my lights...from a browser. Or some phone interface. Or an app. Wait a second...each of those still requires multiple steps just to get me to the point where I can actually control anything. And I probably still have to use a touch screen. Leading me back to my original point, and thus the motivation for the imaginatively named:
WiFi Matrix Keypad Remote
I've been a DIY remote control enthusiast for almost as long as I've been hacking around with microcontrollers (at least a few years now). One thing that I've found really hard to source as a hobbyist is good, pre-made button panels intended to be mounted into a small space, such as a remote control. So far, one of my favorite sources for a dense panel of decent quality, inexpensive buttons are these old-school 3x4 matrix keypads:
-
CB Microphone for your PC - Breaker Breaker any takers? Part one : Where's the mic?
"Breaker breaker , any takers? This is the the one and only Delchi hunting for bear on I-95 South , keeping that double nickel and keeping the sunny side up & the greasy side down! We gone!" 1
I was looking for some new gaming frontiers when I came across truck simulators! All the skill & thrill of a big rig from your PC. As with all simulators there are button boxes and realistic cockpits to buy, but one thing I didn't see was a CB radio mic! They expect us to use desktop mics, headsets or some other hoo-haw instead of the ol jabberjaw microphone! A little deeper digging showed that you can buy adapters, but they ranged from $180 to $300! ( Granted the $300 one is an awesome button box and has a lot of realistic controls along with the mCB mic.)
Well the first thing I did was say "Belgium" to that, and pulled Rolling Thunder across the room to my workbench and got to work. This was going to be a project that would work with Truck simulators, sub simulators and more! Grab that soldering iron, the wire clippers and that drill over there! It's time to start making!
Notes :
1. CB radio jargon was around long before IRC , and was its own language designed to obfuscate communication and have a grand ol time. "Handles" were common, and yes CB radio handles are where the hacking community got the term handles for hacker aliases!
Translation? Why not ?
- "Breaker breaker , any takers?"
- In cb radio ( less formal than ham radio ) it was common to ask permission before talking on an open channel. Calling for a "break" was like requesting permission to chime in , and was normally answered with "Go ahead breaker"
- "This is the the one and only Delchi"
- Handles were a point of pride and very often unique, but when they did collide they politely adjusted to be like "The New Orleans Joker " vs "The Chicago Joker" and so on.
- "hunting for bear on I-95 South"
- Truckers took great lengths to avoid being caught by the police in speed traps. "Smokey Bear" referred to the Smokey The Bear hat most often worn by police patrolling the interstates. If you were hunting for bear that meant you were on the lookout for police, and sometimes were asking for a "Smokey report" if anyone had seen any police. You usually followed this with the interstate you were on and the direction you were traveling and sometimes the mile marker you had passed most recently.
- "keeping that double nickel"
- This referred to the speed limit of 55 miles per hour that was enforced back then. Sadly there is no clever phrase for the 65 mph speed limit.
- "keeping the sunny side up & the greasy side down!"
- Multiple meanings here, but for the most part this meant keeping your truck upright ( sunny side was the cabin, greasy side was the road ). It was like wishing someone safe travels and no accidents.
- "We gone!"
- When a conversation ended people would signal this with a number of phrases like "we gone" , or "On the side". Sometimes it also included the "10-code" messages such as "10-10 Till I see you again"
Related Links :
- Truck Simulator
- Button Box
- 10- Code & other jargon
Part Two : Requirements
So then at the workbench with graph paper and pencil in hand ( or Lucidchart if you will ) let's determine what we need to make this CB mic project roll down the road :
- Utilizing a CB Microphone
- Be able to attach the microphone to the computer
- Be able to use the button on the microphone to activate the PTT ( Push to talk ) feature on the computer / in game
- Make it look realistic!
- Make it as clean as possible ( minimum number of wires / software / configuration )
- "Breaker breaker , any takers?"
-
Retro blinkenlights: driving 4 charlieplex LED matrices I recently released another retrocomputer miniature that incorporates a handful of Adafruit boards so I thought that I'd share the details here.
The original Connection Machines were built in the late 80s and early 90s to provide a few thousand hyper-connected processors which at the time was rather unique. If you're interested, here's a wikipedia page about them.
My Patreon supporters vote for which miniatures I make and I was pretty happy when the Connection Machine was chosen. I was also happy to find that Adafruit sells pretty much exactly what I needed to make the blinking light panels:
Assembly requires me to solder the four matrix driver boards to the four LED matrix boards and then plugging in the Stemma QT cables between the QT Py and a chain of the driver boards.
Then I assemble these printed parts. The little C shaped parts on the lower left of this photo are what hold the two-board sandwich of the LED maxtrix board and the driver board.
Then I install CircuitPython on the QT Py and then load it with my code from Codeberg. There you'll find the default blinkenlights script but also a script that uses the network to fetch the time and then turn the Connection Machine into a clock. It took a bit of work to figure it all out so hopefully the code will be a handy starting point for similar projects.
Once everything is assembled I box it up and put it on my gumroad store.
I post pretty much every day about what I'm working on over on Mastodon at @[email protected] and for maker-y types of conversations I like that place much more than the other social media sites. Maybe I'll see you there!
-
When Black and White QRCodes don't work: Qualia Touch Example Dual QRCodes for Wifi + WebWorkflow - Logs onto network if present, showing QRcode for the Wifi Access point for easy joining and remote configuration, also displays SSID.
Next to that is the Web Workflow QRcode, built from the IP address of the device and web workflow port if specified.
- If the user hasn't configured SSID or fails to get an IP in 5seconds, then the help page QRcode is displayed along with a touch sensitive Circuitpython logo.
- There is code to adapt the returned touch events to be rotated (the BAR 320x820 display is vertically orientated so coordinates of touch events need adjusting).
The touch code cycles through the tilegrid and group objects looking for a callback on a tilegrid to trigger if the x + y (plus tile_width and tile_height) match the touch point.
It works for the bitmap, but not the qrcode tilegrids, nor labels.
Feature List:
- Logs onto network if present, showing QRcode for the Wifi Access point for easy joining and remote configuration, also displays SSID.
-
Hello Pi: Finding the IP Address of Headless Raspberry Pis (and Other Devices) The Problem:
A frequent problem I have when creating a new Raspberry Pi-based project is determining the IP address of the device. I am often working with Pi projects in a "headless" (no monitor) configuration using SSH to log in from a PC on the same LAN network. But to log in this way, I need the Pi's IP address, which sets up a chicken-and-egg problem that goes like this:
I want to connect (SSH) to a headless Raspberry Pi, but before I can do so, I first need to attach a monitor and keyboard to it to login locally and get its IP address (with 'ifconfig').
This is the very thing I would like to avoid since the system will ultimately be "headless". In truth, while it is only a minor inconvenience, it is one I'd like to do without. The more new RPi systems that you set up, the more tedious it is to pull out a monitor and keyboard to find the IP address of each one before you can begin remotely connecting to it over the LAN using SSH.
My Solution:
I would like to be able to find the IP address of a headless RPi without having to connect a monitor and keyboard to it. Ideally, I would be able to connect my new RPi to my network, and know the IP address that is it assigned. Then, I could simply connect directly to it using SSH from my PC on the same network.
As is the case for many others, my minor annoyance at "the problem" turned into a full-blown project to solve it. I created a program I called Hello Pi that can be run on a Linux or Windows computer to identify the IP address of a Pi (or other device) connected to the same network segment.
-
Sound for Qualia RGB666 I heard that you can do I2S audio with the Qualia RGB666 board, but I didn't find any instructions. Well, now you won't have the same problem. Let's get this thing beeping! This is a Dexter Starboard project, with assistance from ProtoEngineer
Description
This project explores the implementation of digital audio output using the MAX98357 I2S Class-D Mono Amplifier in conjunction with the Qualia ESP32-S3 RGB666 board. The goal is to produce a sine wave tone through a speaker connected to the amplifier.
Equipment
- Qualia ESP32-S3 RGB666 board - A versatile microcontroller board based on the ESP32-S3 chip, ideal for projects requiring WiFi and Bluetooth connectivity along with powerful processing capabilities.
- MAX98357 I2S Class-D Mono Amplifier Breakout - An easy-to-use digital amplifier perfect for adding high-quality sound to your projects.
- Speakers compatible with the amplifier.
- Connecting wires. I used 6" female jumper wires.
- Header pins for the Qualia board and the MAX98357 breakout. Go ahead and attach the headers now.
- Personal computer with CircuitPython installed.
::closeup of the Qualia board showing pins::
::closeup of the MAX89357 showing pins:: -
CircuitPython Animated GIFs on a Matrix Portal Playing animated GIFs was added to CircuitPython in early 2023 and I had successfully had them running on TFT displays and even to a monitor via HDMI. I recently setup my MatrixPortal and two 64x32 matrices that I had been using to show animated GIFs. But the MatrixPortal was running Arduino code.
Time for an update and to take the code from Using Animated GIF Files in CircuitPython and Creating Projects with-the CircuitPython MatrixPortal Library and smush them together to play animated GIFs on a MatrixPortal with CircuitPython. Both guides do a great job of explaining the details of their own area and the code here combines them both.
The first half of the code sets up the matrix on
DisplayIO
and the second half usesOnDiskGif
from thegifio
module to display the animated GIF.The code displays all GIFs found in the /gifs/ directory on the MatrixPortal. Each animated GIF will display for 30 seconds before moving to the next animation.
One major difference from the Animated GIF guide: for speed, the code in the guide sends the raw bitmap data directly to an attached display. In theory that is possible to do on the MatrixPortal but it is more complicated and likely would be slower then using
DisplayIO
. This is because the matrices have fewer pixels then most screens and the speed of theprotomatter
library that powers the matrix display. -
Symbols for synthio Objects In the process of learning to use CircuitPython synthio, it was a challenge to understand the myriad of possible connections between modules. As a result, project design notes and sketches became a rat's nest of entangled symbols and wiring. Although simple single-voice designs without filters or LFOs were easy to deploy and document, it became clear that there was more to discover inside the extensive versatility of synthio.
Perhaps a set of symbols with consistent notation (and color-coded arrows, of course) would be useful to further learn about synthio and to develop project conceptual diagrams.
Here's the beginning of some symbols for synthio objects with class properties and methods together with data types. Essential tools such as audiomixer and audiobusio are also included.
Attribution: Patch Symbols from PATCH & TWEAK by Kim Bjørn and Chris Meyer, published by Bjooks, are licensed under Creative Commons CC BY-ND 4.0. Some Patch Symbols were modified to create the synthio symbols BlockInput, MixerVoice, Note, Synthesizer, sample, and voice.
-
Using Android with CircuitPython Recently there was a PR merged into CircuitPython that allows for the mounting of a CIRCUITPY drive on an Android device. Previously this was not possible, so I wanted to try it out. For my testing, I used a Samsung Galaxy A13 phone running Android version 13. The board I used was a Circuit Playground Express running CircuitPython 9.0.0-alpha.4.
The REPL
I asked our resident Android expert FoamyGuy for some advice on where to start to access the REPL. He suggested the Serial USB Terminal app (Google Play Store). The key feature for CircuitPython that this app has is the ability to create macros. With macros, you can setup CTRL+C and CTRL+D shortcuts that otherwise are impossible to do with the default Android keyboard.
To create the macros, you'll long press on the macro button. Select HEX as the edit mode and value 03 for CTRL+C. On a second macro, follow the same procedure and value 04 for CTRL+D.
-
Extending the Talking HAL-9000, literally and figuratively 3D files and (lack of) code
You can find the 3D files for the modified HAL parts, as well as the case for the QT Py on Printables. The wiring is pretty basic; in addition to the wiring from the learn guide, I wired one of the RP2040 Feather's UARTs to the headphone (TX, RX, GND) jack, and the other to a 4-pin JST connector (5V, GND, TX, RX) with a few inches of wire. A corresponding JST connector is soldered on to the QT Py, with the 5V and GND wires connected to the battery power pads on the bottom of the board, and the TX/RX wires connected to the corresponding RX/TX pins.
I did not post any code for this as it is highly specific to my situation, however, to be honest, none of the code is particularly special. I used the CircuitPython MQTT learn guide to figure out how to get connected to my local MQTT network, and the CircuitPython essentials guide to work out how to use the UART (for communication) and PWM (for animating the LED).
Overview
I love this make of HAL-9000 from the Ruiz Bros:
-
ESP32-S3 MQTT Feather Weather This has been my main project since 2019 which started on the Adafruit Bluefruit Sense microcontroller with Arduino. I eventually ported it to Circuit Python... and I've never used Arduino since. There are many different versions of this project on my github that are either offline only, offline with GPS, offline & online, offline & online with MQTT.
The project I'm detailing today is offline & online with MQTT to AdafruitIO. This means if for whatever reason your WiFi goes down, OpenWeatherMap.org servers go down, or AdafruitIO goes down it will still display local sensor data and function in an offline capacity waiting patiently until communication is restored.
The display sits in front of my PC monitor and has been running 24/7 for about 3 years now. I've had a lot of time to debug all of the things that might cause it to crash, error, and gracefully fail in a never ending loop. It's not perfect but it's solidly coded.
This is the Feather Weather GUI. It incorporates API data from OpenWeatherMap.org (labels in blue) and real-time sensor data from an Adafruit BME280 module (labels in orange). It then collates the data from the BME280 sensor and whisks it away to my AdafruitIO dashboard using MQTT.
It has some additional features like showing the battery voltage and severe weather warnings. This project was designed as a battery powered weather station during hurricanes and storm related power outages.
Skill Level: Advanced: 600 lines of code
- This is not a beginner friendly project. This one is targeted at advanced Circuit Python users that have experience with JSON parsing, MQTT broker, and GUI design. There are potentially a lot of errors that might crop up during the course of this project that could get you stuck without prior experience. Help is always available in the Adafruit Discord if you want to tackle this project anyway.
- If this project seems too daunting and you'd like to try an easier version aimed more at beginners (because i was a beginner when I wrote it) then check out my Offline Feather Weather. It's only 200 lines of code.
Requirements:
- TFT display of your choosing (I'm using a 3.5" TFT Featherwing)
- OpenWeatherMap.org (free) account & API token
- AdafruitIO (free) account & API token (key)
Optional:
- Temperature/Pressure/Humidity Sensor (BME280)
- Display with built-in SDCard or SDCard module used for screenshots of your GUI.
- Adafruit LiPo battery (I'm using a 10,000 mah)
-
Accurately Calculating Coordinated Mars Time with CircuitPython I'm currently working on a clock using a Qualia S3 board with a 4" 720x720 round display. The idea is to display an "analog" clock face on it. The clock will show your timezone on Earth and coordinated Mars time (MTC). In looking into MTC, I found the Mars24 Sunclock, which is a piece of desktop software from NASA that shows your local time, UTC time and then MTC.
The algorithm for calculating MTC was published by NASA researcher Michael Allison in 1997 and then updated in 2000 by Michael Allison and Megan McEwen. It is nicely summarized on the Timekeeping on Mars Wikipedia page:
The Mars Sol Date (MSD) can be computed from the Julian date referred to Terrestrial Time (TT), as[46]
MSD = (JDTT − 2405522.0028779) / 1.0274912517...This leads to the following formula giving MSD from the UTC-referred Julian date:
MSD = (JDUTC + (TAI−UTC)/86400 − 2405522.0025054) / 1.0274912517where the difference TAI−UTC is in seconds. JDUTC can in turn be computed from any epoch-based time stamp, by adding the Julian date of the epoch to the time stamp in days. For example, if t is a Unix timestamp in seconds, then
JDUTC = t / 86400 + 2440587.5It follows, by a simple substitution:
MSD = (t + (TAI−UTC)) / 88775.244147 + 34127.2954262MTC is the fractional part of MSD, in hours, minutes and seconds:[3]
MTC = (MSD mod 1) × 24 hI wish I could tell you that I can read through that and understand it and as a result write a block of Python code that performs that calculation without a lot of trial and error. Unfortunately, I really struggle with math so I turned to ChatGPT-4. I was incredibly reticent about using ChatGPT or any other LLM but I have to say that I've found ChatGPT-4 to be a very helpful tool when writing code that saves a lot of time for tasks like this. I entered that algorithm into ChatGPT-4 and asked it to convert it to CPython and it popped out a script that worked perfectly when compared to the Mars24 clock. You can see my full chat log here.
-
Ultimate Omnifixo Pinecil Travel Case After watching this Tested video on YouTube showing of the Omnifixo helping hands, I decided to pick one up. I have found it incredibly useful when soldering small electronics. After a bit of use I decided to 3d print the case recommended in the video, but wasn't happy with it. I looked around for other designs, and found some better options, but still not exactly what I was looking for. So, decided to design my own.
With the included Pinecil soldering iron, solder, and brass sponge, this design carries everything I need to solder on-the-go.
This version will require 4x 10mm ball bearings. These ball bearings are the same diameter as the balls at the end of the Omnifixo clamps. So I embed the ball bearings into the printed case and the Omnifixo magnet mounts snap to these bearings nicely to hold everything together. No other magnets are required.
The metal tin I used for the brass sponge is a ½ oz round tin I purchased off of Amazon.com here. It is a 4cm round tin, and I cut off a bit of brass sponge to fit inside. Also, this is the solder that fits perfectly in the case, but you could just bundle up any solder and throw it in that slot.
I printed this with a .4mm nozzle at .2 layer height using carbon fiber PLA (though PETG is probably a better choice). You can print the entire thing then using some force push the ball bearings into the print in the corners. They should kind of snap into place.
Note: if you stick the yellow Omnifixo magnets to the embedded ball bearings with the flat side they will stay stuck to the Omnifixo base plate when it is removed.
-
MIDI Samplerbox (RaspberryPi) SamplerBox is an electronic musical instrument. Drop audio samples onto it, hook up a MIDI keyboard, and you'll be able to play with realistic piano, organ, drums, etc. sounds!
The Samplerbox is a small device that plays pre-recorded instrumental sounds when it receives MIDI commands. Vintage products that do this include: ASR-10/EPS/Mirage samplers. Here are other similar products: Sound Modules
It's sample player. It's a MIDI sound module. It is a ROMpler. It stores the sounds of instruments and plays notes from those instruments when it receives MIDI note commands. Those sounds can be any WAV files. You can freely download sound files (samples and sample-sets) over the Internet, or you can record them yourself and copy the sound files into SampleBox. It can then receive MIDI from a MIDI keyboard controller, or any other MIDI device and play the sounds out an ordinary line-out jack.
The original Samplerbox project is described at this website:. https://www.samplerbox.org/ However that's outdated now. We're providing current (May 2023), much easier build instructions at http://chromakinetics.com/samplerbox/.
Extensive, detailed information on the latest Samplerbox development is at: https://homspace.nl/samplerbox/ Note: this website may be offline. Use the Wayback Machine to view the archived version of that website if necessary. There are a whole lot of pro-level features documented there that you can access, depending on how much complexity you want to deal with.
Good article on using a Samplerbox as a Mellotron replacement SamplerboxMellotronArticle.pdf
Full build instructions are at http://chromakinetics.com/samplerbox/
Required Parts
- Raspberry Pi 3B+ $35 or Raspberry Pi 4 (any memory size) (also should work on a Pi Zero 2, but these directions do not cover that model.
- Pimoroni Pirate Audio LineOut $25 Pimoroni website
- Power supply for Raspberry Pi (5V 2.5A with correct connector for the Pi model)
- MicroSD card at least 2GB (I'm using 16GB)
- a microSD card reader or microSD adapter (if your computer has a full-size SDcard slot built-in)
- a MIDI keyboard (either a USB keyboard or a 5-Pin DIN MIDI keyboard connected to a USB MIDI adapter)
-
MIDI Commander (PyGamer) MIDI SysEx Patch Loader / MIDI snippet player
MidiCommander is a CircuitPython app running on a PyGamer with a MIDI Featherwing plugged in and with an SDcard. It enables a user to "play" syx and .mic files containing snippets of MIDI commands, stored in folders of "playlists" on the SDcard, out to connected MIDI devices. It may be used to send MIDI data to several devices to configure a MIDI setup for each song during a gig.
- Files containing MIDI command bytes are to be stored on the SDcard in the /syx folder and its subfolders. The joystick UI enables navigation to subfolders.
- Filenames and folder names that start with a period are ignored.
- Only files with a .syx or .mic extension are seen by this program
- You can put any MIDI command bytes into a .mic or .syx file and this will send whatever is in the file, so you can send Program Change, CC and other - you are not limited to SYSEX commands. You can put all the MIDI commands needed to configure your rig for a song in one file.
- Arrange the files in a folder in the order of your setlist and then during a gig, simply choose the file and press a button to send it -- and all your MIDI instruments are configured for the song.
- Press the B button for Help
Full details on this website: http://chromakinetics.com/midicommander/
Open source CircuitPython & Python on Github at https://github.com/gmeader/pybadge/tree/master/MidiCommander
This is a derivative work of the original SysEx “Librarian” by: kevin@diyelectromusic
https://diyelectromusic.wordpress.com/2022/05/28/raspberry-pi-pico-sysex-librarian/Modified for Adafruit PyGamer with MIDI Featherwing by Glenn Meader
You can get the required hardware: a PyGamer and a MIDI Featherwing for about $50 at adafruit.com The MIDI Featherwing plugs into the back of the PyGamer to provide DIN-5 MIDI jacks.