Starting the Digital Control of Analog Pedal 1st project

Started by Esppse, July 13, 2024, 12:28:54 AM

Previous topic - Next topic

Esppse

A couple weeks back I started this thread:

https://www.diystompboxes.com/smfforum/index.php?topic=132090.20

After much consideration, I will be attempting to implement digipots (gain/tone knobs) and relays (bypass/functions) along with an Arduino Nano controller. I think LDRS may be a better option in the future, but I think it'll be a bit quicker to work with digipots first. This will limit the project to 10K, 50k, 100k pot circuits, but there are plenty of fuzzes and distortions in this range.

Goal: Midi CC control over DOUBLE FUZZ Module. I will not be using pots for the physical control of the microcontroller for now so I can progress along a bit quicker. Distortion module will work like a VST plugin almost. I will be making a CTRLR VST. Everytime a DAW session starts up, the CTRLR will shoot the Midi CC values to the module immediately for DAW session recall. In the future, if someone wants to implement the physical control of values and maybe even program changes, that'll be nice. I'll post all the information as I go along.

I have chosen these 2 fuzzes to put in one box. Actually took longer than I though to scour for 100k and lower fuzzes. BMP can work too, but these are more interesting. Relays will control true bypass.

https://tagboardeffects.blogspot.com/2012/03/devi-ever-hyperion.html
https://tagboardeffects.blogspot.com/2014/02/black-arts-toneworks-fnord.html
 

For digipots, there are SMD and PDIP options, I will start with the PDIP so it is breadboardable.
I have put together a shopping list here for some parts, I am uncertain about the specs on a couple:

=== DIGIPOTS ===
PDIP Options:
https://www.mouser.com/ProductDetail/Microchip-Technology/MCP4261-502E-P?qs=sGAEpiMZZMsX%252BY3VKDPZyDPfa3tSyDkahSdIQXSog6w%3D
https://www.mouser.com/ProductDetail/579-MCP42010-I-P
https://www.mouser.com/ProductDetail/579-MCP42050-I-SL
https://www.mouser.com/ProductDetail/579-MCP42100-I-P

SMD Options (QUAD pot in 1 chip):
https://www.mouser.com/ProductDetail/579-MCP4342-103E-ST
https://www.mouser.com/ProductDetail/579-MCP4342-503E-ST
https://www.mouser.com/ProductDetail/579-MCP4342-104E-ST

SMD High Voltage (1 pot, but can handle higher voltage)
https://www.mouser.com/ProductDetail/579-MCP41HV51-103EST
https://www.mouser.com/ProductDetail/579-MCP41HV51-503EST
https://www.mouser.com/ProductDetail/579-MCP41HV51-104EST

RELAYS:
https://www.mouser.com/ProductDetail/769-TX2-5V
https://www.mouser.com/ProductDetail/769-TX2-12V


Questions and uncertainty:
1. Since my Arduino will be fed 5v, should the relays also be in the 5v range? I have seen a lot of circuits using a 12V one.
2. Are these circuits 5v friendly at the pots? I don't want to burn the chip out. I have found the higher voltage variants of these digipots in SMD form, but they have less pots integrated into 1 chip, and therefore are more expensive.
3. Are there any other recommendations for parts for this project?

ElectricDruid

Quote from: Esppse on July 13, 2024, 12:28:54 AM1. Since my Arduino will be fed 5v, should the relays also be in the 5v range? I have seen a lot of circuits using a 12V one.
I tried using a 5V relay with a uP and found that the uP's output pin couldn't provide enough current to make it switch reliably. So I finished up having to use a driver transistor. And if you're using a driver transistor, it doesn't really matter whether the relay is 5V or 12V, since the supply to the transistor no longer has to be the same as the uP.
Quote2. Are these circuits 5v friendly at the pots? I don't want to burn the chip out. I have found the higher voltage variants of these digipots in SMD form, but they have less pots integrated into 1 chip, and therefore are more expensive.
Since the circuits are running on 9V, the default answer is "No". In practice, you might be able to get away with it for some circuits. The Hyperion looks like it might be ok, if this schematic I found is right:



