How to daisy chain 4(or more) 4067MUX

Hey guys

sorry for this first post in the forum being a question allready but im running out of ideas somehow :D

the problem is as follows: i browsed the whole web to find a tutorial or something how to connect more than one 4067 MUX to the arduino uno.

in this case i want to connect the 4067 to each other to use only the bare minimum of inputs on the arduino to read out the signal of >16 adjustment knobs. i found some drawings and codes but nothing worked and im not skilled enough to solf this by my own :P

any suggestions in view of wiring diagrams and sketches?

i would be very thankful for any futher information which pushes me ahead.

You have each one connected to a separate analog input? Each analog input then reads 1 of 16 inputs, 4 inputs reading up to 64 total inputs. 8 IO lines needed; 4 analog, 4 address select lines. Result is like 70 ohm resistor in series with the knob.

Or you want to have a "master chip" with each channel reading 1 of 16 from a 2nd layer of devices, for 1 analog input switched among 256 total inputs? 1 analog input, 4 address select lines for 1st device, 4 address lines for 2nd layer devices. Result is like 140 ohm resistor in series with the knob.

good morning CrossRoads

DOH! stupid me. i havent considered the possibility of connecting each one of them to an single analogIN. this should be suitable in my case and i found allready a tutorial with nice examples. this is the tutorial: i guess i´ll get this running around lunch time ;)

but my mind was more like the "master chip" you mentioned. i think its more sophisticated some how and a great way to dive deeper in the programing. its like learning by doing thank you so much for you fast response :) and i dont want to sound selfish now but could you go ahead with a wiring and a sketchexample for this particular case?

Why you don’t you take a crack at creating it?
Use for schematic capture to show the 5 parts and the processor.
8 address lines, have them come from D9-8 and D7-6-5-4-3-2 (MSB to LSB)

for (D98 =0; D98< 4; D98 = D98+1){
  digitalWrite (D8,  D98 & 0b0000001); // upper 2 bits, 00 01, 10, 11
  digitalWrite (D9,  D98 & 0b0000010);
  for (D72 = 0x40 ; D72<0x100; D72 = D72+4){
//0x40 to 0xFC by 4s, so upper 6 bits are 0x00, 0x04, 0x08, 0x0C, 0x0100, 0x0104, 0x0108, 0x010C0,
// or in binary:
// 00000000, 00000100, 00001000, 00001100,
// 00010000, 00010100, 00101000, 00101100,
// you can see the binary counting with the 2  lower bits left at 0.
  PORTD = (PORTD & 0b00000011) || D72; // clear upper 6, OR in D7-6-5-4-3-2 and the 2 serial lines left alone
  analogValue = analogRead(A0);

thank you very very much

this pushes me ahead and gives me some kind of red thread to work with. the tip with expresspcb is also great.

im going to repost if my projekt works fine and ill give a final report then.

so long :)

Excuse me to bump this old topic.

I'm new to Arduino and trying to grasp the concepts of multiplexing. I'm using a Arduino Uno.

So from what I understand is that I can use up to six analog pins to connect six 4067's. Even more so if I multiplex the multiplexer ins with correct addressing. So in case I use the six analog pins for separate 4067's, do only need the same 4 address output pins or do I need more address outputs if I go beyond four 4067's?

In other words how many multiplexed inputs can you address with 4 address lines if you use an analog input pin per multiplexer?

I saw some examples of schematics where two 4067 where chained to the same 4 address lines but I couldn't find schematics for more than two.

Also in this topic for the first time putting a resistor in series with the knobs is mentioned in multiplexed potentiometer scenarios. What is the function of those resistors?

You use the same 4 bit address lines on all the multiplexers if the output of each goes to a separate analogue input pin. In fact the Arduino has only one A/D with a six channel multiplexer infront of it. There you see as separate inputs but they are just multiplex inputs.


Tommorow my 4067 boards arrive. To do testing I’ll hook up four boards and connect a 10k pot to each of the boards while clamping the rest of the inputs to ground. The idea is to see how much latency is introduced scanning 64 inputs for midi controller purposes.
Ill use the example code of this tutorial:

Did anyone try already to connect 64 pots or does someone knows how to calculate the lag in milliseconds that will be introduced by scanning 64 analog ins?
If its going to be more than lets say 18-20 ms I probably have to look into another arduino board than the Uno.

Why do you need to actually have pots wired up to do this? The only extra time you need is the time taken to set the multiplex address, their can be no other thing creating any delay.

Just because a pot comes through a multiplexer doesn't slow things down.

Actually the connections of the pots is more a test to see if I have connected all the boards properly and to see actual measurements coming from each multiplexer.

I found a fast way to test the performance with 32 analog inputs by connecting the potentiometer board of my UC33e controller to the Arduino. This board consists of 4 4051 chips and pots and faders and the connector can be easily directed to the Arduino pins on my breadboard, no soldering involved.

If this works fast enough I will tranform my old vintage mixer into a 56 channel midimixer based on the Arduin with the 4067 multiplexer boards.

This is a fun learning proces! I'm a programmer (ERP software) but I did not have electronics experience so far. Just a little kit soldering.

I read some other topics where you advised people to use ground star wiring and capacitor decoupling of the analog pots to ensure proper readings. I will take that into account in my final design.

Regarding the decoupling, is it best to do this for each potentiometer? (the UC33 board for instance does not have any capacitors on the board) Also can I group to a common ground per multiplexer connected pots or is it best to use a common ground for all the multiplexers ?

Regarding the decoupling, is it best to do this for each potentiometer?

I would tend to put a decoupling capacitor between power and ground on each group of pots for one multiplexer, and also on the multiplexer chip itself of course.

Also can I group to a common ground per multiplexer connected pots

I would have thought so.

What value are your pots? A value of 10K or smaller is probably optimal.

Thanks, I use 10k pots.

I did some testing with four 4067 and there is no noticeable delay in a midi controller application. The responisiveness is even better than my Evolution UC33e controller. So anyone wondering if a 64 pots midi controller based on a Uno is working: yes it does perfectly fine and I think this can be extended to 96 pots without trouble by adding two more multiplexers and using all the analog input pins. A common ground line instead of daisy chaining the ground via the pots gave very stable results.

Thanks Mike for your advice.