AI, Firmware, and Existential Questions

You probably already know this: AI makes hand-coding firmware, as well as most everything else requiring a frontal lobe, a thing of the past.

This time: two coding projects that usually meant many hours of firmware frustration fun were accomplished by Claude in a single morning. 

Coding skill? Not needed. Rigorous planning for function and design? Nope. Modest EE skills, even?  Maybe? Probably not.

TLDR?  Sure. The incurious ride shotgun when AI is driving. It's a brave (and stupid) new world. 

This time I go over what the bot came up with, then think about what it all means. 

RANDOM GATE 

The original code--for Arduino Nano and +/- 15V Frac--on Github--is here.  

Original blog post--early in my DiWHY adventure--is here.

Almost no one uses Frac, and I am moving away from older Microchip MCU's, so I used Claude.ai to port the sketch to my favorite 8-bit dirt-cheap MCU, the ATTINY1616.  

I copied the Arduino Nano code into Claude's chatbot, told Claude I was using an ATTINY1616, the ATTINY pins I wanted to use, and told Claude to get busy.

Claude assumed (correctly) that I would use Spence Konde's megaTinyCore for the build's abstraction layer. Literally 127 seconds later: whomps, there it was.  

Get its ATTINY code port here.

I copied the new sketch into Arduino IDE; it compiled without error.  

Next I uploaded the port to the ATTiny1616 experimenter's board (previous post here; PCBWAY community project here) to see if it worked. 


After thorough testing: of course it worked, all of it, no bugs, no problems. We all knew it would. 

The firmware port, start to finish, including testing, took about an hour. 

Amazing!

I then used Kicad 10 to modify the schematic for the Experimenter's Board to accommodate the pins, pots, LED's and jacks needed for a Eurorack version. Schematic and PCB layout can probably also be done (better) with AI, but I don't know how to bring AI to bear for EDA, at least not yet.  


WIFE GATING  

Next up--can I create an entire new project's firmware using AI? Of course.

This next design was inspired by Intelligel's "Tangrams" gate generation subcircuit. If Behringer can rip off Intelligel, why can't I?

Instead of coming up with a functional spec (boring!) I created a WIKI user manual:

 WIFE-GATING: A 6HP Eurorack module akin to dating, marriage, and procreation.

DEFINITIONS

DURATION * CHANCE creates a single “situationship” (I had to call this something….)

DURATION: how long the situationship lasts if CHANCE is set to zero. 

CHANCE: Add or subtract a random amount of time from the DURATION value.  Think in-laws.  

KIDS: Output of the situationship.  In this context it’s a 5V variable length GATE OUT.

MODES

"1 & Done": each BEGIN pulse means a single, entire DURATION + CHANCE situationship, i.e., early dating.  A “kid” is produced--always--sorry Elmo, ya should've been more careful about birth control.

"Remarry": The situationship produces a KID; gate (“kids”) off for another DURATION + CHANCE, then another situationship, producing yet another kid.   

"Alimony": The REMARRY cycle repeated twice

"Mormon" Mode—BEGIN is ignored; Negative CHANCE ignored; Kids (gates at output) are produced forever.

"FAITHFUL" Mode: after BEGIN gate or trig, the wife gating module goes through the entire situationship, regardless of what happens at the BEGIN INPUT.  A new situationship can only begin again after existing has run its course.

"TIGER": BEGIN rising edge always starts everything over.  MORMON mode is ignored (celeb is not MORMON) but not the other modes; if unit is set to MORMON and TIGER you really get a re-triggerable ONE AND DONE just like in real life, plus the module costs 15% more every time you build it.  

KIDS alternates states--one relationship you have a KID, next one you don't, third one you do, and so on. Something like that?

EOC: End of cycle. 200ms trigger is fired at the end of each situationship. Note: mvcl says to rename this "polyamory" because you could plug "EOC" into other units and have several run at once. Maybe, but "EOC" fits better on the panel.

