Thursday, August 28, 2025

CV Generator Part II--"Seems Working"

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, B.O.M.'s, and more, are here.  

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

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

Just got back from a long and much needed vacation with the psychiatrist wife--back home and back to it. 

This time I improved the ATTINY 1624 based CV generator from this previous post--good news: hey, it works.


Synch issues with my camera made the OLED appear to drop lines of text but in real life the super cheap OLED display looks good.


Reviewing its features: 

  • Three -10 to +10 DC CV outputs, independently controlled from potentiometers (not rotary encoders). I like the way pots feel for this application; in general I dislike membrane switches and rotary encoders.
  • A 5V momentary switch for creating triggers with a dedicated output and LED.
  • Practical use of the ATTINY1624's super affordable high resolution mux'd AD conversion (details here towards the bottom of the post)--to see if I could get >12 bit oversampling using the analogReadEnh function in sketch (it works!)....This is killer feature that's surprisingly under-documented.
  • Eurorack footprint--this is going to go into my bench rack.
  • Test Points. TP1 can be used to test the MCU via a blink subroutine, or maybe some future expansion. TP2 should be adjusted to 2VDC using the 20K trimmer for bias offset for the final buffer stages.
  • A TX/GND serial port. For future expansion? Who knows. But I figured why not.
  • A port for UPDI programming. See previous post here (halfway down the post) and IMSAI guy video here.  
For firmware I used Arduino Sketch and IDE and the Greiman SSD1306ASCii library (here).  Firmware creation for the generator was pretty easy. By bringing analog data from the pots in at 16 bits, I could ditch a bunch of LSB's and get reasonable readings on the OLED that didn't jump around a lot. 

Some simple math converted the right shifted 16-bit value into a x = -10 to10 value for the OLED:

float scaleToPlusMinus10(unsigned int x2){
  x2 = x2 >> 8;
  return -10 + (float)x2 * 20.0 / 256  ;
}

The module consisted of 2 PCB's provided by this blog's patient and helpful sponsor PCBWAY: a main board with hardware on the front and the SMD components (1206 and SOIC--not too tiny) on the back, and an 8HP Eurorack front panel.  

I did a lot of the heavy lifting for the design during the initial build (post here). So this "rev 2" is a prettier version with a few improvements.

And--thankfully my measurements this time around were correct; everything fit.


USELESS BUILD PHOTOS


Always happy to get new PCB's from my sponsor, PCBWAY.  Even with the tariffs these guys are still way cheaper and faster than anything I can find in North America. Go A's!

I used an SMD stencil, solder paste, and a hotplate. This has become my go-to assembly process for most of what I do these days--it's fast....with some practice SMD hand assembly has become easier for fab, mods and troubleshooting vs. through-hole.  



I gloofed on a bit too much paste but fortunately it's a pretty forgiving process.


For the hotplate, I heated it up to 210C and it sat there for a couple of minutes, then cooled it to 150C.  This was all done manually from the plate's front panel. There appears to be way to automate this--there is some sort of temperature curve firmware in the hotplate--but I can't find any instructions for this in English. Sorry.

The hot plate process is surprisingly forgiving but I ended up with a few solder blobs on the SOIC IC's. Fortunately these can be quickly fixed with solder wick. 


Firmware test....

For the OLED I de-soldered its edge pins and used longer pins instead. This allowed the display to stand off from the PCB an appropriate distance. After putting items into place I tacked soldered the edge connector pins, removed the front panel PCB, and finished soldering.



As far as accuracy--the completed module is pretty good but not perfect. For what I do--cranking CV into whatever module I am messing around with on the bench it is definitely good enough. For better accuracy I'd probably need to use a rotary encoder and a 16-bit DAC. Maybe a future project?


Overall, fun times; I might build a few more of these. 

Until next time, don't breathe the fumes.


Sunday, July 13, 2025

3 Channel Bipolar CV generator Part I: Didn't Fit; Built it Anyway

Readers: this is a work in progress but you can get the files associated with this post from Github, here

===========

Back again! 

I wanted a synthesizer module that accurately outputted and displayed 3 independent control voltages ranging from -10V to 10V DC.  

