Problems using CD4051BM multiplexer

Hello everyone!

I am trying to use a CD4051BM multiplexer to alternate between two 6MHz signals in order to read them separately with a frequency counter, but I can't manage to get the correct output. I have designed a small PCB where the CD4051BM is connected to an ATMega 2560 which is doing the counting. The CD4051BM is supplied with 12V and the inputs are for the two signals are in Y0 and Y3 so in order to get the Y0 and Y3 signals i need 000 and 011 on the respective select channels CBA. This input signals have an amplitude of 5Vp-p, however on the output channel of the MUX I am getting a 1Vp-p signal and that is not enough amplitude for the ATMega 2560 to do the counting properly, is there a reason for this voltage drop? How can I solve this?

Here I attach an image of the CD4051BM board layout :

Hi @evansg124 .
Please post a schematic of your project and if possible the sketch you are using.
But if posting the sketch use </> tags.

RV mineirin

Hello @ruilviana !The sketch I have tried it previously and it works fine, my main issue is with the MUX. Here I attach a schematic. The labels are going to the following ATMega 2560 pins:



What I don't quite understand is why I am getting such a low voltage at the output pin FREQIN... If you need more information I will upload it. Thank you!

I believe you need an output resistor (from the 'output' to Gnd) - try 10kΩ.

1 Like

Just wondering …..When you say 5v pk to pk do you mean 0 to +5v or -2.5 to +2.5v ? How are you measuring the voltages ?

A -2.5 to +2.5 signal will be clamped to 0 to +2.5v on the output . ( as Vee =0v ) Measuring with a DVM the average voltage could well then be 1v

Are they biased on 6volt DC?
Input signals must stay within the boundaries of supply/ground of the chip.

You could also use a +6volt and -6volt bi-polar supply on VCC and VEE.

hello @hammy , if I mesure with the oscilloscope I get almost the 5Vp-p but with a DVM on the same point I only get 2.6V. Here is the image from the oscilloscope:

So I guess this has something to do with what you are saying... if I understood correctly I have to feed Vee a -2.5V signal? (I am quite a new, so sorry if i am saying something crazy) Also is there any place in special to look into, to learn more about this biased voltage topic?

Hello @Wawa is there a way of seeing if the supply is biased or not? I am using this AC/DC switched supply :

What is the AC frequency range of your DMM.
A few kHz?

You just have to keep the signal between the supply extremes of the chip.
If the signal is between 1 and 6volt, then a single 12volt supply is ok.
If the signal is between -2.5volt and +2.5volt, then you need a negative supply (>=2.5V) on VEE.
Only then will the output be the same (with the same voltage offsets).

Where is this 6Mhz signal coming from, and what is it's output impedance.

And whats the load impedance (including capacitance) it has to drive?

The CD4xxxx series is pretty low performance. 74HC4xxx typically way faster - although doesn't support the wide supply voltage range.

There are many improved versions of these classic analog switch chips from
many manufacturers.

The 'scope shot shows, I think clearly, that it's going 5V from Gnd.
Still - tried placing a resistor on the output?

The DVM will tend to read the average - the average of your 5v pk waveform is ~2.5v .

Bear in mind your Arduino can’t tolerate a negative voltage if you change Vee to a negative voltage .

If it was me, I would abandon the multiplexer and feed your waveform to transistor switches , or opto isolators switching a resistor connected to a5v supply to give you a clean 0 to 5v waveform . Feed both waveforms to your Arduino and switch between them in software . You don’t need an analog switch for a digital waveform

It is a cheap Amazon DMM so i guess it won't be a very wide range... in the oscilloscope the signal goes from 0 to 5V, so I guess i won't be needing a negative supply. The 6MHz are comming from SN74LVC1GX04DBVR crystal driver. Regarding the output impedance i don't know how much it is, is there a way to mesure it?

@runaway_pancake I just tried it and got the same result.

Need all the impedences to figure out why there's a voltage drop.

Anyway a faster 4051 is probably required anyway.

@MarkT I will try to get the values for those impedances. Why would I need a faster 4051? I understand that the signal going through the MUX is a 6MHz but the switching between both channels is going to be every 10s or more. Why should I need a faster 4051? Doues the MUX have a maximum frequency that can pass through it? (I thought it just acted as a cable between input and output)

Yes, as I discussed in a previous answer. And the 4000 series analog mux's have a lot of series resistance - get a modern high performance equivalent.

1 Like

OK, I did not initially take much interest in this discussion. :face_with_raised_eyebrow:

The critical information was missing from the OP - just what these signals were. Nevertheless I discern from the tracing in #7 that they are in fact CMOS 5 V logic signals (no, not "TTL") between 0 and +5V and further from #13 that it is a HCMOS (LV) crystal oscillator.

So clearly the correct multiplexer - though it is an analog multiplexer and a digital selector would probably be more appropriate - is the 74HC4051, operating from a single 5 V supply.

Except where you need to operate from a higher voltage - which is generally quite uncommon - the CD4051B is essentially obsolete.

1 Like

Digital ports (any with two inputs) must be used to switch digital signals.
The 4051 is for analogue signals ( to preserve shape/amplitude of the waveform).

@Wawa do you have any example from mouser or digikey of a digital port? Never heard of this previously.