KIDS: What the situationship produces....for synthesizers, a +5V gate out, Elmo. Less work.

To further visualize this I used Kicad to come up with the module's front panel:


....then used ChatGPT to create a photo-realistic image of what the finished build might look like--the fake photo you see below was created from the front panel PNG above, using a single prompt, took about a minute to produce, and impressively, yielded a pretty good representation of what an 8hp Wife Gate might look like.

My psychiatrist wife looked over my shoulder as I wrote this and was not entirely happy. But when I told her "wife gating" is what techs to do send our wives off to have fun while we geek out, she got on board. "As long as I have a credit card" she told me.



W-G FIRMWARE


What next?  For Wife-Gating firmware I jettisoned any language that reflected politics, celebrities and religion, and clarified (in my mind) what I wanted the module to do, kind-of sort-of.

Using Claude Code, I first described wife-gating's "duration" and "chance" features, compiled, and uploaded the nascent code to the ATTINY1616 experimenter's board via Arduino IDE. 




Video for getting Claude Code going is here.

Once that worked--it usually did in 1 or 2 revisions--I added more features, paraphrasing the WIKI into Claude code prompts.

Each time I committed and pushed revisions to Github....the bot made that easy as well....get the code from Github, here.

Going from the WIKI to a what feels like ready-to-use firmware took a few hours; the guy with the Swiss accent has additional fresh idears that could further speed this process (superb video series from Mr. Spiess--using AI to create firmware--begins here). 

How much time would it have taken me to write the W-G's code? Hard to say, but I'd guess a few days. And, reviewing the quality of the code produced, Claude kicked my ass; its comments were clearer, safeguards were better thought out, variables more clearly named. The code looked like a pro wrote it, as opposed to--code written by me.

Here is ChatGPT's idea of what the finished hardware might look like:

The firmware "works" but I am not sure going from WIKI to firmware, without better advance planning, was the best way to do this.


BEFORE PROCEEDING: THE BLOG'S SPONSOR

 


AI or not, you are going to need to create PCB's, enclosure, and panels for your projects. 

You can help out the blog by visiting the sponsor, PCBWAY for your fabrication needs.

In addition to top-shelf PCB fabrication they also do fantastic work with assembly, 3D printing, injection molding, they can fabricate PCBs using full color--details here, and much more. 
 
As always--you can help this blog by checking out the PCBWAY site. Thanks!

DIWHY FIRMWARE IN THE AI AGE 

Let's say my boss tells me to create 100 unique PCB's a day to maximize shareholder profit (albeit the shareholder never seems to be me). 

I get it--as if we weren't working hard enough already: with fantastic AI tools available I see management expecting a lot more output from everyone.

But cranking out more product is not applicable for self-educators. 

I got started with  AudioDiWHY to teach myself electronics and audio fundamentals, which included understanding and getting ahead of coding challenges. 

However, in this new AI era, code learning may be gone for good, at least for many of us. Claude Code  kicks butt too thoroughly, and even the most curious techs will probably not spend 3 days writing code that Claude could write more elegantly in a few minutes.

I still enjoy doing schematic design and PCB layout, but I figure if creating those by hand is not already obsolete, they will be soon. 

Is the future of DiWHY seeing what I can make AI do?  

I hope not, because I don't find bossing around Claude much fun, and when bots assist with projects I may learn next to nothing, except perhaps improving my efficiency vis-a-vis my interactions with AI agents.   

The existential question becomes: once AI fully moves in, do I continue DiWHY at all? 

What is my relationship with this new tech going to look like, really?  Here, and in other facets of my life, technical or otherwise?

I will think about this. 

I'm hanging in there for now--I will get boards fabricated for the Random Gate and Matrimony projects to see how they work. 

If they're turds, fair bet it's my schematic and layout, not the veracity of the bot's firmware. 

ATTINY1616 Experimenters Board

Readers: If you'd like to build the ATTINY1616 experimenter's board featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 10 project/pcb/schematic/library files, a blink sketch, an assembly B.O.M., and more, are here.  