The early prototype used a 3D printed front panel conforming to PAIA Frac format. Camera Synch issues meant my digitial camera couldn't capture all 4 lines of the working OLED but in real life it works.

There were a lot of ways I could have done this--using a multiplexed bipolar digital to analog converter (post for DAC here; multiplexer here) but instead employed the 16-bit ADC features of the impressive ATTINY 1624 MCU, covered briefly in this previous post. Overall, design for version 0.1 was simple; I used the pots configured as voltage dividers, buffered by op amps, took the 0-5V wiper voltages from the pots and connected that to ADC inputs of the ATTINY, and had the MCU feed a 128 x 64 OLED display to convey the 3x voltages.

Finally I used inverting op amps to get 0-5V DC from the pots to the -10 to 10VDC needed at output:  

One of 3 identical buffer subcircuits. A simulation of this simple inverting buffer/amplifier can be found hereI have posted the files for this prototype at Github, hereWhen the design is further along I will post files to the PCBWAY Community.

CONSTRUCTION

I laid out the design in KICAD 9 and used Arduino Sketch to (quickly) create the firmware. Because the ATTINY isn't blessed with buttloads of flash memory I used Bill Greiman's memory-friendly SSD1306ASCii library (here) to provide functions needed for the OLED. 

I sent the gerber file to this blog's trusty and most-excellent sponsor, PCBWAY. Very soon the boards were back. They do great work! You can help out the blog by checking them out here.

The prototype used 1206 SMD components, a stencil, and a Eurorack formatted front panel. After years of trying different workflows, this combination seemed a decent mix for fast prototyping, flexibility in terms of modification, and small size. 

After unbagging and inspecting components I discovered a major mistake: the PCB was too tall to fit into a Eurorack or Frac enclosure:


I contemplated pitching the entire thing and starting again, but instead consulted the guys in my audio geek discord group. Could this be fixed? No, but, one member suggested I try to build it anyway, to shake out the first batch of mistakes, before going to Version 2. Good idea....

I got building....

Used my $35USB hotplate for SMD, works great.

 
Original design incorporated Eurorack power, but I adapted this to Frac Power using edge connectors, 22 gauge hookup wire, and shrink tubing. This allowed a fair amount of twisting and bending without breaking wires or shorting connections.

Same idea for the rest of the hookup wire....


Initial tests showed way too much current draw for the positive rail--should have been more like 4-5mA, but here it's 230mA. I pretty quickly traced this to a 78L05 regulator being installed upside down, due to using the wrong Kicad footprint--I used the 3N3904 footprint, not 78L05, so Pin 1 and 3 were flipped. Whoops. I pulled the 78L05 using a Hakko FR301, flipped it, and resoldered. Surprisingly this snafu didn't blow up the MCU, nor the regulator.  




With the power problems sorted, things seemed to work--albeit not terribly accurately -- off by as much as 5% at times--but OK for the first attempt.


I laid out a quick-and-dirty front panel for the PCB using FREECAD 1.01.

....then mounted the PCB to the 3D printed front panel:








Version 0.1, unpowered, in the flesh...



Version 0.1 seen through the lens of open source AI (ComfyUI + Flux Context Dev with a 12GB Lenovo/Nvidia RTX2000 GPU).  This first and only pass through the AI algo took 50 seconds and beat the holy crap out of what I could have done with an hour in Photoshop--if this doesn't scare the hell out a tech + graphics professional, I don't know what does.

OK, quick post but enough for now. I will keep plugging away at this project and hope to have a revision with better accuracy in the coming weeks. Update 8-28-25: Eurorack "rev 2" version of the generator is complete and works....please see the post here.

So--until next time: don't breathe the AI.

Saturday, June 21, 2025

"LFO MINI": Small and Simple CA3080 modulation source

Readers: If you'd like to build the project featured in today's post, please go to PCBWAY's Community pages--gerber file; KiCAD 9 project/pcb/schematic/library files, a couple of B.O.M.'s, and more, are here.  

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

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

