Why does the 74HC4052N analog switch not work in this application?

Thread Starter

KeithWalker

Joined Jul 10, 2017
3,097
First, a bit of background; I have HP 403B Audio Oscillator. It is more than 50 years old and has given me marathon service but now it is getting unreliable and I can not get a replacement for the ganged potentiometer. I decided to make one of my own design. It does not need to be very accurate but must be reliable and simple to operate.
I chose a simple Wien Bridge circuit stabilised with signal diodes. It will be controlled by an Arduino micro so that I can control it with push buttons. I have it breadboarded and tested using digipots for the frequency setting and output level. They work well.
I planned on using a couple of analog switches to change the ranges. When I tested ten of them I got different results with each one I tried. They would work on one or two of the ranges but not all three. I now have it working because I replaced the analog switches with a couple of small DPDT 5 volt relays. The circuit of the oscillator is attached.
I know this is not a usual application for the switches but I can see no reason why they did not work. Am I overlooking a parameter or misinterpreting the spec sheet? Can anyone shed any light on this problem for me?
Regards,
Keith

AutoWein Bridge.jpg
 
Last edited:

crutschow

Joined Mar 14, 2008
34,466
What is the supply voltage to the switches, and what is the minus supply voltage?
The switch cannot switch signals below its negative supply rail, i.e. if the switch negative power connection is ground and the minus supply is below that, the switch will have a problem with anything below 0V.
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
First, a bit of background; I have HP 403B Audio Oscillator. It is more than 50 years old and has given me marathon service but now it is getting unreliable and I can not get a replacement for the ganged potentiometer. I decided to make one of my own design. It does not need to be very accurate but must be reliable and simple to operate.
I chose a simple Wien Bridge circuit stabilised with signal diodes. It will be controlled by an Arduino micro so that I can control it with push buttons. I have it breadboarded and tested using digipots for the frequency setting and output level. They work well.
I planned on using a couple of analog switches to change the ranges. When I tested ten of them I got different results with each one I tried. They would work on one or two of the ranges but not all three. I now have it working because I replaced the analog switches with a couple of small DPDT 5 volt relays. The circuit of the oscillator is attached.
I know this is not a usual application for the switches but I can see no reason why they did not work. Am I overlooking a parameter or misinterpreting the spec sheet? Can anyone shed any light on this problem for me?
Regards,
Keith

View attachment 204628

If I remember correctly, analog switches have significant internal resistance (although I guess "significant" depends on the rest of the circuit specs.)

How do the resistance specs on those switches compare to the resistance settings you're using on the digipots?
 

MrChips

Joined Oct 2, 2009
30,824
The first thing that comes to mind is capacitance.
What are the values of the capacitors in your circuit?
For CD74HC4052 you are looking at around 12pF at the outputs.

Next comes resistance. ON resistance varies from 60-200Ω.

Thirdly, it cannot handle negative voltages. (@crutschow beats me to it).
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
3,097
The first thing that comes to mind is capacitance.
What are the values of the capacitors in your circuit?
For CD74HC4052 you are looking at around 12pF at the outputs.

Next comes resistance. ON resistance varies from 60-200Ω.

Thirdly, it cannot handle negative voltages. (@crutschow beats me to it).
The circuit runs on a single 5 volt supply. IC1A splits the supply to give a ground at 2.5 volts. Therefore the supply is +2.5V, 0 , -2.5V. The analog switches are switching inside these voltages.
The capacitors are 0.1, 0.01 and 0.001uF so I don't think the chip capacitance would affect it enough to stop it working.
The ON resistance is the probable culprit. I was assuming that it would be negligible which is correct in the series positive feedback path from IC1A output but I overlooked the effect of series resistance in the parallel capacitor path to ground.
Thank you for your comments. I will now be able to sleep tonight and I don't have to scrap ten analog switch chips.
Regards,
Keith
 
Last edited:

crutschow

Joined Mar 14, 2008
34,466
I overlooked the effect of series resistance in the parallel capacitor path to ground.
One possible way around that is the put the capacitors in series between the amp (-) input and ground (from smallest to largest to ground) and use the switch to act as a tap to select the capacitors (something like below).
And it only requires one switch per range, not two.

Of course the smaller capacitor values will be some affected by the series values below, but hopefully you can compensate for that..

1587150067456.png
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
3,097
The LM358 is not a rail-to-rail opamp. Is that an issue?
That is not an issue thanks Alec. I designed it to give an output of 2V pk-pk. The clipped output from IC2B is large enough for the arduino to measure the positive and negative half cycle periods to determine the frequency to be displayed.
Keith
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
3,097
One possible way around that is the put the capacitors in series between the amp (-) input and ground (from smallest to largest to ground) and use the switch to act as a tap to select the capacitors (something like below).
And it only requires one switch per range, not two.

Of course the smaller capacitor values will be some affected by the series values below, but hopefully you can compensate for that..

View attachment 204643
Thank you. That is an interesting possibility. I will experiment with it.
Regards,
Keith
 
Top