You can also help out this blog immensely by checking out PCBWAY using the link here. Thanks!

======

Quick one this time....gearing up for retirement at my day job, hopefully means I can spend more time with DIWHY.  Short on time I conjured another experimenters' board based on the single-chip ADSR (previous post here; PCBWAY community project here):

5-11-26 version omitted silks calling out the ATTINY1616 pins for the pots..fixed--updates posted to the PCBWAY community page.

 

The idea: I took the one chip ADSR design (again--previous post here), added edge connectors, more power options, and improved silkscreen callouts.

Good Day in the USA, new boards from this blog's faithful sponsor, PCBWAY

 

the SOIC MCU was not difficult to solder by hand....

Then I added the 7805 regulator and the buffer IC and tested. No smoke or shorts. The remaining  components were through-hole because I have bins of them.

Before I wrap up--word from PCBWAY, this blog's friendly sponsor...


Once you've uploaded your firmware, figured out your final designs, and are ready to rock and roll head for PCBWAY and get some prototype PCB's made....They also do great work with 3D printing, assembly and can even act as your OEM. You can support this blog by checking them out--link here--as well as the PCBWAY community (here).   

The board in action:


blink test works....

That's all I have time for for now--I am going to take a break from DIWHY for the next month or two to focus on wrapping up things at my day job, moving my recording studio and workshop (again), and other housekeeping, but I'll be back.

In the meantime I need to think about what to ask AI to code for me. Maybe AI will help me decide what I should ask AI to help me decide? It's a strange new world.

DS1881 Experimenter's Board Part II--Rheostats and an AI Created Library

Readers: If you'd like to build the DS1881/ATTINY1616 experimenter's board featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 10 project/pcb/schematic/library files, a link to github repo with a sample sketch and C++ library for the DS1881, an assembly B.O.M., and more, are here.  

You can also help out this blog immensely by checking out PCBWAY using the link here. Thanks!

===============

I had so much fun with the DS1881--see this previous post--that I made another breadboard-bustin' experimenters' board for this cool digital potentiometer.


"DS1881-as-rheostat expermntr. brd."

The board deviated from the example found on the last page of the DS1881's data sheet: I added an on-board MCU (ATTINY1616) and exposed the IC's potentiometer pins as well as GPIO on the PCB's edge connectors. Gone were the op amp buffers. My idea: see if using the pot's L/W/H (low, wiper, high) pins as a rheostat could yield cool things like I2C controlled active filters.

I also uploaded the DS1881's datasheet into Claude Code and told the bot to create a C++ .h library file for the experimenter's board, something I had never tried before. 

Did it work?

At first--nope. 

Eventually, yes.  

 

THE USELESS BUILD PHOTOS

Jumping right to it....

Double happiness is new PCB's from this blog's patient sponsor: PCBWay!


No smoke yet....

The DS1881's I2C address is configured through hardware. If you build this project jumper or short the 0x28 or 0x29 pins to choose its I2C address.  


For proofs-of-concept I am using MCUs that support UPDI (ATTINY generation 2 and 3) more and more often.  UPDI is super easy--one wire for data and one for ground to blast firmware into the MCU--see the video here. Serial monitoring isn't through USB however--for that I exposed the TX /RX and ground pins on edge connectors which got fed into a NUC Linux PC running minicom.

CLAUDES AND SODS

Normally I would have read, re-read then re-re-read the DS1881's datasheet; over the coarse of a few days create a C library file for it. Not this time--my tech friends told me to get AI lazy.

