Switching with CD4066

Thread Starter

hamopp

Joined May 13, 2009
68
Hi All

Can anyone have a look at this circuit and tell me if there are any probs
with it ?

I think that there might be a prob with the audio outputs to the audio amp, as they are joined.

Thanks
Howard
 

k7elp60

Joined Nov 4, 2008
562
Since you are using analog signals, I assume you are suppling +5V to pin 14, and -5V to pin 7 of the 4066. You also need to pull the control lines of the the 4066 with pull down resistors to the pin 7 voltage to insure that the internal switches are off.
 
Last edited:

Thread Starter

hamopp

Joined May 13, 2009
68
Hi
I assume you are supplying +5V to pin 14, and -5V to pin 7 of the 4066
Do you mean a split rail supply +/- 5v ??

The supply i'am useing for the 4066's is +12v with 0v ground and the switch
control voltage is +12v from a UDN2981A, which is driven from a PIC16F628P
the UDN2981A was used to drive relays, but i want to use the 4066's instead!
You also need to pull the control lines of the the 4066 with pull down resistors to the pin 7
Can you suggest a value for R1/R2 pull down resistors ??

Thanks
Howard

Here is a updated circuit:
 

SgtWookie

Joined Jul 17, 2007
22,230
You will need to AC couple the audio signals, and bias them at Vdd/2. Otherwise, you will have clipping. You will also need to AC couple the outputs.

I hope you are dealing with line-level audio (10k Ohm impedance). The 4066's have too much resistance to be used with greater than line-level signals.

try using 2.2k for your pull-down resistor. That will give roughly 5.6mA current max through your 1N4148 diodes.
 

Thread Starter

hamopp

Joined May 13, 2009
68
Hi

SgtWookie
You will need to AC couple the audio signals, and bias them at Vdd/2. Otherwise, you will have clipping. You will also need to AC couple the outputs.
How do you do that ??, can you give me some idea ??

I hope you are dealing with line-level audio (10k Ohm impedance)
Yes audio is at line level.

Thanks
Howard
 

SgtWookie

Joined Jul 17, 2007
22,230
More like the attached.

[eta]
Corrected attachments; first upload had audio inputs connected to C instead of A

[eta]
R1 limits the inrush current when the mux is first turned on, and helps to decrease noise from the supply. The R1/C1 combo will be reasonably effective in removing large transients.

C2 is the bypass cap for IC1, the 4066.

C3 is the bypass cap for IC2, the TL072.

R2 and R3 form a voltage divider from Vdd (12v) to Vss (GND); you'll get roughly 6v at the junction.
C4 and C5 keep the voltage level constant. You may find that C4/C5 don't provide enough decoupling for the audio. In that case, use an opamp as a buffer to keep the level stable.

R4 through R7 keep the inputs biased to nominally Vdd/2, and provide a 10k input impedance.
C6 through C9 provide AC coupling of the input signal. Note polarity. You can use non-polarized caps, which is preferable.

R10 and R11 are the pull-down resistors for the select inputs.

IC2A and IC2B are unity-gain buffers/voltage followers. Since their input impedance is so high, the 200-500 Ohm resistance of the 4066 switch is made inconsequential.

C101 and C102 provide AC coupling to your amp. You may wish to change R101 and R102 to 10 MEG simply to prevent the outputs from floating when disconnected. Using 10k there really wasn't such a great idea.

[eta]
The schematic was captured using Cadsoft Eagle 4.16r2. You can view/modify it with that version or any higher version.

I used some RCA jacks I had in a library for the inputs, but left the outputs as wirepads (wirepad.lbr). Change to suit your application.
Note that if you assign the NAME field of a wirepad as your signal name, it will show up on the tdocu layer, which is handy.

VDD/VSS are used in the library models for the 4066 supply pins, and +V/-V are used for the library models for the TL072. JP1 and JP2 are zero-Ohm resistors. Eagle will complain bitterly if you connect two different supply signals on one wire, and you will have problems if you do.

Going back to the design - you may actually wish to leave R101 and R102 at 10k, or even go somewhat lower (down to maybe 3.9k). You may get a loud "thump" from your speakers when the power is first applied to this switch, because C101 and C102 start off with 0v across them, and R101/R102 are their charge/discharge paths.

If you do get a "thump", try increasing C4 from 10uF to 100uF, and/or changing R2 & R3 to 22k, or even larger values.
If you do increase C4 and/or R2 & R3, the upper side of C4 should be clamped to the rails using diodes; otherwise when the power is cut, the bias voltage may exceed the rails of the mux. This would not be good.
 