Carrying on with the latest "keep it simple" and "just say no to AI" posts: this time I designed, laid out and populated a small CA3080 based LFO PCB. Works!


 The basic OTA > op amp core was stolen from EFM's LFO2; see the previous post here; an online simulation of the current source for the 3080's "Iabc" pin 5 is here.


Laying this out was easy, but I had to make a few decisions that seemed a bit arbitrary:

  • I used Through Hole Technology not SMD. I don't do a lot of through hole work any longer, but have so many THT parts lying around, I felt like I had to use them?
  • I had a tube of NOS CA3080's so I used a few. If you build this LFO you'll need to find this IC. The DIP version of this IC is no longer made, but, as I am writing this post I see plenty for sale on Ebay, Amazon and elsewhere--it's not unobtanium, at least not yet.
  • Inputs rails were +/- 12V, but the circuit should work fine with anything from maybe +/- 15V to +/- 9V.
  • Inputs and outputs were put on 3 pin 100mil headers.

One modulation input was current limited by R5 and brought out to the "CV I/O" pin, but additional modulation sources could be easily added--wire up 100K resistor(s) between your CVs and the "Q1BASE" wirepad:

Be careful! If you leave off the 100K resistors and plug your additional CV directly into the "Q1base" wirepad you risk blowing up transistor Q1. Make sure to current limit the additional CV with a series resistor as shown.

From here this was an easy build:

I got 10 LFO minis from this blog's loyal Sponsor, PCBWAY, for $5USB (excluding tariff and import fees).  You can greatly help this blog by checking 'em out here.





Testing....

The LFO worked first time--almost.

I had a short between two of the bypass cap pins (C1) initially and the CA3080 got hot; once I cleaned up the sloppy solder everything was fine. Fortunately I didn't smoke the CA3080.

Using only the 10K trimmer board for modulation the LFO goes from < 1hz well into audio range. With +/- 12V CV added, I got a wide range of frequencies, from reeallly slllowww to well up into the audio range--this is a the hallmark EFM design: cool and simple.


 

Output for triangle is about 6V P/P, for the square it's close to the rails. Since I designed the LFO-MINI to be a daughterboard, I figure whatever I plugged it into could gain up or down these output amplitudes, so for now this was good enough.

What's next? It would be easy to make this a dual super-small LFO using SMD parts and an LM13700. 

Overall, this will find its way into some "quad mod" type modules swirling around in my head, that combine random voltage sources, audio inputs, a couple of these LFO's, and who know what else. 

Until then, don't breathe the fumes.

Saturday, June 7, 2025

BNC to 3.5mm Adapter Board--Sans AI

Readers: If you'd like to build the project featured in today's post, please go to PCBWAY's Community pages--gerber file; KiCAD 9 project/pcb/schematic/library files, a B.O.M., and more are here.  

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

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

At my day job I'm up to my knees in Artificial Intelligence. Thank goodness I can do something simple and stupid for AudioDiWHY and get away from AI for a bit.

How about a 3x BNC to mono 3.5" adapter PCB? BNC's can be found on most of my bench test gear, and 3.5" jacks are common to a lot of audio synthesizer gear as well as most things DiWHY.  

Sure, I could buy or make BNC to 3.5mm mono adapters/adapter cables, but what fun is that?

THE BOARD

In addition to the 3x breakout the PCB has signal and ground brought to wirepads.

For the audio jacks I used my favorite horizontal 3.5" switching mono jack, the Switchcraft 35RAPCVAV

KICAD 9 doesn't provide a footprint for this connector, so I made my own. Get it from Github, here (a library with all my custom KICAD footprints is here).

For the BNC's I had a lot of choices, but, in the spirit of this blog, I chose cheap Chinese BNC's sourced from Amazon: "Superbat":




I had to make a custom a Kicad footprint for this component as well, get it here.....and, assuming the link still works--you can buy the connectors here.  

THIS BLOG'S SPONSOR


Once again helping with my DiWHY addiction is this blog's humble sponsor, PCBWAY.  They do all sorts of great fabrication, CNC/3D printing, assembly, and much more.

Please help out this blog and check them out--use the link here.   

DESIGN AND BUILD

