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.
-
Pinned by CGrover
Building a Sci-Fi Movie Prop
Overview
A local production company is working on filming the first of a three-part sci-fi movie and needed a piece of scientific equipment for a laboratory scene. The executive producer/director found an obsolete flow cytometer analyzer in a government surplus sale, winning the bid for US$12. The device had the potential to look like a working DNA synthesizer with the addition of lighting and a bit of animation.
In its day, the analyzer was a high-quality device that was robustly built to provide exceptional mechanical stability for its sensitive optical components. It was therefore quite heavy in spite of its size, requiring at least two persons to lift and position, which would increase the challenge to modify for use in the film. It was not a typical theatrical prop made from foam and balsa wood, for certain.
I was tasked with installing color lighting to enhance the device’s operational appearance for its brief appearance on-screen. To achieve this, I devised a plan to incorporate several NeoPixel LED strips, which would be controlled by a CircuitPython-based microcontroller, such as the Adafruit M4 Express Feather. The multi-colored NeoPixel LEDs could be strategically positioned both within and outside the device, thereby providing ambient illumination and symbolizing various functions, including sample loading and the incubation process.
Given that the initial device employed industrial-grade servos (specifically, three IMS MDI-17 Drive Plus Motion Control motors) for sample positioning and operating the sample fluid “sipper” needle, there was a preliminary aspiration to incorporate robotic physical movements beyond the lighting sequence. However, this objective was deferred due to the imminent project deadline, so a short puppetry cable would likely be attached to the sample positioning cam to animate movement of the test tube rack.
-
WaveStore: Create a Library of synthio Voices
The arbitrary waveform capability along with ADSR envelopes and filters has made it very easy to create custom musical voices with CircuitPython synthio. And if you use an additive synthesis tool like WaveBuilder, you'll begin to quickly amass quite a few custom musical voices as you experiment with the nearly infinite number of oscillator combinations.
Hearing Voices
Up to this point, I've been keeping track of the numeric specifications for WaveBuilder oscillators and synthio.Envelopes in project code or scribbled on a note pad. That means that when building a new project that needs to use a previously created voice, I'll cut and paste the voice definition code into the new project. The process works, but isn't ideal. What if a synthio musical voice could be loaded from a collection in a file folder, kind of like working with a font file?
So a concept for the WaveStore project began to develop. Here are the initial requirements.
- Library File Management -- We'll make it easy at first and just work with a collection stored on an SD card. No need to tax the brain to conjure up a way to write to the CircuitPython root directory just yet. After creating and storing a voice to a file, we'll manually copy the files from the SD card in order to use and share between projects.
- Files -- In the spirit of keeping it simple, only files representing waveforms and envelopes will be created. Those objects form the fundamental elements of a musical voice. Perhaps we can add filters and other effects later.
-
Library File Names -- Waveforms will be stored in a standard wave file with a
.wavextension, thanks to the awesome Adafruit_CircuitPython_Wave library. Envelopes and filters definitions will be stored in plain text files with.adsrand.fltrextensions but will transform to synthio.Envelope and synthio.BiQuad objects when retrieved. - Icons -- Imagine being able to select a musical voice waveform or envelope by touching a screen icon. Functions will be provided to save and retrieve bitmap images of waveforms and envelopes as well as capturing the contents of an entire screen. We'll start with 64x64 pixel bitmaps created by WaveViz. A graphical frequency response representation of a bi-quad filter's coefficients is in the works but is a bit beyond today's skillset. There's a potential workaround, but I'd rather derive it directly from the numbers. Hoping for an epiphany soon.
In the future, more features will likely be added to WaveStore such as support for filters and on-screen icon buttons -- as my experience and Python skill set grows. What would you add?
Enter WaveStore
WaveStore is under development but is available for testing. The current alpha version of the WaveStore class provides the following helpers:
- Wavetables
- read_wavetable -- Read a
.wavfile and return a memory view object. - read_wavetable_ulab -- Read a
.wavfile and return a ulab.numpy array object. The ulab array can be mixed with other wavetable array files. - write_wavetable -- Format a wavetable and write it as a standard
.wavfile.
- read_wavetable -- Read a
- Envelopes
- read_envelope -- Read an
.adsrfile and return a synthio.Envelope object. - write_envelope -- Write a text interpretation of a synthio.Envelope object to an
.adsrfile.
- read_envelope -- Read an
- Bitmaps
- read_bitmap -- Read a
.bmpfile and return the bitmap as a TileGrid object that can be added to a displayio.Group object. - write_bitmap -- Write a bitmap image to a
.bmpfile. - write_screen -- Write the screen contents to a
.bmpfile on the SD card.
- read_bitmap -- Read a
- Utilities
- get_catalog -- Returns a list of files in a specified folder.
-
WaveBuilder: Construct a synthio Wave Table from a List of Oscillators
A study to produce a CircuitPython helper library to construct a synthio.waveform wave table object from a list of fundamental and overtone frequencies, amplitudes, and wave shapes (sine, square, triangle, saw, noise).
The WaveBuilder class currently resides in its GitHub repository and can be found in the CircuitPython Community Bundle. The update utility circup can also be used to install cedargrove_wavebuilder.
The objective was simple. Create a realistic approximation of a wind chime sound. Use synthio to stack up a collection of sine wave Note objects starting with the fundamental frequency and mix in a few unique overtones, each with its appropriate volume level. Use the same ADSR envelope for all notes and voilà, we've got a pretty good chime sound. That worked nicely. Let's try to synthesize another voice.
-
SevenSeg: Create an Instrumentation Vibe for Displayio
SevenSeg is a CircuitPython displayio -compatible collection of four ultra-compact monospaced
.bdffonts that mimic the look of a seven segment LED display. To keep the font file size small, only the numeric characters that a seven-segment display can represent are included in the font, including uppercase and lowercase hexadecimal. Okay -- there are a couple of other useful things in there, too.Supported characters:
+ - . 0 1 2 3 4 5 6 7 8 9 : A B C D E F _ a b c d e f °
SevenSeg Font GitHub repository
-
Broken Motion: Replace a PIR Detector Lens
The solar-powered security light spent many years in the sun, charging its batteries to protect from the darkness. It is highly valued for its reliable and selfless vigilance. The unit is completely self-contained and requires no electrical wiring. It was perfect for temporarily replacing wired security lights when they were disconnected during a recent house remodeling project. The solar light also spent time strapped to a tree to surprise nocturnal raiders in the garden.
Of course, to work at its peak, the solar charger needs at least 6 hours of direct sunlight to prepare for the next nighttime watch. But after 15 or more years in the sun, the plastic enclosure became yellowed by UV light. That should be an easy fix: apply some masking tape to the passive infrared (PIR) detector lens, LED flood array, and solar cell, then spray on a couple of coats of glossy white paint. All went well until the PIR detector lens was touched. It was very brittle and disintegrated into Fresnel dust.
Sadly, I figured that the lens was unique and manufactured specifically for the PIR detector enclosure of that old light and couldn't be replaced. Oh well, since it was working before, the unit could at least be kept for spare parts.
The Lens is Indeed Unique
The usually flexible frosted plastic detector lens is pretty special. It doesn't just protect the electronics and optics from the weather, it also concentrates and directs IR energy onto the internal thermopile sensor using a custom pattern of refracting grooves (a Fresnel pattern) molded onto one side of the thin plastic. The lens pattern provides greater sensitivity for detecting movement than would be possible through a clear window, increasing the range from 1 meter to almost 15 meters. The lens also concentrates the field-of-view to approximately 120 degrees.
-
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.
-
An Almost Free Non-Destructive Soldering Jig
I just couldn't bring myself to use the standard practice of soldering pins onto breakout boards using a solderless breadboard in spite of the recommendations and endorsements of some famous solder artists. I would cringe thinking that the heat would eventually warp the plastic portion of the board. It is a solderless breadboard after all.
Fortunately, after placing many Adafruit orders over the years, I had build up quite a collection of free half-sized Perma-Proto breadboards. The solution for creating a non-destructive soldering jig became obvious. Stack four Perma-Proto PCBs together, use a couple of M3 nylon screws and nuts, and place some rubber feet on the bottom. Voilà!
Sadly, the Perma-Proto board is no longer offered as a free product promotion. That's okay; I still have enough in the inventory for many future projects. And coasters. I have coasters.
-
PaletteFader
A CircuitPython Community Bundle color palette and list brightness setter and normalizer tool.
PaletteFader is a CircuitPython helper class for brightness-adjusting color lists and displayio palettes. Normalization is optionally applied to the palette prior to brightness and gamma adjustments. Transparency index values are preserved and associated with the adjusted palette. Creates an adjusted displayio color palette object (
displayio.Palette) property that can also be read as a color list.
-
Ibanez FL9 Service Guide
The Ibanez FL9 Flanger Service Guide was compiled from a collection of original and obsolete information to create a useful guide for maintaining this unique guitar pedal. Credit must be given to the authors of the original 1980s era Service Manual NO. 002 that was used as a template for this updated guide.
November 26, 2022, Cedar Grove Studios
The .pdf version of the guide and detailed repair blog can be downloaded from the project repository:
FL9 Detailed Repair Blog (.pdf)
Also available is a KiCAD folder of the as-built PCB design, contained in the project repository:
FL9 PCB Reverse Engineered Design (KiCAD folder)
-
Wind Chime Repair
We live in a breezy area that abuses flags, wind socks, and our patio garden wind chime collection. To keep the collection of wind chimes working, we are always looking for better materials for the annual chime repair ritual.
We recently ditched the UV-resistant nylon fishing line that was usually used for repairs. Despite the UV rating, the nylon line would decay in the sun after a few months. We tried something new (to us) this season; replaced the nylon line with 1/32” stainless steel cable and aluminum crimp ferrules. We're expecting it to stay strong and last a great deal longer.
For lightweight loads such as the hangers for individual chime tubes, the ferrules were sliced in half with a utility knife. The cable was cut to length and ferrules were crimped in place using a ratcheting crimping pliers' 28AWG die. The crimping pliers (Adafruit PID#1213) have a combination die for 28AWG, so only the larger portion of the die was used. Crimping pliers designed specifically for this purpose are available.
Stainless steel cable and ferrules from Amazon
An heirloom Harry and David “Pear” 6-note chime from the early 1970s.
(plexiglas sail, striker, and tube spider with brass chain suspension and brass cotter pins; top-hung galvanized steel metric EMT tubes with cable "W" mounts and stainless cable suspension; F#5, G#5, B5, C6, E6, G6 tuning)
-
MatrixPortal Board Twister (HUB75 Adapter)
Requirement: Place an RGB display panel with an attached MatrixPortal in a shadow box.
Problem: The MatrixPortal sticks out.
Solution: Spin it around with a custom OSHPark AfterDark board.The panel connector is a 2-row by 10-pin header (0.1-inch) with the top two and bottom two pins removed. The bottom spacer is M2.5 12mm with a screw added to provide another 1mm depth.