Attachments

Last edited:

k7elp60

Joined Nov 4, 2008
562
Hi
Do you mean a split rail supply +/- 5v ??

The supply i'am useing for the 4066's is +12v with 0v ground and the switch
control voltage is +12v from a UDN2981A, which is driven from a PIC16F628P
the UDN2981A was used to drive relays, but i want to use the 4066's instead!
Can you suggest a value for R1/R2 pull down resistors ??

Thanks
Howard

Here is a updated circuit:
I think there is a misscommunication here. If I understand you correctly you were using UDN2981A to drive relay coils, but you want to use 4066 to do the same job. It won't work as the the UDN's supply current to energize the relays. The 4066 will not supply enough current to energize relays.
The 4066 will switch audio signals fine if configured properly.
 

SgtWookie

Joined Jul 17, 2007
22,230
k7elp60,
I interpreted Howard's statement to be that he was using the UDN2981 to control the select lines of the 4066. A uC by itself couldn't swing the voltage high enough. Since the UDN2981 is a source array with open-collector outputs, a pull-down resistor was required to keep the select lines from floating when the UDN2981 outputs were off.

Basically, he's just sending RSSI and audio through the 4066. I think the modified schematic I put up should work OK, if he does a decent job on the trace routing.

If you see any mistakes or have suggestions for improvements, have at it.
 

SgtWookie

Joined Jul 17, 2007
22,230
Here's version 2.

R2, R3, and C4 have been increased to help reduce/eliminate the "thump" when power is first applied.

D4 & D5 have been added to clamp the bias to the rails, protecting the 4066 during power-off.

Leaving R101, R102 at 10k or lower isn't such a bad idea after all. If you go too low on their resistance, audio quality will suffer.
 

Attachments

Thread Starter

hamopp

Joined May 13, 2009
68
Hi
I have added some circuit blocks to SgtWookie's circuit (V1),
in dotted area's, to try and explain the workings of this project.

The circuits will be used in a home brew transceiver.
The FM "S" meter voltage comes from the NBFM IF detector amp.
The SSB\CW "S" meter voltage comes from the SSB\CW IF detector amp.
These voltage's go up and down with variable input signal's to both IF amp's.

vr1 and vr2 are there to set both voltage's to about the same level into the
LM3914 led driver.

Hope that this helps
PS. did not see that V2, until just now.
Thanks
Howard
 

SgtWookie

Joined Jul 17, 2007
22,230
Howard,
At this point, it would be easier to simply make the couple of changes to your schematic than try to re-import this update. Only minimal changes were made.

I see that you are having some of the same difficulties with Junctions that I had when I started using Eagle. You only need junctions when a wire joins another wire. You do not need junctions when a single wire terminates at a component lead. However, if you have more than one wire terminating at a component lead, you need a junction.

For example, in your RSSI Meter, you have junctions at all of the LED connections, however you do not have junctions to the right of the LEDs, where they connect to the +V buss. Use the Erc function early, and use it often; otherwise you will have a big mess to clean up before you can start on a board.

If you create a board and there are errors you haven't corrected in the schematic, you will have an even bigger mess. Many times the easiest way to recover from that is to delete the .brd file and start over. However, if you've kept up on your Erc messages in the schematic, you will avoid that frustrating situation.

I cannot read your schematic image, as the image is too small. When you export .png images, I suggest using a resolution of 110 DPI so that it is readable.

I cannot load your schematic in my Eagle, as you used a newer version. My installation of Eagle 4.16r2 is registered, and I do not wish to pay the upgrade fee.
 

k7elp60

Joined Nov 4, 2008
562
k7elp60,
I interpreted Howard's statement to be that he was using the UDN2981 to control the select lines of the 4066. A uC by itself couldn't swing the voltage high enough. Since the UDN2981 is a source array with open-collector outputs, a pull-down resistor was required to keep the select lines from floating when the UDN2981 outputs were off.

Basically, he's just sending RSSI and audio through the 4066. I think the modified schematic I put up should work OK, if he does a decent job on the trace routing.

If you see any mistakes or have suggestions for improvements, have at it.
Your are right SgtWookie,I missread the schematic. My appologies.
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, here are some corrections for you:

1) Above R102: the wire running from wirepad AUDIO to the upper side of R4 is not connected.
You must connect it to the end of the wirepad AUDIO pin. You may wish to leave it (the wirepad) there as a test point.