Fair enough.....I used Claude Code to create a C++ .h driver file for this project:

  • Installed Claude Code
  • Logged in using my Claude account.
  • I created the local directory for the project, cd'd into it then typed claude.
  • Using "browser Claude", I talked the bot through what I was trying to do.
  • The bot helped me create the Claude.MD file, necessary for project sanity, which I saved in the project root directory.
  • I uploaded the DS1881 datasheet PDF into the same directory.  
  • I didn't record the prompts I used for the initial build, but it was something like read the datasheet PDF and create a single .h file C++ library for the DS1881; use Arduino wire for I2C Hardware abstraction, and create an Arduino INO file to sweep each pot from 0db to -60db every 300ms then sweep back from -60db to 0db. 
  • I discovered a free tool to see Claude prompt histories (here) ex-post-facto.
  • This tool works great, but at this point I'm too lazy to dig back through the Claude directories and get you guys the actual prompts. Maybe later.

As already mentioned, the hardware, library, and test sketch didn't work at first. Using a DVM there was no change in resistance between H0/W0, W0/L0, nor the H1/W1,W1/L1 pins.

Meaning: As a rheostat the DS1881 wasn't working.

Begged the question: can the DS1881 be used as a rheostat at all? I thought so, and AI said it should work, but I didn't see a smoking gun in the DS1881's datasheet.

So--to be sure, I emailed Analog Devices, who got right back to me--yes this should work; if I coded my firmware right, I should see resistance values of about 40K to about 4K across H0/W0 or W0/L0 as I swept the DS1881's digital pots using I2C.

However, the DVM always showed about 30K no matter what; it was broken, but why? 

I fired up my logic analyzer:

After years of using cheap, crappy logic analyzers I spent a small fortune upgrading to a saleae. Worth it? Yes, every dime.

The I2C data stream revealed that the DS1881 I2C initialization was working, but after that, nothing--no I2C traffic to sweep the pot's wiper. 

Good news in a way--it meant that I2C was basically working, the MCU recognized the DS1881, but still--the damn thing didn't work. 

Hello?

I reported this observation--initializes OK but no sweep--back to Claude Code. The bot revised the .h file and the ino sketch.  

Took the bot like 5 minutes. Would have taken me a few days.

Uploaded the revised code and .ino into the ATTINY1616 and--it worked.

WAIT! FROM THIS BLOG'S SPONSOR:

 


....why bother breadboarding when you can throw your ideas into Kicad, gerber-a-roni, ship them off to PCBWAY, and get 5 or 10 boards back to mess with. 

That's what I did here and overall: a huge timesaver. No messing with SMD to THT adapters. No junky dupont cables breaking. No being off by one 100 mil pin and frying your expensive IC. 

PCBWAY is super fast and their prices are so affordable breadboarding sometimes makes little to no sense. 


Just say no to breadboard spaghetti!


In addition to top-shelf PCB fabrication they also do great work with assembly, 3D printing, injection molding, and much more. 

More experimenter's boards to come in future posts. 

OK, back to it.

NOW WHAT, DR. SHANNON?

No photos, but I breadboarded a few circuit ideas using the rheostat--voltage dividers, op amp gain, an active filter--using the exposed DS1881 pot pins.  

I could type on and on about this, but I'll spare all of us all a lot of time: to me, there was nothing I could come up with using the DS1881 as a rheostat that I couldn't do more efficiently with more "traditional" voltage or current controlled variable resistors like OTA's or Vactrols.

The DS1881 shines doing what it was designed to do--an I2C controlled stereo attenuator with a nice sounding log curve and a anti-click algorithm baked in its hardware. 

Beyond that, not so sure.

I think that's where I will leave things this time before the DS al.....


CLAUDE CODA

Along with my hero, Bob Widlar, Claude Shannon ("Claude") was a brilliant and colorful tech. Fascinating guy....Wikipedia here.

Reviewing Claude's Code: the library looked a lot more professional and succinct vs. what I would have coded by hand, employing extensive bitmasks, many more #defines than I would have used, and everything else C++ that drives me nuts.  

I need to test each method, but haven't yet. Claude Code makes me feel--lazy.

Good enough? 

The AI's output made me realize that I suck at Boolean Algebra so I went back into Claude Code and had the bot whip up a Python/UV learning tool that (hopefully) will help me master bitwise statements in C and C++ some day.

