how to do low voltage analog switching?

Hi,
I would like to do some switching of the audio signal on-board an electric guitar, direct from the pickups to route the signals.

I would command the switches from an Arduino.

I will need 15 SPST switches to handle tiny analog voltages maxing around 1V, but more typically 120mV.

I have considered reed relays, but then came across "analog switch IC" and thought that would be more efficient and take less space and power. Also, I fear that the magnetic fields in the relays would create lots of parasite noise, but maybe that is not the case? The reed relays are quite big, too.

Honestly, I have read all about analog switch IC's all over the net, but they remain mysterious to my novice level electronics knowledge.

Can anyone suggest a 4 SPST analog switch that would be able to turn on/off that kind of signal? I would guess that low on-resistance is important, but I don't know how low is low? 100ohm, 10 ohm, 1 ohm?

Also, how would these be controlled by the Arduino? SPI ?

How many Arduino Pins would be involved to control 15 SPST switches? would I have to add a shift register as well?

The rest of my circuit requires 3 6-channel digital potentiometers that are controlled by SPI. So 3 pins are taken... Ideally, I would like to control everything by SPI if possible...

Any advice, suggestions or even an answer would be a huge help to me!

Thanks so much for this great forum!
Ciao,
Bob

gratefulfrog:
Can anyone suggest a 4 SPST analog switch that would be able to turn on/off that kind of signal?

Try 74HC4066, http://www.nxp.com/documents/data_sheet/74HC_HCT4066.pdf.

gratefulfrog:
Also, how would these be controlled by the Arduino? SPI ?

If you want to control each switch independently, just wire the control inputs to 4 Arduino pins.

gratefulfrog:
How many Arduino Pins would be involved to control 15 SPST switches? would I have to add a shift register as well?

15 pins, if you want to control them independently. No problem if you have a Mega, but otherwise you may want to use a couple 74HC595 shift registers to drive them instead.

HI!

Thank you so much for your reply! I am sorry to be so ignorant in this area, but I am learning quickly!

dc42:
Try 74HC4066, http://www.nxp.com/documents/data_sheet/74HC_HCT4066.pdf.

So you think that 50 ohm on-resistance is ok? I fear that all those 50 ohms in series will really dampen the output? But I guess the only thing to do is to test it?

If this is really a feasible choice, what if I were to need 30 switches which is the maximum number theoretically possible. I am planning on putting this into an electric guitar with an Arduino Micro, 3 digital pots (6 channels each) and a bluetooth module running from a 9V battery.

Will Arduino Micro be able to power all that?

Here's the web page which explains my first prototype: www.arduguitar.org

Thanks so much for your help!
Ciao,
Bob

gratefulfrog:
So you think that 50 ohm on-resistance is ok? I fear that all those 50 ohms in series will really dampen the output? But I guess the only thing to do is to test it?

Whether there is too much resistance will depend on how you are wiring the switches and the impedance of the circuit you are using the switches in. But you haven't told us anything about the circuit that the switches will be in, except that it is related to an electric guitar. You could always try wiring some resistors in the places that the switches will be, to see what resistance you can tolerate.

gratefulfrog:
If this is really a feasible choice, what if I were to need 30 switches which is the maximum number theoretically possible. I am planning on putting this into an electric guitar with an Arduino Micro, 3 digital pots (6 channels each) and a bluetooth module running from a 9V battery.

Will Arduino Micro be able to power all that?

Yes. To drive 30 switches you can use a chain of 4 shift registers.

Wow, thank you for all this help!

dc42:
Whether there is too much resistance will depend on how you are wiring the switches and the impedance of the circuit you are using the switches in.

I am really not sure what info would help you help me. The guitar pickups are composed of coils which will be connected together in various sequences (series, parallel) by the switches. This table gives an overview of typtical coil specs: Seymour Duncan Guitar Pickups, Bass Pickups, Pedals | Seymour Duncan

I have been building prototoypes where all the mechanical switches are replaced by circuits. So far, I have kept it very simple, using Vactrols as SPST switches with 80 ohm on-resistance. This works ok, but I have not tested in more advanced switching configs yet. Vactrols need 5V and 30-40mA to act like an "on" switch so 30 of them would probably kill the Arduino, I guess?

Does that tell you enough about my circuit? I'm happy to tell all I know, but it's painfully little...

Thanks again !
Ciao,
Bob

