AI, Relationships, Modular Synthesis, and an Existential Question

As I'm sure you know by now: AI makes writing firmware, as well as most anything requiring a frontal lobe, obsolete.

This time: two projects that would have meant many hours of firmware frustration fun were accomplished by Claude in less than a morning. 

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

It's a brave (and stupid) new world.

Let's go over what the bot came up with. 

TLDR?  Sure. that comes with AI as well. 

RANDOM GATE: 

You can find the original code--for Arduino Nano and +/- 15V Frac--on Github--here.  Original post is here.

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

I copied the original code into Claude's chatbot, told it I was using ATTINY1616, along with the ATTINY pins I wanted to use, and told the bot to get busy.

Claude assumed (correctly) that I was using Spence Konde's megaTinyCore for the abstraction layer and literally 127 seconds later: whomps, there it was.  

Get the ATTINY code port here.

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

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


After thorough testing: indeed, it all worked, no bugs, no problems. 

This 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 and jacks needed for a Eurorack version:  


I still have to lay out the PCB and front panel, which can probably also be done with AI, but as I write this, I am not sure how. 

And there's another, more existential problem. 

Firmware I can give up on, but, I enjoy doing schematic design and PCB layout, and I am not sure I am ready to give 100% of the DiWHY fun to these guys.

It would be a different discussion if I was told to layout 100 unique PCB's a day to maximize shareholder profit (albeit the shareholder never seems to be me). 

Instead this begs a more fundamental question: from here on, is the fun part of DiWHY seeing what I can make AI do? 

I am not sure if I would call bossing around Claude "fun".

And--My original reason for AudioDiWHY was learning EE and audio fundamentals, which included mastering firmware code challenges; the latter is gone, certainly; since from here on I will probably never write another line of code.

Once AI can do the schema and board, well, that's gone.

Then they replace me with a soldering robot?

So--with AI in the house, do I continue at all?  

What is my relationship with this new tech going to look like, really?

I will have to think about this.

In the meantime--back to it.

Can I create an entire new project's firmware using AI? Of course.

The next design was inspired by Intelligel's "Tangrams" gate generation circuit. 

If Behringer can rip Intelligel off, why can't I?

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

WIFE GATING:   

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.  It’s a 5V variable length GATE OUT, Elmo.

MODES

"1 & Done": each BEGIN pulse means a single, entire DURATION + CHANCE situationship, i.e., early dating.  A “kid” is produced--always--sorry Elmo, you should have been more careful with your 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.

WOODS MODE: BEGIN rising edge always starts everything over.  MORMON setting is ignored (this celeb is not Mormon) but not the other modes; if unit is set to MORMON and CELEB you really get a re-triggerable ONE AND DONE just like in real life, and the module costs 15% more to build next 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.

EOC: End of cycle.  100ms trigger pulse comes out here 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:


Next I used ChatGPT to create an image of what this might look like--the fake photo you see below  was created by the bot from the front panel image, and really, this is a pretty good representation of what an 8hp version of this module might look like:

My psychiatrist wife looked over my shoulder as I wrote this post 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.

I changed the project name to "matrimony" and got rid of any of the features that reflected politics, whatever.

 

WAIT! FROM THIS BLOG'S SPONSOR:

 

AI or no AI, you are going to need to create PCB's for these projects. For that you can help out the blog by visiting the sponsor, PCBWAY.  

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!

MATRIMONY FIRMWARE:

I used Claude code, I described the wife-gating "duration" and "random" features, compiled, and sent 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.

Each time I committed and sent the 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 less than a a morning; the guy with the Swiss accent has additional fresh idears that could speed this process up further (great video series from Mr. Spiess--using AI to create firmware--begins here). 

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



OUTTRO:

But can AI make balloon animals? Hard to say. probably.

I will get some boards fabricated and see how the random and matrimony gate boards work. 

If they don't fair bet it's my schematic and layout, not the firmware. 

See you next time.


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.
 

No IC's allowed, part II: determining active vs. saturation state in BJT transistors

Back for more discrete transistor design punishment!  

Quick one this time.

Last time I discussed BJT basics...if you are a "BJT cookbook" tech as I am or was--find a bipolar junction transistor circuit fragment, put it in your design, and hope it works--you might want to skim the last post before reading this one.

Maybe simulate it using Falstad?



If you are a BJT superstar--you taught 1970's electronics at a community college and already know all this--by all means skip this post and instead watch the video here.

but really? this is all for me.

SATURATED VS. ACTIVE

You can get Falstad simulations for these "No IC" posts from github, here.

So...how do you figure out if a transistor is in its active or saturation region?  Should be easy, but this one drove me nuts...

Cheat code: Plug your BJT circuit fragment into Falstad, hover over the transistor and see what it says?  



Nope, too easy. 

We start by guessing we are in active region, and go with these assumptions:

  • B-C junction is forward biased; its voltage drop across B and C is .7V
  • current at emitter and current at collector are the same
  • B-C is forward biased; B-E is reverse biased.(normal situation for active region)

Let's do some simple alegbra and use ohm's law to see what's really going on.
  • Base is 2V less .7V to ground, so the voltage at the BJT emitter is 1.3V.  
  • Using ohm's law: current at BJT emitter junction is 1.3/1000 or 1.3mA  
  • Assuming active region for the transistor, Ie and Ic are about the same, so let's assume Ic is also 1.3mA
  • Again using ohm's law, for emitter to be at 1.3mA, the voltage drop across a 10k resistor would need to be 13V
  • But, the the collector power is only 5V!!
  • The transistor lowers its Ve to Vc resistance as much as it can to satisfy the need to satify the 13V drop
  • But fails--even if C to E is a short, the transistor can't make the Vc junction 13V relative to ground.
  • Transistor is saturated; B-C and B-E are both forward biased; E to C works a lot like a short circuit.
Let's try again:


  • BJT collector current is 1.3mA; that hasn't changed.
  • Assuming active, Ic = Ie, so Ie is also 1.3mA
  • 1.3mA * 1000 = 1.3V  (drop across collector resistor)
  • 5V - 1.3V is 3.7V0--that's the collector voltage
  • B-C is forward biased; B-E is reverse biased (see "active" assumptions above)
  • Transistor is active.

OK with this framework, any simple fragment can be analyzed.

For PNP, all the same ideas, but all polarities are reversed.  

Notes for this post....


This helps explain the typical graph you see when reviewing transistor datasheets:


Voltage between collector and emitter (X-axis) vs. current  at the collector (Y-axis). The uA values on the right (10uA, 20uA etc) is a constant current seen **at the base node**. Which means, voltage and resistance B to C change, giving us the various X/Y values we see on each red line.


The saturation area is the vertical area shaded in blue--as described above: when the voltage from C to E is nearly zero volts, the resistance between C and E is almost zero; C to E acts like a dead short.  However, the values further to the right on the X axis result in amplification: as C-E voltage swings back and forth along the X axis, to the right of the saturation region, current swings up and down along the Y axis, since C to E resistance is changing.  The horizontal area shaded blue results from B to E not being forward biased--transistor is cutoff; C to E acts like an open circuit.

OH NO IT'S THE PROMO



Quick word from this blog's sponsor! Once you have your design working in Falstad, run, don't want 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 (link here)

OUTTRO


OK no more this time, it's Juneteenth, I have to get to the bench and mess around with some IC's.