There's no DC on either pot, so that helps. Whether the signal level goes outside the 0-5V range I don't know. The bottom of the two digipots might need to be biased to 2.5V instead of ground to ensure there's enough headroom for an AC signal. Tied to actual ground, the AC will go below 0V, which is out of range for a digipot.

The Fnord looks a lot more difficult, unless you convert it for 5V:

https://i.pinimg.com/736x/36/c8/fe/36c8fefe9f859e3398258bab598e942a.jpg

Quote3. Are there any other recommendations for parts for this project?
Sorry, I don't know.

Esppse

Quote from: ElectricDruid on July 13, 2024, 05:35:20 AM
Quote from: Esppse on July 13, 2024, 12:28:54 AM1. Since my Arduino will be fed 5v, should the relays also be in the 5v range? I have seen a lot of circuits using a 12V one.
I tried using a 5V relay with a uP and found that the uP's output pin couldn't provide enough current to make it switch reliably. So I finished up having to use a driver transistor. And if you're using a driver transistor, it doesn't really matter whether the relay is 5V or 12V, since the supply to the transistor no longer has to be the same as the uP.
Quote2. Are these circuits 5v friendly at the pots? I don't want to burn the chip out. I have found the higher voltage variants of these digipots in SMD form, but they have less pots integrated into 1 chip, and therefore are more expensive.
Since the circuits are running on 9V, the default answer is "No". In practice, you might be able to get away with it for some circuits. The Hyperion looks like it might be ok, if this schematic I found is right:



There's no DC on either pot, so that helps. Whether the signal level goes outside the 0-5V range I don't know. The bottom of the two digipots might need to be biased to 2.5V instead of ground to ensure there's enough headroom for an AC signal. Tied to actual ground, the AC will go below 0V, which is out of range for a digipot.

The Fnord looks a lot more difficult, unless you convert it for 5V:

https://i.pinimg.com/736x/36/c8/fe/36c8fefe9f859e3398258bab598e942a.jpg

Quote3. Are there any other recommendations for parts for this project?
Sorry, I don't know.

Thanks for the detailed reply. I may only do the Hyperion first because of voltage concerns.

To check voltage limits, do I just simply measure the pot terminals at minimum and maximum values? Where/how do AC voltages come into play and become a concern if we are starting with a 9vDC supply?

Esppse

Ok the first half of this journey is done. I have built 16 fuzzes and will implement digital control to all of them.

I need some help with Multiplexers here. There are going to be 60-ish digital control lines: 21 Relays, and between 10-30 Digipot chips (some are Quad Pot digipot with 4 on one chip, others require high voltage tolerance and will have 1 pot per chip.)

There are 2 multiplexers I am looking at.

https://www.mouser.com/ProductDetail/863-MC74HC4067ADWR2G
https://www.mouser.com/ProductDetail/Analog-Devices-Maxim-Integrated/DG1206EUI%2b?qs=DPoM0jnrROUNfn6dewtC4Q%3D%3D

What confuses me about these 2 is that they both have 16 multiplexer inputs, however, one of them is a 4 channel, the other is a 16 channel.

Will the lower cost 4 channel one work with digipots or do they actually need 1 channel per input?

ElectricDruid

What exactly are you intending to do with the multiplexers? Do the digipots you've used have no "select" inputs or no way to series-connect them?

The 74HC4067 is a modernised 74HC version of the old CMOS 1-to-16 4067 switch:

https://www.ti.com/lit/ds/symlink/cd4067b.pdf

That's ok at 5V logic voltages, but won't go higher.

The DG1206 is part of the modern DG series switches which are more aimed at audio and can take +/-15V rails while using 5V control logic. This combination is pretty handy!

I'm not seeing a "4 channel" switch anywhere. The DG1206 datasheet includes details for the DG1207 dual 1-to-8 switch. I doubt that's what you need, but depending how you organise things, perhaps it could be.



PRR

Quote from: ElectricDruid on August 06, 2024, 05:21:20 AMI'm not seeing a "4 channel" switch anywhere.

His Mouser link https://www.mouser.com/ProductDetail/863-MC74HC4067ADWR2G says
Number of Channels:    4 Channel   
Configuration:    4 x SPST
I don't see that on the actual datasheet. Mouser mistake?


  • SUPPORTER

ElectricDruid

Quote from: PRR on August 06, 2024, 02:17:22 PMHis Mouser link https://www.mouser.com/ProductDetail/863-MC74HC4067ADWR2G says
Number of Channels:    4 Channel   
Configuration:    4 x SPST
I don't see that on the actual datasheet. Mouser mistake?

Ah, thanks Paul! I just opened the link and then read the datasheet. I didn't see the mouser "details".

Looks like a mouser database error to me, like you say.

Esppse

Quote from: ElectricDruid on August 06, 2024, 05:21:20 AMWhat exactly are you intending to do with the multiplexers? Do the digipots you've used have no "select" inputs or no way to series-connect them?

The 74HC4067 is a modernised 74HC version of the old CMOS 1-to-16 4067 switch:

https://www.ti.com/lit/ds/symlink/cd4067b.pdf

That's ok at 5V logic voltages, but won't go higher.

The DG1206 is part of the modern DG series switches which are more aimed at audio and can take +/-15V rails while using 5V control logic. This combination is pretty handy!

I'm not seeing a "4 channel" switch anywhere. The DG1206 datasheet includes details for the DG1207 dual 1-to-8 switch. I doubt that's what you need, but depending how you organise things, perhaps it could be.




Since there are so many lines to control, I cannot hook all of them directly to an Arduino, so I think avoiding multiplexers is impossible.

I am using Microchip digipots:

https://www.mouser.com/new/microchip/micro-mcp434x-mcp436x-potentiometers/

I am not sure if they can be connected in series.

The 4067 multiplexer has 4 switches and uses some sort of logic table to be able to address 16 inputs. The Analog Devices multiplexer has 16 switches internally but is much more expensive.

What do you think would be the best application in this case?

FiveseveN

Quote from: Esppse on August 06, 2024, 10:59:40 PMsome sort of logic table
It's just a binary counter, my dude. 4 bits = 2^4 = 16 possible values.

QuoteI am not sure if they can be connected in series.
That is what SPI is for. It uses a Chip Select line to pick which device you're talking to: SPI tutorial. Though you'll still need muxes or better yet shift registers if you're going to control up to 30 pots.
Speaking of which, are you sure you want to jump in the deep end like that and not start with something simpler?
Quote from: R.G. on July 31, 2018, 10:34:30 PMDoes the circuit sound better when oriented to magnetic north under a pyramid?

Esppse

Yeah I definitely want to go big hah. I originally planned like 2 fuzzes... but I couldn't stop building fuzzes and wound up with 16. There are multiples on a each veroboard.

So muxes are not required if I use shift registers? Is there a reason these would work better? I only have experience with Muxes when building a midi keyboard. It seems I need the Parallel In Serial Out version of the shift register chip.

There are basically only 2 things for the coding side:
1. Relay Midi Implementation
2. Digipot Midi Implementation

Once those 2 are programmed, it doesn't matter how many circuits since the only different thing between them is the assigned midi CC, right?

I may do a test run on a single overdrive/fuzz to make sure True Bypass and Parameter Change is working correctly first.

FiveseveN

Quote from: Esppse on August 07, 2024, 03:00:54 AMIs there a reason these would work better?
You can chain them and have as many outputs as you want using only 3 pins on the uC. And since you only need outputs there's no need for bilateral switches.
QuoteIt seems I need the Parallel In Serial Out version
No, other way around: Serial to Parallel Shifting-Out with a 74HC595
Quoteit doesn't matter how many circuits since the only different thing between them is the assigned midi CC, right?
Sure, it's just harder to debug when you have to check more connections. Conceptually, going from one fuzz to many should be easy. I guess you can build it up as you go along.
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

There's another possibility which saves the shift registers.

Those Digipot chips have a !CS chip select pin, but they also have an SDO Serial Data Out pin. You can simply chain them in series (SDO of one chip to SDI of the next, with SCLKs all in parallel) and feed the data in at one end and reprogram all the pots in one go. I've done this once with four chips in a line.

That said, using the chip selects is more flexible, since you don't have to send a lot of data if you only want to reprogram one pot - it's more directed.

Esppse

Quote from: ElectricDruid on August 07, 2024, 04:40:55 AMThere's another possibility which saves the shift registers.