All those pickup coils have a DC resistance of 2.4Kohms or more, so a couple of hundred ohms extra won't make a significant difference.

Great!!! I will start the next version!

You have been really helpful!

Thanks so much!
Ciao,
Bob

Hi DC42,

I was looking at those 74HC4066 switches. Actually according to the datasheet, it seems that they do not switch negative voltages?

My signal from the pickups varies from -1.5v to +1.5v so I need a switch that can handle that.

I've seen some that look ok, like this one MAX4677-79 (see http://datasheets.maximintegrated.com/en/ds/MAX4677-MAX4679.pdf) but these all require a NEGATIVE voltage supply in addition to the positive supply...

So my new question is how to provide -5v along with th 5v to power the analog switch? Use a voltage inverter IC? how can this work??

Any thoughts?

Cheers,
Bob

gratefulfrog:
I was looking at those 74HC4066 switches. Actually according to the datasheet, it seems that they do not switch negative voltages?

To switch negative voltages, you can connect the ground pin to a negative supply. For example, connect its ground pin to -2V. The 74HC4066 can cope with up to 10V between Vcc and ground.

The issue you then face is that the switch control input to the 74HC4066 should ideally swing between its ground pin and its Vcc pin. There are a couple of ways to address this:

  1. Use a level-shifting circuit, which you can make from a PNP transistor and a couple of resistors.

  2. If the 74HC4066 ground pin is no more negative than about -2.0V, then you can drive the control inputs direct from an Arduino, because an input at Arduino ground level (2V above 74HC4066 ground pin) will still be recognised as a LOW.

btw if you don't have a negative voltage supply available, you can generate a low-current negative supply for this sort of application using a spare Arduino PWM output, 2 diodes, 2 capacitors and a resistor.

Hi!
Thanks for that. So I understand that it is possible to make it work, but I still have no real clear idea how to do it...

I was thinking about connecting a voltage inverter to the +5v to get -5 then use one of the MAX4677-79 type switches but I hadn't understood that the logic also depends on the supply voltage...

This is really hard for me to grasp, sadly. And you seem like a wizard!

Could you give more details on how to make a negative power supply, please? But I want to avoid PWM because it causes parasites to be picked up in the circuit - I have that problem already in the current version, so I am going to use digital pots instead...

Thanks again!
Ciao,
Bob

gratefulfrog:
Could you give more details on how to make a negative power supply, please? But I want to avoid PWM because it causes parasites to be picked up in the circuit - I have that problem already in the current version, so I am going to use digital pots instead…

What do you mean by “parasites”? What have you tried using PWM for? If PWM is causing interference to other parts of the circuit, then that is probably due to poor ground wiring, or possibly poor supply wiring. In applications with an audio path (such as yours), it may be helpful to increase the PWM frequency to above the audible range.

Attached is a schematic for generating a low-current (few mA at most) negative supply. It generates about -3V using regular silicon diodes such as 1N4148, or about -4V using Schottky diodes such as BAT85. Do an analogWrite(128) to the pin. If you decide to increase the PWM frequency, you can reduce the values of the capacitors in proportion.

Thanks! I will try to understand that diagram.

In my current circuit I use 2 vactrols (LED-LDRs) to make a potentiometer. The LED brightness is controlled by PWM which I have tweaked after lots of experimenting to "phase-correct" PWM at the highest frequency available on my Arduino Micro. I think the grounding is correct. Still sometimes I get a high pitched whistle through the amp. It I turn the PWM "off" by setting the analog out pins appropriately, the whistling stops.

I don't know what is happening, maybe the pulsing leds, pulse the photo-resistors and that frequency gets into the signal? I think that it is more likely that the guitar pickup coils are acting like antennae picking up the radio-waves generated by the Arduino...

I'm really trying to get the PWM out of my circuit to clean up the sound...

Is there any other way of making -4V? maybe use a chip?

You are really kind to help me so much. I am sorry for my ignorance - if only I had paid attention at school electronics class...
Ciaon
Bob

gratefulfrog:
In my current circuit I use 2 vactrols (LED-LDRs) to make a potentiometer. The LED brightness is controlled by PWM which I have tweaked after lots of experimenting to "phase-correct" PWM at the highest frequency available on my Arduino Micro. I think the grounding is correct. Still sometimes I get a high pitched whistle through the amp. It I turn the PWM "off" by setting the analog out pins appropriately, the whistling stops.