2) R4 replaces R102 completely. Remove R102.

3) You need a 39nF cap in series with a 39 Ohm resistor between IC3's output (pin 4) and the inverting input (pin 2).

4) +12v has no wirepad or connector that I can see. I suggest that you instead use the +V or VSS symbols already existing on the schematic; as they ARE connected to the 12V wirepad.

5) There is no wirepad or connector for the 5v supply. It will not be routed. If you wish , you could include a 7805 regulator over by C17. Make sure to use a 0.33uF cap on the input, and 0.1uF cap on the output so that it will be stable. Place a +5v symbol at the output of the 7805.

6) LED1 through LED10 - you need junctions where they all connect to +5V as previously mentioned.

7) Any other inputs or outputs should either have a wirepad (like FM-SEL at the upper left) or connector (like the CWAUD RCA jack or your BAR_DOT SEL JP3) or you will have fun soldering wires directly to traces.

8) IC1C pin 6 - there is a missing junction to the left of the pin.
9) Missing junction above C8 (bottom left).

10) Remove the excess junctions; they can hide problems.

If you want to see if wires are connected to an IC or part, use the Move tool and drag the part. If connected, the wires will move with the part. If they are not connected, drop the part away from the wire, then move it back. Eagle will then connect the wire to the pin.

I suspect that JP3 is not connected, as you ran the wire to the circle instead of the pins. The wires appear to be overlapping the pins. This is a no-no.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
I don't use the auto router either ;) If you don't have an exhausting set of routing rules set up, you might as well call it an "Auto Problem" module, as you are likely as not to wind up with lots of problems, automatically! ;)
 

Thread Starter

hamopp

Joined May 13, 2009
68
Hi
Sgt Wookie

I'am having some problems with your circuit (4066 switch) it was blowing the 4066
chip and stopping the audio from getting through.
When switching from FM to SSB mode it seems that the diodes D1,D2 and D3 blow,
i have replaced the diodes and 4066 a few times, and each time the circuit works ok
(power on in FM mode) but as soon as i switch to USB the diodes blow, and when i
switch back to FM the audio is very faint!!

I have also tried a version with relays (my design) (NEW RELAY.png) but this also seems
to have the same problem, when i power on in FM mode, rly1 and rly2 switch ok
and the FM audio and FM rssi are ok, but as soon as i switch to USB the diodes D3,D4
and D5 blow, but if i remove D2 from rly3 and rly4 D3,D4 and D5 don't blow,is this to do
with back emf ??

Any thoughts on This ???

Regards
Howard
 

SgtWookie

Joined Jul 17, 2007
22,230
Are these inputs connected to two separate radios that do not have a common ground?

I don't know what the levels of the signals are that you are putting in on the various SEL lines; you never went into that. I made the assumption (dopey me!) that you had verified them to be at a logic level.

If any of the SEL inputs go higher than Vdd, you will have problems blowing diodes and ICs.

The Vss of the circuit needs to be common (tied to) to the ground of the radio(s). Measure the voltage from the ground of the radio(s) to Vss. If it is other than 0v, there is a problem.

If the SEL inputs for the SSB/CW modes go higher than Vdd, that needs to be fixed somehow.

Before you make changes, report back as to what voltage you are using for Vdd, and what the voltages are for the SSB/CW SEL inputs are, and what the voltage is for FM SEL input. You do not have to have the inputs connected when measuring them, but we need to know what they are.

One fairly easy fix would be to use resistors to limit input current, and more diodes to clamp the input to Vdd. However, in order to make good decisions about what resistors to use, the voltage levels must be known beforehand.

Also, need to know if the SEL voltage levels change between when there is no traffic (not transmitting) and traffic (transmitting).

Also, please re-post the current state of your 4066 schematic. I suggested a number of fixes before, and you have not yet shown the updates.
 

SgtWookie

Joined Jul 17, 2007
22,230
Howard,

This is a very general idea of the mod I mentioned in my last post.

It entails adding three current limiting resistors, three clamping diodes, and increasing the value of a pull-down resistor from 2.2k to a higher value.

Since we don't know yet what your actual SEL inputs are compared to Vdd, please don't just slap in these changes and expect it to work. I just wanted to get my current train of thought documented before the train jumped the track. ;)
 

Attachments

Some small improvements:
Instead of D6, D7 and D8: save two diodes and put only one at the output.
Instead of R8, R9 and R12: save two resistors, put only one resistor in series (after) the diodes.
 
Top