Go Down

Topic: Using 4051 analog multiplexer/demultiplexer (Read 5421 times) previous topic - next topic


Hi, I'm using a CD74HCT4051E Analog Multiplexers/Demultiplexer. I've read many posts on how to use it with the Arduino.

My initially I wanted to do a little test to ensure that my wiring was correct. So I wanted to connect a little piezo buzzer with a battery to from the Z or common pin (pin 4) of the 4051 and then the other end of the buzzer I connected to the Y0 or the first in/out (pin 13) of the 4051.

I have not connected any other power or pins or anything to the the arduino, or connected any power to the 4051.

I expected that the buzzer would NOT go off as the 'latch' between the 'Z' input and the Y0 input is not connected in its normal state. But the buzzer did go off. I tested the rest of the in/outs and they all seem to be connected to the Z pin. I used a multi-meter and found that the Z pin has connectivity to all the in.out pins (Y0-Y7).

I would expect that in their normal state that the Z pin is not connected to any other in/out pin. Do I have this wrong?



p.s - I base my wiring knowledge off this post http://www.arduino.cc/playground/Learning/4051

You'll need to refer to that link as I'm referring to the diagram there in my post above.


Sep 18, 2010, 12:30 pm Last Edit: Sep 18, 2010, 12:34 pm by mpeuser Reason: 1
or connected any power to the 4051.

This makes no sense. All "chips" have to be powered in the first place to provide useful operationallity. By looking at the internal wiring, one could deduce what will happen without any Vdd applied, but this is more or less a forensic post-mortem...

In the first place, no voltage should be applied to any input pin above Vdd+0.6V or below Vss -0.6V. When a chip is not powered, everything is critical, and - as said - undefined.

An analog switch (4016/4066) or multiplexer (4051/52/53) is not a "relay"!

As an aside. In contrast to the given link, note that the connection is bi-directional, there is neiter input nor output but "throughput" :-) The internal resistance is about 100 ohms.


It's possible the chip is being powered through the clamping diodes on the IO pins, but that's pretty irrelevant as it doesn't make sense to "test" something like this. You really should wire it up properly or not at all.
Rob Gray aka the GRAYnomad www.robgray.com


The 4051 control pins should not be allowed to "float" or unexpected things will happen. You may need to have a high value resistor between the control pin and ground to make sure that the control pin is low when it is not being made high.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


thanks for the replies. So looks like I need to set the whole thing up before I can truly know if it will work correctly.

deSilva - you say 'In the first place, no voltage should be applied to any input pin above Vdd+0.6V or below Vss -0.6V' but the reference sheet for my 4051 says that the switch voltage is 0-10V (refer to http://focus.ti.com/docs/prod/folders/print/cd74hct4051.html)

Is that correct?


Sep 19, 2010, 09:58 am Last Edit: Sep 19, 2010, 10:40 am by mpeuser Reason: 1
Some "mixed" chips have more than one reference voltage, which is most often used for output (drivers). In some kind this has to do with "output", too, as the analog output should mirror the input.....

The 405x are special in that they are made to allow NEGATIVE input, as their main application is audio, which is AC. To avoid the need for adding a constant DC to it, the 405x have a second analog reference, call Vee.You can set this pin to a negative voltage downto -5 V, so you can get a total voltage swing of 5 - -5 = 10V. In your application however, Vee shoud be connected to ground.

OT: There is one little known exception from the general rule: 4049 and 4050. Those drivers/inverters are specifically made to be tolerant to a higher input voltage than their Vcc. This is why you find them sometimes as a protection between microcontroller inputs and the real world.


Sep 19, 2010, 11:50 am Last Edit: Sep 19, 2010, 11:52 am by backdrop Reason: 1
Okay - so here is how I will connect it up. E, Vee and GND will go to the GND on my Arduino. The S0, S1 and S2 will go to the digital pins on my Arduino. Vcc will go to the +5v on my Arduino. The A pin will go to my buzzer which then goes to a 9v battery and then to the A0 pin. The polarity at the A pin or the A0 pin doesn't matter I assume - as you say they are just throughput.

So if I then turn on the correct digital pins for A0, the buzzer should go off...is that correct?

I don't want to use a buzzer long term, but its just a test to see that the Arduino is switching correctly.

thanks for your help


Please make sure that the multiplexer pins see no higher voltage than +5V and no lower than 0V !!!!


okay I'll use a smaller battery than 9v - or I'll use the power from the Arduino which is 5v.

Also how can I have a voltage lower than 5v when I'm using DC power? Are you saying that the multiplexor inputs are polarity sensitive and that I could get the polarity around the wrong way?


There are no inputs. There are "throughputs". They work from Vee upto Vdd.
Vee can be between Vdd and Vss - 5V. When you have Vdd =5V and Vee = -5V you can use AC signals +/- 5V wrt ground. However the Arduino will not like anything negative!


I used a multi-meter and found that the Z pin has connectivity to all the in.out pins (Y0-Y7).

When you use a meter to measure connectivity the meter has a power supply that gives a voltage on the outputs of the meter. As this voltage is not referenced to anything (it is floating) you can't use the meter to see if there is a path through a powered circuit. As has been pointed out you can't use an un powered circuit either. So in this case your multimeter should not be used for this type of measurement.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131