analog multiplexer CD4051BE

I want to test the analog inputs of a CD4051BE multiplexer, so I created four voltage dividers in order to measure four different values of analog input. I connected them to the I/O0 - I/O3 ports of the IC and connected the output port of the IC to the analog input of an arduino board.

After that I read the values of each one voltage divider using the select lines, and it worked as expected.

I have five pieces of CD4051BE in my possession (bought from the same shop), so I decided to try them all. I was surprised by the fact that every each one was delivering different values, about 5-10% of maximum value.

Mt guess is that it happens due to a slightly different internal resistor for each one IC. If this is the case, how can a multiplexer be used for manupulation of several analog sensors, since accuracy errors occur?

• This might be cause by variations in the internal resistance of the mux switches, in combination with the load the A/D input poses. To reduce or eliminate this effect, put a buffer (opamp in voltage follower mode) between the mux and the A/D input. Commented Mar 2, 2016 at 18:04
• Sorry to bother you, but since my knowledge in electronics in quite limited, could you be more specific? Thank you in advance. Commented Mar 2, 2016 at 18:12
• What was the dwell time you used when making the analogue measurement and how many samples did you average? Commented Mar 2, 2016 at 18:21
• I set the select lines, wait for 50msec, make only one measurement, wait for 1 sec and then again the same loop. Commented Mar 2, 2016 at 18:28
• What, exactly, is A0, your analog measurement point? Commented Mar 2, 2016 at 19:24

I have just repeated your test with 3 random different 4051 ICs.

I just used a DVM to measure the voltage on the multiplexed pin - pin 3.

In each case, the voltage on pin 3 was the same to 3 decimal places and was the same as the voltage on the potential divider on the input.

I presume the problem must be in the way you are reading the analogue input. Have you tested the voltage on pin 3 with a DVM to verify your results?

• That's an interesting point. I will try it soon. Commented Mar 2, 2016 at 21:10
• I just tried it and I have to say that you are right. The voltage was the same to 2 decimal places (2 or 3, it doesn't really make any difference). So I will have to check for any interference between the multiplexer and the analog input of the MCU. Commented Mar 2, 2016 at 22:29

The problem is the multiplexer has resistance, this resistance can vary from device to device (I wouldn't expect that) and it does change with temperature and the amount of current through the device. You will also have common mode issues as you get near 0V. The CD4051 is not the most accurate device, but these problems are inherent to all analog switches.

A voltage follower buffer might help to give you a better measurement. The ADC should be high impedance so I wouldn't expect it to draw much current. Is the voltage pin on the arudino 5V tolerant? That might be a problem.

simulate this circuit – Schematic created using CircuitLab

• Just check my comment for HandyHowie's answer. So I think that I should check how the cirquit reacts by adding a voltage follower buffer. Commented Mar 2, 2016 at 22:34
• What is the range on the ADC input? Is it 0V to 3.3V? Commented Mar 2, 2016 at 23:01
• It is 0.0 - 5.0V. Commented Mar 3, 2016 at 13:48