Those Digipot chips have a !CS chip select pin, but they also have an SDO Serial Data Out pin. You can simply chain them in series (SDO of one chip to SDI of the next, with SCLKs all in parallel) and feed the data in at one end and reprogram all the pots in one go. I've done this once with four chips in a line.

That said, using the chip selects is more flexible, since you don't have to send a lot of data if you only want to reprogram one pot - it's more directed.


Hmm very interesting. There are many ways to doing this.

Since I have already 22 relays required for the project, I think the Shift Register method may definitively be required, at least for that half of things.

Is there a limit to how many Digipots can be daisy chained like that in serial? Kind of scary to have 30 in line, I'm not sure if there would be any signal degradation by the last one.

PRR

> already 22 relays required

In the 1950s, "logic minimization" was a hot topic. Combining logic gates so as to need the fewest possible. It is hard for me to imagine needing 4,194,304 different states on a musical stage. OTOH "simplification" can lead to confusing design and construction- by the 1970s it was common to use a too-big chip and ignore half its states just to keep things manageable ($2 more for the chip might save a $12 hour of thinking/wiring).

I'd echo FiveseveN's tip about the deep end.

> how many Digipots can be daisy chained

It's probably regenerated (buffered) at every chip? I remember passive fan-outs of M2L (Mickey-Mouse Logic) diode arrays but that is so 1969. How about your PC? You type a number, it goes to RAM, it goes to storage drive, it comes back to RAM-- if you are working payroll or balancing a checkbook it can be daisy-ed thousands of times.
  • SUPPORTER

ElectricDruid

Quote from: Esppse on August 07, 2024, 12:54:02 PMIs there a limit to how many Digipots can be daisy chained like that in serial? Kind of scary to have 30 in line, I'm not sure if there would be any signal degradation by the last one.

The signal will definitely be buffered from one chip to the next, so there won't be significant signal degradation, I wouldn't think. What there might be is some propagation delay. That would affect the maximum speed you can run the SPI at, since the clock and the data will eventual get out of phase. But since the maximum SPI speed is 10MHz for those digipots, I think you'd find you can still run it "fast enough", even if you have to slow it down a bit. TBH, I don't think I've ever run an SPI connection at full speed. It's very rarely actually necessary, and going slower gives you more margin for error.

Let's do a bit of back-of-the-envelope calculation:

Each chip needs either 8 or 16 bits for a command. You have 30 in a chain. That's a maximum of 30 x 16 = 480 bits. Let's say we wanted to update everything 100 times a second. That's every 10msecs.
At 1MHz, 480 bits takes 1usec x 480 = 480usecs to send, less than 0.5msecs. So even at 1/10th of the maximum SPI clock, we're still *way* within our "100 updates per second" specification.

This is why I've never finished up actually *needing* to push SPI to its limits, nor even got close. It's plenty fast anyway.
If you're reading data from MIDI, how fast you send it out to the pots isn't going to be an issue, because you're going to end up hanging around waiting for new data to come in via the MIDI UART.



Esppse

Quote from: ElectricDruid on August 07, 2024, 06:39:14 PM
Quote from: Esppse on August 07, 2024, 12:54:02 PMIs there a limit to how many Digipots can be daisy chained like that in serial? Kind of scary to have 30 in line, I'm not sure if there would be any signal degradation by the last one.

The signal will definitely be buffered from one chip to the next, so there won't be significant signal degradation, I wouldn't think. What there might be is some propagation delay. That would affect the maximum speed you can run the SPI at, since the clock and the data will eventual get out of phase. But since the maximum SPI speed is 10MHz for those digipots, I think you'd find you can still run it "fast enough", even if you have to slow it down a bit. TBH, I don't think I've ever run an SPI connection at full speed. It's very rarely actually necessary, and going slower gives you more margin for error.

Let's do a bit of back-of-the-envelope calculation:

Each chip needs either 8 or 16 bits for a command. You have 30 in a chain. That's a maximum of 30 x 16 = 480 bits. Let's say we wanted to update everything 100 times a second. That's every 10msecs.
At 1MHz, 480 bits takes 1usec x 480 = 480usecs to send, less than 0.5msecs. So even at 1/10th of the maximum SPI clock, we're still *way* within our "100 updates per second" specification.

