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!
-
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. -
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:
-
12-Panel Matrix Portal Display How many matrix panels can you use with the Matrix Portal S3? Theoretically, around 50, however the more panels you add the greater the travel distance and signal degradation. Degraded signals can have effects of pixel artifacts/glitching and visible scan lines that are very hard on the eyes.
The bit depth (amount of possible colors) is also very important. 12 panels cannot stream more than a bit depth of 4 without significant artifacts. Normally with Circuit Python, images are 8-bit indexed BMP's but matrix panels can only display a maximum of 6-bit color. A TFT can support up to 24-bit so do not make the mistake of treating a matrix display like a TFT. It will still process 8-bit indexed BMP's with some image quality loss due to the nature of RGB LED's in a matrix panel.
For this project I'm using 12x 5mm pitch matrix panels. The pitch denotes the physical distance between pixels. A 3mm pitch panel will be much smaller physically than a 6mm pitch for example.
Panel Arrangement
The serpentine arrangement of the panels matters. If you get it wrong you'll end up re-arranging the entire matrix until you get it right. The RGB Matrix library expects the controller (Matrix Portal S3) to be in the top right of any arrangement regardless of post-processing rotation in the code. The library expects each 2nd row to have the panels flipped 180 degrees as shown below. You can have each row or column with as many panels as you want so long as the rules of the serpentine arrangement are adhered to.
-
I turned the Raspberry Pi 400 into a Fallout-style terminal! I'm almost ashamed to admit I had a Raspberry Pi 400 that went unappreciated for the longest time. My Dad got it for me as a gift, and it was sitting in a box of spare parts for months. Once I finally got to open it up and take a good look at it, I really wanted to do something cool with it. The Pi 400 was great enough by itself, having a built-in keyboard which you would only need to add a monitor to have a complete computer setup. However, I wanted to have an "all-in-one" setup, with even less wires to plug in. And since I was in a "Fallout" kinda mood, having recently watched the TV series and played one of their games, I decided to model this all-in-one casing based off of the terminal featured in the Fallout game series.
The general idea was to build a plastic casing to house all the pieces, and extend the Pi 400's ports with panel mount cables. First things first, I needed a monitor. It took me a while to find a monitor that I liked, but in the end, the one pictured above was what I settled on. However, I realized much too late that the monitor in question turned out to be a 12V monitor, and I was trying to have all the pieces be consistently 5V. I needed to adapt my strategy if I wanted to have a system powered by only one adapter. So, I bought a power adapter that output 12V and 5A, which I would use to power the monitor first, then bring the remaining power down to 5V via a buck converter.
-
Generate rainbow colour/color sequence using ChatGPT Just stumbled upon this again over the weekend (I'd seen it before once, but never used it). It's the Randomizer service in Adafruit IO, which offers random words, colours, numbers, or entries from a list. See more here (if you're signed in), and you access the values via MQTT or the HTTP API (instructions on the page).
Anyway, while fantasising about data (specifically how long could my list of values be in randomizer), my mind got caught in rainbow colour sequences, and here we are...
I wanted to insert a long list of items, and thought that's the perfect use for ChatGPT, monotonous lists. It's especially good at understanding simple instructions, although I usually find I need to refine my initial request/prompt.
" generate me a rainbow sequence of colours, hash prefixed and comma separated. the sequence should effectively loop if repeated."
It failed to intuit (I never said), that I wanted a long sequence, and instead offered me the 7 colours of the rainbow in a list.
Realising my error, of implicit assumed knowledge, I added an extra phrase to clarify my desire:
"generate me a rainbow sequence of colours, hash prefixed and comma separated. the sequence should effectively loop if repeated. Give me a 100 value transition through the colour spectrum
And there we have it, a nice colour sequence, which I then increased to 256 items. Communication is key, and not easy, or at least it is easy to make grave assumptions and inadvertently mess-up.
100 Items:
Extension Project - Questionably useful things
The last thing to add is that ChatGPT fails in many places/ways, but it's always interesting to test, so I went further and tried to get it to colour-correct the values in the list, based on the human perception of some colours being better than others, along with the issue of RGB lights having different strengths in each colour, then while writing this I also remembered I'd not clarified the rgb issue enough as the individual coloured LEDs are fine at higher brightness's.
What I found most interesting was after the last clarification (but the second query mentioning RGBW LEDs) it offered me colour hex values including a fourth white component, which is actually what I'd originally questioned if I'd wanted all along...
For posterity I've included it all in collapsible sections, so I suggest you collapse them all and use the last one, but read them by all means! My questions/prompts are in bold (title of collapsible), and ChatGPT is the collapsible content:
-
The Feather Isolator: A Hardware Troubleshooting Device When troubleshooting serial bus communications like I2C, UART, or SPI, it can be handy to disconnect a chip select or data line to isolate external devices. Once isolated, the data can be viewed on a logic analyzer or oscilloscope to determine if the SPI or UART signal outputs are really connected to inputs or when examining the effects of multiple pull-up resistors on I2C. The Feather Isolator was designed to individually disconnect a Feather's pin with a switch to help with the troubleshooting effort.
-
Digital / RGB-666 Moon Clock I wanted a clock that would display the time in large yellow characters and display the week and day. For fun added a 60 RGB neo-pixel ring to tick off the seconds.
The last part was to display the phase of the moon in a fun way and found these to be entertaining.
I cut a sheet of plex-glass to 8x11 sheet. I used miniature self-tapping screws to mount the RGB neo-pixel ring. I used this same kind of screws to mount the 4-digit display and two of the Quad Alphanumerica Displays.
I drill large enough holes to plug the displays up to the Adafruit Qualia ESP32-S3 and daisy chained the rest.
I did solder 3 wires to the RGB neo-pixel ring a crimped a 3-pin connector on the other and plugged it in socket A0.
I used Photopea to create a 3x3 of the moon phases I found on the internet. For the new moon phase I copied the full moon phase and changed its color from yellow to blue. and its a seperate .bmp file.
I am not a very good coder anymore and new to python. I am sure there are better coders out there than me for sure. I hacked most of the code from other projects.
Parts Required for this project:
- Adafruit Qualia ESP32-S3 for TTL RGB-666 Displays (PI - 5800
- Round RGB TTL TFT Display -2.1" (PI - 5806)
- NeoPixel 1/4 60 Ring 5050 RGB LED w/Integrated Drivers (PI -1768)
- Quad Alphanumerica Display - Blue 0.54" Digits w/ I2C Backpack - Stemma QT / Qwiic (PI 1912)
- Assembled Adafruit 0.56: 4-Digit 7 Segment Display -w/ I2c Backpack QT - Yellow (PI 5602)
- Stemma QT JST SH 4-Pin Cable (50mm & 100mm)
-
Storing & Graphing IoT Data With PostgREST Overview
This page aims to illustrate and document how you can use PostgreSQL and PostgREST to store and access data generated by sensors connected to micro-controllers or other IoT devices. Before we dive in, I'll introduce the projects and utilities that we'll be using:
- PostgreSQL - A widely used, open source database system. It's very extensible and has many plugs and other utilities built "on top" of it. Client applications connect to it via a network port and send SQL commands to create, read, update, and delete data.
- PostgREST - A standalone web server that turns your PostgreSQL database directly into a RESTful API. The structural constraints and permissions in the database determine the API endpoints and operations. This web server allows us to create, update and access our data with HTTP requests from micro-controllers and other endpoints.
- NGINX - A widely used web server with reverse proxy, load balancing, and many other capabilities. This project will use it to host static HTML and JS files that can be viewed in a browser. It is good practice to use Apache or NGINX as a reverse proxy "in front" of other web server utilities like PostgREST.
- ApexCharts - A Javascript library for making charts and graphs. We'll use this to graph data that we read out of our database.
Setup PostgreSQL
Method 1: Docker
The official PostgREST tutorial skips the full PostgreSQL setup opting instead for a quick / easy setup running inside of a Docker container. If you already have or are familiar with Docker then this route is quite straight forward. The following command will create and launch a PSQL container:
-
SocketPoolLogger Have you ever needed to troubleshoot why you are having issues with your MCU and the internet? Ever been curious how internet requests work? Well this might get you a little closer.
Introducing: SocketPoolLogger
What is
SocketPoolLogger
? it's a little class, that allows you to log everything that happens with a socket.And instead of the normal message we get from the
response.text
, we get all of this: -
Recreating Disabled Adafruit IO Feeds - after resubscribing/mistakes This will delete and recreate all feeds that are disabled, except those that are part of WipperSnapper devices (you can now export those and then delete the device and re-import the exported JSON file).
You'll need the adafruit-io python library, which is normally installed with this command:
pip install adafruit-io
However I've modified the adafruit-io library to add the enabled flag, and it's not released yet so for now you'll want the following command instead:
pip install git+https://github.com/adafruit/Adafruit_IO_Python.git#add-enabled-attribute
Here's the script: