Circuit Fragment Simulations--No IC's Allowed!

I am retiring soon--they've put me out to pasture.  

I hate hate hate being bored so, what now?

I fired up Falstad to simulate basic electronics building blocks using only transistors, caps, inductors, resistors, and diodes--NO IC's!!! 


A video game!!!!

Rules:

  • (already stated)--No simulated IC's--even if the simulator has 'em, I can't use 'em.
  • FETS/MOSFETS, maybe? Try using BJT's instead....
  • No finding fragments online then copying them into the sim...which "works", but is way too easy, and I learn almost nothing. 
  • Goal: understand "discrete" tech design well enough to look at old audio schematics (e.g.: Aries synth site here--cool) and have a decent idea of how these OG/transistorized/very few IC's to zero IC designs from way back when actually work.
What I found: thank goodness I didn't try to teach myself electronics in 1970!

I discovered that my ability to conjure anything without IC's--like, how to make a comparator without using an opamp--sucked.  Engineers from back in the day didn't put a 2N7000 in series with an Arduino GPIO pin to light an LED--anyone can do that!    

(I document this because in 3 days I will forget all of it.....) 

FALSTAD

I have tried many simulators--Kicad's, Everycircuit, others, but keep coming back to my local installation of Falstad

Falstad and my brain get along; I can get instant gratification, seeing voltages change in real time, seeing current flow like a bunch of little guys running around in "Pacman", quickly spinning up virtual scopes, changing values while the sim is running and a lot more. 

Best of all--it's free--recommended! Get an offline version of Falstad here; web version here.

I put my Falstad exports for this post on github (they are text files...so, file > open the txt files in Falstad to run the simulations). Repo is here.

BJT LOGIC GATES

Getting started--a warm up....even with my extremely limited knowledge of how BJT's work I could figure and AND, OR, NAND, and so on. pretty easy.

NOR gate, get it here. Fake LED demonstrates logic out.


BJT TRANSISTOR BASICS

But beyond basic gates I knew nada.....to ameliorate I created a simple simulation complete with fake current and voltage meters: 

I knew SQUAT, really, about BJT's!!! A bit more now? Sim herecheck out a great "Kevin's Cave"
newbie video tutorial starting here.

ACTIVE VS. CUTOFF VS. SATURATION:  TRANSISTOR MODES

I thought I understood this critical BJT concept, but did I, really?

Nope!

Looking at the NPN transistor modeled in Falstad--messing around for a few hours--throwing a screenshot into claude.ai when I got stuck--what (I think) I know now:

  • In general, the voltage drop between the base and emitter determines C to E behavior. 
  • It's not voltage relative to ground found at the base that determines this. It's the voltage between B and E.
  • The B to E voltage divided by the resistance in front of B and/or after E determines current flowing C to E.
  • Which gets multiplied by the transistor's "beta" (in Falstad: 100 by default).
  • This beta multiplier is also called "Hfe" to keep things confusing.
  • The transistor tries to change its C to E resistance value to allow this x100 current to flow C to E.
  • But--the transistor can only alter the resistance between C and E so much.  
  • At some point the resistance is as low as the transistor can make it, at which point the transistor is "saturated."  
  • When the transistor is in "saturation mode" C to E behaves like a small resistor--maybe 30-50-90 ohms.  In this case additional base to emitter current won't change the C to E behavior, since the transistor is maxed out.
  • Active vs. saturated depends on a number of factors, but for the NPN transistor modeled in falstad it can be boiled down to this: if voltage between collector and emitter is greater than about 200mV the transistor will be active; if it's less than 200mV it will be saturated.
  • If limited or no current flows between B and E, you can end up with no current flowing between E and C. Transistor is in "cutoff" mode and the collector is "high-z", as if it's an open circuit.
  • Falstad has a useful feature: if you hover over a transistor, in the bottom right corner of the app you can see things like B to C voltage, C to E voltage, and its mode (saturated vs. active vs. cutoff).
  • If BJT is in saturation mode, current flow in falstad is shown flowing C to E, as expected. But I've seen current flow from B to C while in "active" mode as well, which I found confusing. I guess Falstad's programmers had to illustrate this somehow?
  • A BJT transistor is a valve--it can't generate current, only let various amounts of it (or none) pass through. Basic idea, but this escapes me at times....can be seen in the sim.
  • For amplification, we usually work in the BJT's "active" range.  
  • For logic and switching, work in the BJT's "saturation" and "cutoff"modes.
  • You program what you want the BJT to do by surrounding it with voltage sources, current sources, resistors, diodes--the usual things. The trick is getting the surrounding components right 
  • Falstad is a great place to mess around with values and see what happens.

DIODE BASED COMPARATOR




The idea of using diodes to choose the greater of 2 voltage sources was new to me--a nice hack.  I tried building this comparator using a long tailed pair but for me a 2 diode + 1 transistor solution worked better....Sim here.

CURRENT MIRROR




I saw these everywhere in IC designs, but, why?  How? After the BJT review and trigger time inside Falstad here is my thinking: By tying B and C together then C to E always acts like a small resistor; we now have a V = IR package using 2 transistors--super useful! 

These can now be peppered around the IC for things like current sinks or sources, and these blocks can put into series and parallel to get different current values at output (V is constant, but R is changing, so the current changes--simple ohm's law)....Sim is here.

LC OSCILLATOR (SINE, SQUARE, ETC)

Hard to believe I've been doing the DiWHY thing off an on for 25+ years and have never used an inductor in a single design of my own.  After trying unsuccessfully to come up with a transistor/cap only solution for an oscillator, I remembered that Inductors pass DC and not AC, while caps pass AC and not DC.  If I put them in parallel, they might fight each other, right?  Yep. That's the thing about simulations--try weasel, try squirrel.  Nothing is going to smoke.  I messed around with the parts until i found something that worked.

I even threw in a FET buffer.  Buffers in general have proven tricky in my discrete design attempts. Just throw in a 741 right? Not today....Osc sim is here.


OP AMP

This one blew chunks--hard!! I remember I have to combine a long tailed pair, a gain stage, and a class B amp, but that's all i recall. So far, no love, I have made lots of things that don't work.....I am really REALLY tempted to cheat, since a simulated op amp using BJT's would create a bullet-proof buffer, much needed!  And I figure a bunch of folks smarter than me have a simple low parts count design already posted online.

But--So far, no love!  

OUTTRO



Indeed....Once you have your sim go to PCBWAY and get some PCB's made....check out their online community. 

yep, I got in the shameless promo in.  Go A's!!!
Until next time: discrete-ion advised.     

One-Chip ADSR using the ATTINY1616

Readers: If you'd like to build the ADSR experimenter's board featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 10 project/pcb/schematic/library files, Arduino .INO file, modified .h and .cpp helper files, B.O.M., and more, are here.  

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

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

This one started when DIY rockstar--this guy's kung fu is the best--TJimmyChonga--emailed me about an earlevel C++ library that abstracts analog synthesizer ADSR functionality into a compact C++ library--articles documenting the library begin here; zip of the CPP and H files are here.

Experimenter's PCB for the earlevel ADSR library, and probably a lot more AudioDiWHY fun. 


Looking over the code, I guessed it might be easy to use an ATTINY1616 --that's a <$1USB MCU, folks--to create an entire ADSR since the ATTINY1616 has ample ADC's and a single reliable 8-bit DAC built-in.  

Designed it, gerbered it, got it fabbed, built it. Fast, fast, fast...Good news--yep, it worked.

THE DESIGN

Instead of breadboarding, which drives me nuts, I drew up a 99 x 99 mm PCB using Kicad10.  

I added 3.5mm input and output jacks; a shottky diode clamp for the trigger input (so a 10V or 12V gate signal didn't blow up the input pin on the MCU) and a few pots....I buffered the output using a DIP TL071....simple stuff. 


....for future expansion, remaining GPIO was brought out to JST connectors....

As usual, a 3-pin JST in series with a 470 ohm resistor was used UPDI programming.

I included a 7805 regulator, although I could have gotten 5v from the Euro power cable, but hey, why bother.

I chose mostly thru-hole since I have tons of THT in my junk box.

Happiness is bubblewrapped new PCB's from this blog's patient sponsor, PCBWAY, where ten 2-sided PCB's less than 100mm x 100mm can still be purchased for $5USD.  

THIS BLOG'S SPONSOR

The gerber got sent off to this blog's trusty sponsor, PCBWAY and came back with alacrity.  

The shameless plug:


....why bother breadboarding when you can throw your ideas into Kicad, ship them off to PCBWAY and get lotsa boards back to mess around with. If they don't work: don't swear, don't stomp around, don't cry....e-waste them in an environmentally friendly way and try again. What's your time worth? 

Prototyping with PCB's is faster and a heck of a lot more fun than breadboarding....wait, there's more! Kicad experts: check out PCBWAY's 2026 Kicad Design Contest--nice schwag and cash prizes may be yours.

Back to it....

PROOF OF CONCEPT

Since nobody codes any more I used Claude Code to put together the Arduino sketch for a 3 pot ADSR proof of concept--Attack, Sustain and Decay/Release--some bugs at first but easily fixed. 



The output worked surprisingly well--nice analog-sounding log response....I thought 8 bits wasn't going to get it done and the output would be "stair stepped" but it was fine.

For the PCB, there were a couple of stupid mistakes but overall this one was easy--maybe too easy.  

Testing the POC board with a dual MS20 filter (MS20 VCF post here). Overall the Proof of Concept single chip ADSR, using the C++ Earlevel library, worked a lot better than expected.

OUTRO

In general, all heavy lifting was done with the ATTINY1616--if I hard coded the ADSR values, jammed 5V from my bench supply into the MCU, and didn't care about input or output levels, this was literally a one-chip/$1USD design....if there's a lower parts count ADSR out there, I haven't seen it.

OK, whatever....the question, what to do next.  

The fact that the entire EG lives on a single inexpensive MCU means I can sprinkle the damn things all over--add it to a filter, add it to a VCA, add it to a mixer.  

But I also envision adding various logic outputs to this--end of attack, end of release--and using them to trigger other events.  

Also it should be easy to modify the DAC to produce linear outputs, log outputs, or whatever you want in-between.

Or, I could go full Behringer and rip off + remarket someone else's function generator design--how about The Intelligel Quadra (4 AR's with clever I/O) with expander, allowing VC of attack and decay, this module sold for something like $300 before being discontinued? I figure I could recreate it using a 4x ATTINY's for something like $30USD?  And add sustain to each of the 4 AR's?   

Make it itty bitty/Eurorack so only folks with tiny little fingers can use it.  

Finally, I'd need to say it was made by "Bellinger" and call it something like "Quad Fumer"--indeed, too easy.

  


KICAD 10: Hierarchical Sheets and Blocks: Lay 'Em Out Once, Use 'Em Over and Over

Readers: today's post assumes you have a working knowledge of Kicad, an incredible open source EDA program. If not, this post might be pea soup. Newbies: watch a great Kicad tutorial here.  And--previous audioDiWHY posts focusing on Kicad are here, here, here and here


I have read that good engineering is modular engineering. Is good audio synthesis modular audio synthesis? 

Not sure.

Kicad--our beloved schematic capture/PCB layout/simulation software--has recently added some great features in making bits of your previous designs reusable--a huge timesaver.  

Let's go over this.

"Hierarchical Sheets"

....let you put subcircuits into other designs, treating the subcircuit as a "black box"--don't worry what's in the box, just enjoy what it can do....you expose I/O between your black box and main design using "hierarchical labels."
  • Because I'm lazy, I will abbreviate hierarchical sheets going forward as "HS"
  • Create a new project, this will contain your HS.
  • In the schematic (.sch file), put whatever components you want in your HS--you are creating a normal schematic at this point.
  • For I/O you need to share outside your HS issue the command: "Place" > "add hierarchical labels"


  • Save the schematic.
Next--Create a new parent project; in the next few steps, we are going to embed the "HS" content into it.
  • In the parent's .sch file, click on this icon on the right:

  • using this tool, draw a box inside the parent schematic. 
  • You will see a blue box...this represents the HS:



  • A properties dialog appears (if you don't see it, select the "Untitled_Sheet" and then tap the letter "e".)
  • Give the HS a name
  •  in "sheetfile" click on the folder icon and navigate to the kicad_sch file you created initially, the one that contains your HS.

  • At this point you might see dialogs about using relative filenames and something about database tables being messed up (?).  
  • Pretend you didn't see any of that and click OK twice.
  • Still in the parent schematic, click on this icon on the right:

  • Click on the HS box; the I/O pins ("hierarchical labels") created in the the source .sch file appear in the parent schematic--they are placed sequentially
  • Create the rest of the parent schematic and wire it to your HS.
In the screenshot below I ran a DC simulation on a parent schematic containing a hierarchical sheet; the HS contained a single 100k resistor with "in" and "out" labels. 

The simulated DC voltages in dark red show that this works--the 100K resistor in the HS is hidden from view but is part of the simualtion.
This is an OC simulation--DC values--not to be confused with "OCD"
 


DESIGN BLOCKS

....allow you to create a subcircuit, save it in its own library, and import it into future designs. 

This feature showed up in Kicad 9 (See the video here). 

With Kicad 10, you can put schematic symbols/wires and PCB traces into a single design block.

And--again, due to indolence/laziness, I will call "design blocks" going forward "blocks". Have a nice day.  

Organizing blocks: Blocks are organized into libraries, same idea as Kicad symbols.  Each block is a folder containing a json description file and file(s) for the .sch and/or .pcb components.  

For both the people out there who are interested--get a zip of my custom blocks from Github, here.

Creating a block: select some or all of your design, then right click on "blocks" 




From the drop down, choose "Save Selection as Design Block"





But! Be careful about "hide library tree", if you click that, the entire block's user interface section disappears. This threw me at first. I had to go back to view > panels > design blocks to make it reappear.  
 
Tidbit: By clicking "New Library" you can also choose if you want the block to be visible in the current project only or globally (all projects); the default is global:


Viewing existing Blocks: from the schematic editor View > panels > make sure "design blocks" is checked.... you see something like this (your block names will be different....)


Using existing blocksDouble left click on a block, drag it into your schematic, creating a group of components and wires.

Editing blocks:

  • Select either PCB 
  • Right clock inside the block and say Grouping > ungroup
  • Edit.

Before



After: now it's editable components like everything else in the schematic.


NOW: A WORD FROM THIS BLOG'S SPONSOR

OK, you just created something awesome using these new Kicad 10 tools and need to get some PCB's, then get them assembled.

For this, check out this blog's sponsor, PCBWAY, who can fabricate the PCB's, do the component assembly, and then, do everything else.

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

And!!! Kicad Mavens (you must be if you've made it this far?): run, don't walk, and submit your Kicad masterpiece to PCBWAY'S Kicad PCB Design Contest--winners get cash and/or RPi goodies. Check out the contest here.

As always--you can help this blog by checking out the PCBWAY site.  Thank you!


SCHEMATICS AND FOOTPRINTS/TRACES IN ONE BLOCK--New to Kicad 10--How To Do This

Super useful--capture the schematic and layout of a subcircuit in a single block. However--work slowly and carefully. This feature is one of those "miss any step and the whole damn thing won't work" situation.  

The steps:

Creating the combo block--start with the schematic:
  • Create a schematic subcircuit with all the symbols, wires and values you want in your block.
  • Tool > create associations  
  • Make sure everything is OK, that all symbols have associated footprints and so on.
  • Create a block--for this let's call it europower w traces




Next, create the associated traces.
  • Go to PCB and update the PCB from footprint
  • The footprint appears
  • Draw in all traces you want to include in the combo block
  • Save the selected footprint and traces (you must select both!) as a block  (right click on block > save selection as block)
  • For the block name, type in the exact same name you used for the schematic block--this is case sensitive: in this case, "europower w traces"
  • Kicad 10 will ask "overwrite block"?  Say YES

To use it:
  • In your schematic, pick the block europower w traces and put it on the schematic
  • In your PCB, pick the same block europower w traces and put it on the pcb
  • Hit F8.  
  • If all goes well you will see a footprint with traces appear--the PCB and the schematic are "synced"--it's all wired up.
  • If you messed up, a new footprint will appear with no traces. Fiddlesticks! Try again, make sure to follow each step.
  • You can now grouping > ungroup your Schematic or PCB block and change things.  





Tidbit: I noticed when upgrading Kicad 9 > 10 I had to set the global blocks path manually.  Preferences > Manage Design Block libraries > global libraries:


For Kicad 10.0.1, I had to set the Nickname, the "Library Path" (where the global block libraries are stored--the local location might vary if you are using a cloud repo on different hosts), and the Library Format (pulldown to "Kicad") by hand for this to work. Not sure why this didn't come over with the rest of my preferences.  

OUTTRO

Think "She's so Heavy": another brilliant John Lennon time signature change, with rapid master tape cut.  

Sequential Pro-One VCF: Smells like 80's Spirit

Readers: If you'd like to build the VCF featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 9 project/pcb/schematic/library files, 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 grew up on 70's rock and roll, by 1980 I was in college and Reagan was president. The latter was bad news, but the good news: cool synths everywhere. One of my favorites: Sequential Pro-One and yes, it had a hyphen. 

Back then I was the cool synth kid, playing in a remarkably lucrative band, I had a 5 and a 600, which both sounded great, and damn, the ProOne had that Sequential Spirit.

I see Pro-One's go for $1500-2000USD on the used market; I'm not going to buy one, I have too much vintage gear already, instead I cloned its VCF, a big part of its sound:



This is revision 3 of the initial design (here) and is almost 100% where I want it; still some minor adjustments needed for the resonance, but is otherwise good to go, and it sounds, well I think anyway, great.


Double happiness is 2 bubblewraps from this blog's faithful and patient sponsor, PCBWAY.  You can help out the blog immensely by checking the out--here.









 

For the front panel, to nail some of the 80's design look n' feel, I used a graphics technique shown to me by one of the most talented fabricators I know: Elton at Otter Mods. Read about the SVG to Kicad graphics process here.

I will skip the rest of the usual boring fab photos, instead jumping right to the test phase:

worked first time (WFT), but at rev 3, it should, right?



Altering the power rails changed the overall sound of the filter, especially bringing the V- rail to say -9 or -10VDC.  Raising the rails to +/-15V didn't make a big change which surprised me a bit. I might create a starvation add-on for the negative rail for further expermentation? Stay tuned.

The one remaining issue with the filter is that the resonance, when cranked to 11, doesn't create that nice whistle-like sine wave I remember on the beloved Pro-One; instead, it creates a crunchy distortion, a bit like an MS20 filter with it's "peak" cranked way up.  

that's not right, I probably missed a value somewhere?

I didn't need another crunchy VCF so I changed its current limiting resonance resistor from 200K to 330K, which topped out the resonance sound to more like a 12db/octave filter. Regardless, this filter has the nice 24db/octave Sequential fatness.  

In the future I will try to chase this rez issue down, but for now I have another good sounding filter without paying a kings ransom for a vintage synth I definitely don't need. 

Update 4-20-26 think I figured the resonance issue out (it's simple, and stupid): The Pro-One filter seems to expect around 10V P/P audio at input, maybe a bit less, while the Doepfer bench ramp VCO I used to test was about 17V P/P. 

So--fixing this was a simple matter of attenuating the VCO output signal on my bench. 

As far as using the filter as a sine wave oscillator, it was best to remove the input signal entirely when the filter was used as a VCO. I ended up using 220K for R1. With all that the filter resonates all the way to a decent sine wave and sounds great.

OK--That's it for this one. 

Until next time: Filter well and live. 



-10 to 10V 3x CV Generator--Part III

Readers: If you'd like to build the CV Generator featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 9 project/pcb/schematic/library files, STL for the OLED standoff, Arduino .INO file, B.O.M., and more, are here.  

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

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

Howdy--this post is part III of the posts here and here

From last time--I created a simple control voltage generator, sourcing about 30mA with 3 independent pots, each output is -10 to +10V DC controlled by a dedicated pot.

For revision 3 I added a MCP4728 DAC and tweaked the 16-bit ADC analogReadEnhanced algo, using 3 of the 4728's 4 channels, to make the CV generator's output better match the values shown in the OLED.



This simple revision had a big problem....unlike REV 1 and 2 I couldn't get the I2C bus to work--no I2C signal, anywhere.  

I figured it was a hardware issue and spent a lot of time troubleshooting based on that assumption--nope.

Then I had to move my shop--pack up every tool, every part, every drawer, move it across town, then set it all back up again--fun stuff.

Once unpacked I revisited the build, and right away Claude.ai caught the problem; the sketch used the "SSD1306AsciiWire.h" library to drive the OLED and my code was written like this:

  Wire.begin(); //set I2C 

  oled.begin(&Adafruit128x64, I2C_ADDRESS); 

  Wire.setClock(400000L);  //set I2C speed. 


meaning the I2C speed was set after constructing the oled object.

Claude told me I had to add the Wire.setClock statement before calling oled.begin. I knew that?

So--should be this.

   Wire.begin(); //set I2C 

  Wire.setClock(400000L);  //set I2C speed. 

  oled.begin(&Adafruit128x64, I2C_ADDRESS); 


(The errant code worked in revision 1 and 2 but not this one, making this one hard to track down....)

Fixed!  

Otherwise a simple build:

As usual I used SMD SOIC and 1206 parts and a cheap hotplate.



Uploading firmware....




The OLED needed a standoff and I was surprised I couldn't find anything close to what I needed online so I designed and 3D printed one myself:


That sat between the front panel/Oled and the PCB:

 
 

I then packaged all of this up (gerber, Kicad files, STL file for the standoff, Arduino code, and all the rest)--and put it on PCBWAY's community site , go here. Speaking of Serene and the good folks at PCBWAY, here's a word from this blog's humble sponsor:


      

 For all your prototype and production needs, PCBWAY is the place to go.

they can fabricate PCBs using full color! Details here

In addition to top shelf PCB fabrication they also do fantastic work with assembly3D printinginjection molding, and much more. 

Their staff is extremely helpful and PCBWAY always turns work around quickly. 

As always--you can help this blog by checking out the PCBWAY site. Thanks!

Back to it.....


Boring AI background. 

Wait, is that it?  Yep that's it for now. 

Gotta keep moving.

See ya next time.