This is why I've never finished up actually *needing* to push SPI to its limits, nor even got close. It's plenty fast anyway.
If you're reading data from MIDI, how fast you send it out to the pots isn't going to be an issue, because you're going to end up hanging around waiting for new data to come in via the MIDI UART.




Ah ok thats good to know. Yeah very new at this digital stuff.


I ran into one problem during this project though on the analog side:

I am adding a Vox tone stack somewhere in the middle here.

https://www.guitarscience.net/tsc/vox.htm#RIN=0&R1=100k&R2=10k&RT=1M&RB=1M&RL=600k&C1=22P&C2=22n&C3=47N&RB_pot=LogA&RT_pot=LogA

It uses 1Meg pots.

I looked around and there was only the Analog Devices that did a 1M digipot. Literally only 4 results showed up on Mouser for a 1M digipot. Crazy how no one has needed higher resistance digipots?!?

I am trying to find a workaround for this but am a bit stumped.

On one circuit, I am going to use an LDR because it has a 1M gain pot, but that is only a 2 terminal situation. This Vox tone stack uses all 3 terminals of the Pot so an LDR doesn't seem possible with it right?

ElectricDruid

You could try scaling all the resistors down by a factor of ten, and then scaling the capacitors up by the same factor of ten to compensate:

https://www.guitarscience.net/tsc/vox.htm#RIN=0&R1=10k&R2=1k&RT=100K&RB=100K&RL=60k&C1=220P&C2=220n&C3=470N&RB_pot=LogA&RT_pot=LogA

It might change the way the circuit will react to stuff around it (perhaps - depends what that is) since it changes the impedance of the whole tone stack but it gives the same frequency response. Compare the two versions side by side.

Esppse

Quote from: ElectricDruid on August 10, 2024, 02:01:51 AMYou could try scaling all the resistors down by a factor of ten, and then scaling the capacitors up by the same factor of ten to compensate:

https://www.guitarscience.net/tsc/vox.htm#RIN=0&R1=10k&R2=1k&RT=100K&RB=100K&RL=60k&C1=220P&C2=220n&C3=470N&RB_pot=LogA&RT_pot=LogA

It might change the way the circuit will react to stuff around it (perhaps - depends what that is) since it changes the impedance of the whole tone stack but it gives the same frequency response. Compare the two versions side by side.


Wow fascinating! Had no idea you can do that.

I am putting a Subminiature tube boost in front of it.

https://www.diystompboxes.com/smfforum/index.php?topic=70524.0

I've built a couple, they are nice. In this situation I want a very chimney clangy sound to come out post boost, so the next pedal in line has a very bright "pre eq" curve. Basically I am trying to make a bridge PAF humbucker sound like a neck single coil so I need quite a drastic mid scoop. My main guitar only has 1 pickup. I wasn't sure on the exact frequency to scoop, but a Vox frequency response is in the right direction I think. This definitely solves the digipot compatibility problem!

ElectricDruid

Quote from: Esppse on August 10, 2024, 04:50:36 AMWow fascinating! Had no idea you can do that.
It's a handy trick! The basic idea is that the filter frequency is proportional to R x C, and that's almost always true (works for LFOs, filters, tone controls, etc etc) so if you divide one down and multiply the other, you can change the values without changing the frequency.

QuoteI am putting a Subminiature tube boost in front of it.

https://www.diystompboxes.com/smfforum/index.php?topic=70524.0
In the schematic, that's driving a 100K volume control. The adjusted tone stack is going to have a impedance more like 10K, so I'm not sure if that's going to make a big difference or not. I'm guessing not. Changing the RL load resistance value in the sim doesn't make a huge change, but in this case we're wondering about the Rin source impedance, which we don't really know.

QuoteI've built a couple, they are nice. In this situation I want a very chimney clangy sound to come out post boost, so the next pedal in line has a very bright "pre eq" curve. Basically I am trying to make a bridge PAF humbucker sound like a neck single coil so I need quite a drastic mid scoop. My main guitar only has 1 pickup. I wasn't sure on the exact frequency to scoop, but a Vox frequency response is in the right direction I think. This definitely solves the digipot compatibility problem!
Well, certainly give it a try.