Go Down

Topic: how to do low voltage analog switching? (Read 10992 times) previous topic - next topic

gratefulfrog

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

dc42


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.


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.


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

gratefulfrog

HI!

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


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

dc42


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.


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

gratefulfrog

Wow, thank you for all this help!


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: http://www.seymourduncan.com/products/redesign/specifications/

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

dc42

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

gratefulfrog

Great!!!   I will start the next version! 

You have been really helpful!

Thanks so much!
Ciao,
Bob

gratefulfrog

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

dc42


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

gratefulfrog

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

dc42


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

gratefulfrog

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

dc42


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

gratefulfrog

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

gratefulfrog

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

Go Up