Designing the PCB was easy. I used Kicad 9 and made the board less than 100x100 mm to lock in PCBWAY's ridiculously low price of $5USD for 10 boards.


 

Happiness is new boards from PCBWAY!


SE HABLA TARIFFS?

For the first time I had to pay a tariff for these PCB's. It was surprisingly tricky to figure out how to do that.

Here is the process (for DHL Express; other shippers will differ):

  • Print DHL's POA form (download it here). As of 6-8-25: You have to complete this form, and have DHL sign off, to get shipments from China to the U.S.A. using DHL.
  • Go to page 2 and figure out who/what you are. 
  • I am an "individual" so I had to fill out the boxes listed in that form on pages 3 and 4. Yes, I had to provide my social security number.
  • Sign the form.
  • Scan the completed form and email it to DHLExpressUSA.POA@dhl.com 
  • They emailed me back quickly--one business day--to acknowledge they got the form and it was OK.
  • After my order shipped from PCBWAY, DHL sent me an email telling me how much additional USD I had to pay them before I could take delivery of the goods.  
  • For me, it was about half the cost of the boards and another $18 USD for handling fees.
  • Yes, this raised the price of the boards, but they were still a lot less expensive than any PCB fabrication houses I could find in the US, even with the tariff in place.

With that out of the way, I got building!

USELESS BUILD PHOTOS

 

The BNC's are pretty chunky; I had to increase my solder temp to about 750 degrees F to get their leads hot enough to fuse with the solder.

It was hard getting the BNC's perfectly aligned but everything works--good enough.

USE CASE?

If I ever get time I will use this adapter board next time I fire up my QuantAsylum Audio QA403 test rig; right now, with all the adapters and jumper cables needed to hook A to B and B to C and C to D my bench quickly becomes covered in  spaghetti. Hopefully this simple BNC to 3.5mm adapter board helps sort this a bit.

I also might build a few of these to make the BNC's behind my test gear--like the trigger input to my Siglent SDG1025--easier to patch.


Beyond that? Who knows. Adapter board DiWHY can be mindless fun and soldering connectors on a simple PCB is satisfying. 

Saturday, May 24, 2025

Adventures in AI

                           

Are you fascinated by the idea of building your own audio gadgets but feel intimidated by complex circuit diagrams and tedious calculations? Artificial intelligence (AI) is rapidly changing the landscape of electronics, and now, even hobbyists can leverage its power to design and create custom audio circuits. This blog post will guide you through the exciting world of using AI tools and platforms to simplify the process, from conceptualizing your project to bringing your sonic creations to life.

BARACK OLAMMA