The LED will be pulsing at the PWM frequency. Although LDRs do not react instantaneously to changes in light level (especially at low light levels), their resistance will change in time with the PWM frequency. So that arrangement will inevitably cause the PWM frequency to feed through to the audio, unless you either smooth the PWM before it reaches the LEDs, or increase the PWM frequency to above the audible range. Digital potentiometers or programmable-gain amplifiers are a better solution.

Using a PWM pin to generate -3V for the chip is an entirely different matter and should not give rise to problems unless you are careless with the ground wiring. Still, increasing the PWM frequency to above audible would be a good idea.

Thanks again!

Do you think your little -3v generator be able to provide -3v to all my analog switches? I need 10 quad analog switches (most likely the MAX4677-79) for my full application..

I've seen that IC's seem to exist to provide negative voltage as well.

Before forget, an analog signal expert told me that I should put a zero gain buffer on the output of each pickup for some reason. I believe he was concerned by noise in all the IC's. What do you think?

I'm sorry to have to ask so many questions... but you can't imagine how confusing this is for me...

Thanks again,
Bob

I’ve attached a high level schematic of the circuit so that we can both understand (I have a hard time using that word for my own comprehension ;-)of the circuit.

Any thoughts?

Cheers,
Bob

3HumbuckerArchitecturalComponents.pdf (26.4 KB)

gratefulfrog:
Do you think your little -3v generator be able to provide -3v to all my analog switches? I need 10 quad analog switches (most likely the MAX4677-79) for my full application..

Yes. Those ICs need a maximum of 1uA from the negative rail.

gratefulfrog:
I've seen that IC's seem to exist to provide negative voltage as well.

Yes, ICs such as the MAX828 and MAX829 work on a similar principle to my schematic. However they use synchronous rectification, so they produce a greater negative voltage (i.e. very nearly -5V out for 5V in). Of those two, the MAX829 would be best for your application because its switching frequency is above the audible range.

gratefulfrog:
Before forget, an analog signal expert told me that I should put a zero gain buffer on the output of each pickup for some reason. I believe he was concerned by noise in all the IC's. What do you think?

I can see what he is getting at, however I think you will be OK without since you won't (I presume) be turning the switches on and off at audible frequencies. If you want to use the switches to connect pickups in series, then you can't buffer them all anyway.

Hi Thanks so much!

I'm trying to avoid PWM if possible. But on your circuit, by the way, I couldn' read the values on the Resistor and the 2 capacitors? Was that 100ohm resistor and 100 µF for both caps ?

This is really getting exciting! I can feel the circuit laying itself out before my eyes, or I should say, I can see you laying the circuit out before me :wink:

I saw that this circuit is required for the MAX829. Do you know what capacitor values it requires?

I am starting to feel a bit uncomfortable asking so many questions of a single person!

You are really saving my project!

Thanks,
Bob

Ooops. I may have spoken too soon. Those MAX chips only seem to come in surface mount which is nearly impossible for a hacker like me....

Do you have any suggestions for similar with through hole mount? I saw the TC-1044 on uk-rs http://docs-europe.electrocomponents.com/webdocs/11b5/0900766b811b5b9f.pdf that can be boosted to 45kHz by connecting the frequency boost pin to Vin...

Or maybe this baby the TC7660H http://ww1.microchip.com/downloads/en/devicedoc/21466a.pdf running at 120kHz ..

I wish I knew what any of this means :wink:

Cheers,
Bob

gratefulfrog:
I’m trying to avoid PWM if possible. But on your circuit, by the way, I couldn’ read the values on the Resistor and the 2 capacitors? Was that 100ohm resistor and 100 µF for both caps ?

Yes. Although with only 5uA or so total load, you could reduce the caps to 10uF.

A Cd4053 might be a better choice it’s a triple pole 2 position switch that was designed to switch bi-polar signals below ground by connecting the Vee lead to a voltage a volt or so lower that the most negative signal being switched… I usually use an L1044/ICL7660. The Maxim part is a little easier to use and about 10 years newer… Will give you a -5V supply from a + 5V supply with a couple of .1uF caps and there is another non obvious +/- 10- 12 V source that can be made from a MAX232 RS232 adapter and is good for the current that the CD4053 draws… data sheets for the CD4053, MAX232 and LT1044 attached…

Doc

LT1044.pdf (105 KB)

CD405X.pdf (193 KB)

max232.pdf (117 KB)