This Python script was created with a single prompt--no revisions:

I need to learn bitwise operations in C and C++. This includes &, |, XOR, |=, ~= example statements like uint8_t commandByte = reg | (value & WIPER_VALUE_MASK); the learning tool should allow me to use single bytes (8 bits) and perform bitwise operations on them. Write a program in Python to help me learn the syntax of these C and C++ calls. Data entry and what is shown as the final output should entered and shown as Hex (0x04 for example) and bits (0b00001111)

The output came out better than I expected--it does a lot more than I would have thought necessary, and maybe is even fun to mess around with.   

Get the bitwise learning tool from github, here. Get UV here. Get stoopid here. We're cooking with oil. 

I'll admit it--Claude is smarter than I am, maybe some day I will catch up?  

Nope. 

See ya next time.

The Road Ahead

Hello again. I recently took up boxing and injured both wrists making me unable to type, work at the bench efficiently, or play musical instruments. These are a few of my favorite things..... Bummer!


I thought I’d use this downtime to (literally) record ideas I have for upcoming projects. 

Then augment this post in coming weeks and months as untyped content aka SPTKTO, aka a Single Place To Keep Things Organized.

If this post reads like I’m talking into a mic it’s because I am--the illustrations in this post were created with AI but my prose never will be.

Control/Alt/Delete?

First things first--on my Windows 11 system how do I make Voice dictation work--remember: for now I can’t type....

 

Is voice dictation in Windows 11 included for free? Nothing in Windows 11 is included for free.

After getting the internal microphone for my W11 computer working, I said into the mic “voice access wake up” and Windows took me through a quick wizard; surprisingly it worked right after that. 

To toggle the dictation feature off and on I clicked on the mic icon at the top left of my main screen: 



To kill the feature entirely I right clicked on the main Windows icon then Settings > Accessibility > Speech > Voice access:



I read online that the "Windows Key" plus H also turns voice dictation on and off. Oddly, I could not get this feature to work on two different Windows 11 machines. Tried to fix: many steps here, here, here, and here (and here as well as here).

After all this and several reboots one of the two started to work vis-a-vis this feature; now I can toggle voice dictation on and off with Windows key + H. 

What fixed it? 

Turns out to make Win + H work, you have to turn voice access (the button shown in the screenshot above) OFF.  

This is because Windows has 2 competing systems for this: "voice access" and "voice typing" and one clobbers the other. Yeh, I knew this--ChatGPT didn't help, it led me down a path of nonsense ("the longer it takes the more this guy makes") and the many links above didn't mention it? they all did, and I missed them? Whatever--time wasted--about 1 hour.

Overall, Window's ability to accurately transcribe voice worked surprisingly well but The Windows Plus H issue drove me nuts. 


Shut up and list the audio projects!

OK! A recent post (here) centered on Analog Devices/Dallas' DS1881. 

This is a super-cool digital potentiometer with musical sounding attenuation and a built-in hardware anti-click algorithm.

As an audio attenuator it works great, but I have other ideas for this interesting chip--using it perhaps as a rheostat, for MCU programmable variable gain using an op amp, in all-pass filters, and/or as the basis for a perennial favorite: analog multiplication. 

My always-patient and always-enthusiastic sponsor, PCBWAY, have already fabricated a never-ever-breadboard-again PCB for future rheostat experimentation. 

Meaning: a post about the rheostat application is coming when I can solder again and vet that the board doesn't turn into charcoal. Stay tuned.

 SBC's





Recently posted--using single board computers ("SBC’s") as the basis for new AudioDiWHY projects--series starts here. 

I need to flesh out the quadrature LFO--go here; code sample is at the very bottom of the post.

Another: a CV And MIDI based quantizer using an SBC running a web-based graphical user interface to set scales and ranges. Also add voice activation? Why not. For the web piece I'll probably use an RPi Zero running Flask; see the post here. For voice recognition maybe an Arduino BLE 33 and Tensorflow Lite.   