Are you eager to explore the possibilities of large language models (LLM's) on your single-board computer (SBC) without relying on cloud services? Look no further! This section will walk you through the straightforward process of installing and utilizing Ollama, featuring the amazingly small and at times hilariously inaccurate Llama 3.21B model directly on your SBC. Get ready to unleash the potential of local AI for various tasks, right at your fingertips!

                       

The simple video here describes steps to install Ollama and LLAMA3.2. Follow it to install the powerful model on your single board computer (SBC) or in the case of the author of this blog, a Linux Mint VM running 4GB RAM and a 20GB fake HD. 

#install OLLAMA (woe woe)

curl -fsSL https://ollama.com/install.sh | sh

#fix ufw to allowing incoming Baracks.

sudo ufw allow 11434/tcp

#test

#open FireFox on your SBC and go to localhost:11434 you should see "Ollama is running"

#install model

ollama pull llama3.2

#RUN MODEL

ollama run llama3.2

#enter stupid stuff

>>>How do I make potato salad?

Here's a simple recipe for classic potato salad:

Ingredients:

* 4 large potatoes, peeled and diced

* 1/2 cup of mayonnaise

* 1 tablespoon Dijon mustard

* 1 teaspoon chopped fresh dill

(blah blah ginger blah blah)

Once running, you can discover exciting and productive facts that will assist in your quest to create basic do-it-yourself projects. "Why Scotty, why?" It's a line that resonates with anyone who's ever pushed technology to its absolute limit, only to have it fail at the most dramatically inconvenient moment. More than just a frustrated outburst, this iconic Star Trek quote speaks volumes about the complex relationship between engineers and their machines, the inherent unpredictability of even the most advanced technology, and the often-unseen sacrifices made to keep things running. Let's delve into some thoughts on why this simple question, posed by Captain Kirk, has become such a memorable and relatable part of the Star Trek lexicon.


Excellent, always so happy to help! Here are a few more prompts that the author of this blog posed to OLLAMA/LLAMA 3.2.  You too can discover the impressive state-of-the-art inaccuracies. We hope you find LLAMA3.2 useful!

 >>> what are notes in a C major 7 chord

In a C major 7 (Cmaj7) chord, the root note is C, and the other three notes are:

 

1. Major third: E

2. Perfect fifth: G

3. Minor seventh: A

So, the notes of a C major 7 chord are: C-E-G-A 

>>> what are the notes of C minor pentatonic scale?

The C minor pentatonic scale consists of five notes:

C, Eb, F, Gb, Bb.


                          



If you’re rich and just want to lie on the beach, go ahead and soak it all in! Let the sun be your spotlight, the sea your soundtrack. Order a fresh coconut or a fancy cocktail, lean back in a plush lounge chair, and let the breeze do the rest. Don’t even bother with your phone—just let your mind wander as the waves lap at your feet and seagulls play above. 

                        



This is your time to simply exist, with no rush, no deadlines—just warm sand, blue skies, and the gentle hum of relaxation. So go ahead, live that beachfront dream, because after all, isn’t that what the riches are for?


Creative sponsors don’t just offer money—they become partners who help elevate a blog’s content, reach, and professional profile. With their support, a blog can evolve from a passion project into a thriving, sustainable platform.


 


PCBWAY is an outstanding sponsor for this blog, bringing top-tier expertise in PCB manufacturing and assembly to our readers. Known for their high-quality production standards, affordable prices, and quick turnaround times, PCBWAY empowers electronics enthusiasts, engineers, and hobbyists to bring their innovative ideas to life. 



With a dedication to precision and customer service, they’re more than just a manufacturing service—they’re a trusted partner who shares our commitment to creativity and quality. We’re proud to have them as a sponsor, supporting our mission to provide informative, inspiring content for all our readers!


WHY LEARN TO CODE? SIT ON THE BEACH AND LET AI DO THE LIFTING!

OK, most of this post is silly, but the next part, to me, changes everything.

See the videos here, here and here. You can create working, useful software applications without knowing doodley squat about creating software--"Vibe Coding". 

Yes, this really frigging works. 

Terrifying!

Let's create an application to transpose piano chords up half steps, coded in HTML and CSS (which I have a little experience with) as well as javascript (about which I know almost zilch).  

This is useful when trying to learn dense jazz chords in all 12 keys.

I got a Gemini AI studio license, chose the latest model (which seems to change and improve often), and prompted the AI thing what I wanted app-wise over and over until it worked. 

Get the keyboard transposer 1.4 zip from Github here.

You can run it locally on W11, for that install node.js (get installer here) runtime. 

You will also need a Gemini AI studio API key--video about how to get the code is here.

To run it follow the steps in readme.md, yes this worked (amazing!) 

1. Install dependencies:

   `npm install`

2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key (this key is not contained in the github repo, you will need to get yer own)

3. Run the app:

   `npm run dev`

For me it said to go to this URL with my browser: http://localhost:5173/

I can see my app!  I didn't write a single line! I created tech but I have very little idea how it works.

To visualize a major 7 in 12 keys:



(10 more were displayed--etc).

Assuming I was decent at CSS, HTML, and Javascript (I am not) this would have taken me a day to code? Two days? A week? But with zero elbow grease or knowledge I created this app in about an hour and a half. 

BACK TO IT

Oh boy, so you’re thinking about inhaling… toxic fumes? wink Let’s be super serious (but in a silly way) about why you probably, definitely, absolutely shouldn’t be doing that. 🌈








CV Generator Part II--"Seems Working"

Readers: If you'd like to build the CV Generator featured in this post, please go to  PCBWAY's Community pages --gerber file; KiCAD ...