Using a microcontroller to switch analog topology

Started by mmessmore, December 05, 2022, 09:45:23 AM

Previous topic - Next topic

mmessmore

I have experience with various microcontrollers (PICs, Atmel, etc.) and am starting to teach myself analog circuitry through the magic of guitar pedals... and learning guitar.  The hobbies are reinforcing each other.

I want to start playing using a microcontroller to orchestrate switching the topology of a purely analog signal path.  A simple example would be to turn on or off various clipping diode structures like one would do with toggle switches.

I've used transistors as digital switches before, but I'm pretty sure I can't use them to pass an AC signal.  Relays seem to all be designed as low voltage controlling high voltage and are quite large.  I see what I want to do done in smaller enclosures than what the number of relays required would fit in... I think.

I don't want to wander down the DSP path (yet  ;) ).

I just know I'm missing something simple here, but I am at a loss.  I've spent this weekend Googling and wandering down rabbit holes in LTSpice.

Basically, I'd like to just be able to set pins high or low as a switch on another circuit.

What component(s) would I use, and if complex, how would they be arranged?

Digital Larry

Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

FiveseveN

Welcome to the forum!
Don't forget the CD4016, 4051/2/3 and the like!
Quote from: R.G. on July 31, 2018, 10:34:30 PMDoes the circuit sound better when oriented to magnetic north under a pyramid?

ElectricDruid

Quote from: FiveseveN on December 05, 2022, 12:12:07 PM
Welcome to the forum!
Don't forget the CD4016, 4051/2/3 and the like!

+1 agree. The original CMOS switch ICs are *all over* analog synth schematics of the era (example: Prophet 5). They're used to switch waveforms on and off, choose modulation routings, sometimes even as a "budget DAC" selecting one of 8 values instead of needing a whole control voltage.

They're still viable choices, but there are a lot of other options now. There are modern 74HC4xxx versions of the original CMOS. There are the DG-series of switches (examples DG406/407/408/409), which are nice because they'll run on a full +/-15V supply, but still use 5V for the logic, so you can control them from a microprocessor without having to do any interfacing.

There are still others intended for audio switching which include zero-crossing detection, so you tell them you want them to switch, but they hold off on doing it until the next zero crossing to eliminate pops. Nice trick.

So...yeah...better than relays for this job!




mmessmore

AHA!  Thank y'all so much.  I felt like I was crazy not being able to think of what to use and then not being able to even google it.

Now that I think about it, my frustration with not being able to quickly find it on the internet is kind of funny.  I guess modern conveniences have lowered that threshold.


Ripthorn

I actually came from analog circuitry and learned microcontroller stuff later. I have several projects that marry the two. You can find all my projects for the DIY community here: https://scientificguitarist.wixsite.com/home/projects
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

Annaberry

#6
To use a microcontroller to switch analog topology, follow these general steps:
Choose an appropriate microcontroller with enough digital pins to control the analog switches you plan to use.
Select the analog switch IC that best suits your needs based on the specific application requirements, such as on-resistance, bandwidth, and package.
Connect the digital pins of the microcontroller to the appropriate control pins of the analog switch IC.
Connect the analog signal inputs and outputs to the appropriate pins of the analog switch IC.
Use the microcontroller code to toggle the digital control pins, which will control the analog switches and switch the analog signal paths.
Test and verify the operation of the circuit using appropriate measurement equipment and signal sources.
Refine the code and circuit as needed to optimize performance and meet the application requirements.

<expected payload dropped, and removed>

ElectricDruid


FSFX

#8
Quote from: ElectricDruid on February 22, 2023, 06:06:32 AM
Uh-oh! Looks like ChatGPT has found our forum!  >:(
Things like that always remind me of the saying about grandmothers and eggs.

FSFX

#9
Quote from: Annaberry on February 22, 2023, 12:58:50 AM
To use a microcontroller to switch analog topology, follow these general steps:
Choose an appropriate microcontroller with enough digital pins to control the analog switches you plan to use.
Select the analog switch IC that best suits your needs based on the specific application requirements, such as on-resistance, bandwidth, and package.
Connect the digital pins of the microcontroller to the appropriate control pins of the analog switch IC.
Connect the analog signal inputs and outputs to the appropriate pins of the analog switch IC.
Use the microcontroller code to toggle the digital control pins, which will control the analog switches and switch the analog signal paths.
Test and verify the operation of the circuit using appropriate measurement equipment and signal sources.
Refine the code and circuit as needed to optimize performance and meet the application requirements.

I didn't understand that.

Can you give us a schematic and an ER Diagram together with a Data Flow Diagram because pictures are easier for us all here to understand.

To be serous though, using I2C controlled devices means that you only need a low pin count microcontroller. For some switching, the analogue matrix switches can make interfacing and wiring far simpler. 

bluebunny

Quote from: ElectricDruid on February 22, 2023, 06:06:32 AM
Uh-oh! Looks like ChatGPT has found our forum!  >:(

The first line of that post reminds me of Eliza!  :icon_lol:
  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

PRR

> The first line of that post reminds me of Eliza!

I am sorry to hear that the first line of that post reminds you of Eliza.

Is it important to you that the first line of that post reminds you of Eliza?

  • SUPPORTER

bluebunny

  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...