And: an extremely accurate bench clock using GPS and a Raspberry Pi--from some quick research I should be able to get gazillion dollar clock performance for absolute minimal dough going this route. 

But--all I have so far is the stupid AI illustration you see above and this link from SBC mensch Jeff Geerling.

Meaning: overall...."miles to go before I geek."

DEE-ES-PEE?


Any primate can write DSP Code with a $200/month Claude Subscription. But what about the layoffs?

My interest in learning digital signal processing never sleeps. 

I created simple proofs-of-concept using Python (here) but (doh!) I have a complete sh*t-ton more to learn. 

A scary smart tech "Borogrove" in my audio Discord group turned me on to a freely-available PDF that will motorize this pursuit: Hal Chamberlin's "The Musical Applications of Micro Processors"; find it online: here .

The book covers (along with other extremely useful topics) DSP basics that are spot-on for what we do-- not overloaded with math; containing examples (this is an old book--code fragments are written in  BASIC!!) that are reasonably easy to follow. Borogrove leveraged the book's code samples to create a professional sounding -24db per octave low pass VCF he brought to a recent meeting.

7-25-26 update--the YT vid here is first in a series where the content creator does basic DSP proofs-of- concept with an RP2350/Pico2 and some popular breakout boards. He includes C code and schematics. I have some Pico2's and both breakout boards in my junk box and would like to breadboard or better yet, create a PCB for experimentation based on his videos--but when Scotty, when?

STRING SYNTH?


 


Another: creating an analog string synthesizer based on top octave generation, frequency dividers, and some sort of mega-attenuator (probably based on aforementioned DS1881's). 

For the project the super-talented TJimmyChonga from the BAM Discord group created working C++ firmware for an RP2040-based top octave generator and shared it with me--TJimmy's DIY kung fu is stunning!

Using that I breadboarded a TOG, frequency dividers, and ASR envelope control, creating a few working Solina notes on the bench. However, I’m not happy with the sonic results-- Nothing to post yet. The work continues.

BAAH-RINGER?

If Behringer can rip these guys off why can't I?

In the same Discord group meetup: Tjimmy, Elton from Otter mods and I discussed jettisoning some of our commercially available recording and electronic music hardware and replacing it with prototypes we design and build. Time-wise this is an extremely bad idea but sounds like a challenge and maybe even a lot of fun. 

For me: low hanging fruit are modules like my intellijel dual ADSR. I figure the basis of this will be the one-chip ADSR described in the post here--who knows.

Roland's amazing JP8 was designed by some of the greatest audio engineers of all time. If they are the big leagues can I swing in Single-A? 

As long as we are jettisoning months of our lives--how about a programmable single- or dual-voice PCB that can be expanded into an 8-voice polyphonic synthesizer. So reverse engineering something like a Jupiter 8 or Prophet T8. Why not--??

STOMPS



It’s been a long time, but many years ago I had fun making guitar pedals that sounded good but broke the first time I gigged with them. I might start building them again (my fab skills have improved a lot since 2002) to try to toughen them up.

ARTIFICIAL INSUFFERANCE


Of course: the 800-pound gorillas in the room. Ever-useful, ever-terrifying, ever-potentially-economy-busting AI tech has already changed every aspect of my 9 to 5 job. Actually it’s more like my 24 x 7 x 365 job where the VIP's let me screw around with electronics when they don't need me screwing around with AI.

How to best incorporate AI into DiWHY? And! How can I not have pages and pages of Di-AI-WHY ideas already? 

Other than speeding creation of assembly BOMS and invoking sometimes-accurate-often-not OpenAI chats about electronics fundamentals, I'm coming up empty--figure I might wake up in the middle of night with something brilliant but so far: AI, for me anyway, is InfoTech automation 1000, AudioDiWHY 2.

A PLUG FROM URANUS--THIS BLOG'S SPONSOR: PCBWAY!

PCBWAY Community's servers are not in orbit (yet). Still--super cool. Check 'em out here.

Once ideas are off the drawing board I’ll need prototypes made; for that of course I go straight to this blog's wonderful sponsor: PCBWAY.

My work can, at times, be e-waste fodder, sometimes even burning up on re-entry, but PCBWAY's work is always stellar!! 

You can greatly help this blog by checking them out--using the link here.

OUTTRO

Enough for now, hopefully when my wrists are better I will start building things again.

Until later--don't spend all your tokens on one ride. See you next time.

DS1881--Clickless Dual Digital Attenuator--Experimenter's Board--Amazing IC!

Readers: If you'd like to build the DS1881 experimenter's board featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 10 project/pcb/schematic/library files, a link to github repo with Proof of Concept sketches, an assembly B.O.M., and more, are here.  

You can also help out this blog immensely by checking out PCBWAY using the link here. Thanks!

=============

 Hello again!

I've breadboarded digital potentiometers before, only to find they make an ugly, audible "click" when changing resistance values when used in 30hz-20Khz AC circuits.

I recently stumbled upon an IC that purportedly does away with the click--Analog Device's DS1881--dual pots, I2C, log response--everything needed for an MCU controlled audio attenuator--but also sporting onboard hardware to detect AC zero crossings (like an old Akai sampler?) and change its resistance values quietly.

TLDR: Does the DS1881 work as advertised? Yep. 

Datasheet here.   





PCB DESIGN

"Not this post's project"

Instead of breadboarding (I hate breadboarding) I created a simple DS1881 experimenter's board, used an Arduino UNO4 to generate the necessary I2C calls and vibe coded test sketches to create proofs of concept.

AI was a huge help: coding the test sketches. But also at times a burden: the DS1881 was producing audible clicks when it shouldn't have--in the end the many of the bot's answers were nonsense, leading me down a lot of dead ends. See the "How did it Sound" section below.  

The circuit fragment for the experimenters' PCB was stolen from the DS1881 datasheet; my test PCB offers additional circuit protection.


The  PCB:




For the op amps I used an MCP6004--DIP version--I had a whole tube of them.  

It's a rail-to-rail quad op amp, affordable and easy to use, but can only withstand 6VDC max at its rails and only a bit more at inverting and non-inverting inputs without blowing up. The MCP6004 buffers the incoming signal (I also added schottky diodes) to clamp AC input signals to about 0-5V.

I had an extra op amp stage I inverted and cap coupled one of the outputs.

Power can be from wirepads ("PWR-IN") or from a Eurorack style power 2x5 100 mil header (warning: don't put power to both).  

PWR-OUT  is +5 from the regulator, added as a test point.

Audio ins and outs are on the top left "EYE-OH" 100mil edge pins; from the top: 

  • output for channel 1, 2.5V DC offset 
  • output for channel 0, Cap coupled
  • output for channel 0, 2.5V DC offset
  • input 1: used 4V P/P with 2V offset (worked for me--you might want to experiment with P/P and DC offsets)
  • input 0: ditto but for input 0.

For the 12V to 5V step down, I accommodated both a 7805 regulator and a low dropout, more "modern" choice: SOT-23-5 LP2895. If you build this board, please use one regulator or the other--don't use both!

USELESS BUILD PHOTOS

Always: happiness is new PCB's from this blog's patient sponsor, PCBWAY.


I used both THT and SMD for the project. Many of projects use whatever parts I have on hand, but I include Kicad files when I post. Get the Kicad files (here) and modify them if you want.

.........built a bit of it, powered it up, and saw if there was a short. In this case, no short (yet).  Kept going.





Still no short! I had an ancient UNO-R3 I use only for getting I2C addresses (code here). Worked. Default with A0-1-2 pins grounded--I2C address for 1881 is 0x28.


I used an Arduino R4 for the rest of it--worked well for getting I2C firmware into the test board quickly, then seeing serial output through the Arduino IDE.

Good to go: used a Siglent function generator for the test waves (4V P/P with a 2V DC offset) and a Eurorack patch cable to the bench BT mixer (here) to hear output. Get the Coax to whatever boards here and here.

THE SKETCHES

Get them from Github: here.  

AD's I2C implementation for the DS1881 was simple; I vibe coded then debugged/modified the code--fast, fast, fast. The days of coding every line of anything are gone for good.

For each .ino file you may need to drag the .ino into a new folder you create with the same name.

Simple stuff: experiment, vibe code additional features, and have fun:
  • DS1881-diag.ino Run this first, the basic g/no go tool for the experimenter's board. Reveals if I2C can reach the DS1881, tells you via RS232 the IC's I2C address, does basic reads and writes to the DS1881's registers. Nothing for you to enter into serial monitor; the serial monitor's output tells you if your build works or not.
  • DS1881-enter-db-attenuation-value.ino. Entering a value 0 to 64 in serial monitor attenuates 0 and 1 channels by said DB.
  • DS1886-30ms-steps-100ms-hold.ino  Rapid attenuation followed by gain increase for both channels. So, a poor man's tremolo. I wanted to see if fast fades caused clicking--so far, none heard. Suggestion: Mess with the ms values in the sketch to experiment with how fast I2C can control the pots and see what sounds good to you.
  • DS1886-choose-zero-cross.ino The DS1881 fades inputs to -64db then the signal is gradually brought back to unity. Enter z into the serial terminal to toggle on and off the de-clicking algo inside the chip. This will give you a rough idea of how the DS1881 will sound vs. a digital pot that does not have a zero cross detection algorithm built-in.  

HOW DID IT SOUND?

At first--crappy.....no matter what I did I heard clicks. Hello? The main idea for the DS1881: no clicks.  

Plugging everything into Claude, using every prompt I could think of, and adding the DS1881 datasheet to Claude.ai's RAG (Resource Augmented Gooberfication?), whatever, the chatbot told me that the audible clicks were just the way the DS1881 operated and, like a bad marriage, I should just live with it.  

Did that sound right?

I took the project to my local group meetup--everyone meant well as always, but as far as a fix, no one (including me) had any idea why the DS1881 was clicking no matter what, I just got puzzled looks.  

Driving home it dawned on me--what if I set up the input signal at the wrong DC bias? Electronics is the same as US politics: always suspect stupidity. 

Went back to the bench and sure enough, I was not adding a 2V DC bias offset to the test input signal.  The datasheet clearly indicated that a bias offset was needed, but no, I blew it, which was confusing the hell out of the DS1881's anti-click algorithm, the chatbot, and me.



I added a 2VDC offset and the IC worked--perfectly--no click, nice natural sounding butter-smooth fades, quick moves from -6 db to -60 db to whatever than back to mute--all without any distortion, clicks, clacks, or unwanted cross-tweeze. Musical.  

Plugged this fix back into the LLM and it sort of said "oh yeh, my bad" when really it was my bad. Which is better, I guess, then a chatbot scolding me for being stupid.  



THE SHAMELESS PROMO


Quick word from this blog's sponsor! Once you have your design laid out, and want to see if it runs or is a smoking turd, RUN don't walk, to PCBWAY and get some prototype PCB's made....They also do great work with 3D printing, assembly and can even act as your OEM. You can support this blog by checking them out--link here--as well as the PCBWAY community (here).  And--best of all! for support you always get a friendly human, not a bot. Yes, it still can happen!


WHAT'S NEXT?


I am having a rev-2 experimenter's board fabricated as I write this. It allows the DS1881's two channels to be used as MCU controllable rheostats. 

I am not quite sure what I'd use that for, or if it will work at all, but that's the great thing about DiWHY in an era where small quantities of PCB's are available quickly and for little money; try it out, see what happens. 

Assuming I can get something useful out of this 2nd revision: it will show up in a future post, for sure, for sure. Update 8-15-26: posted; here.

See ya next time.