Multiplexer Patch SM

I’ve been struggling to get the CD74HC4067 16 channel multiplexer to work with Patch SM. So I decided to test a new Mux and circuit with the Arduino Uno examples as below for digital buttons and analogues pots as comparison. Both worked after downloading the example code. So I know there is nothing wrong with the Mux or circuit.

Arduino Tutorial MUX74HC4067
https://blog.codebender.cc/2014/01/30/mux74hc4067/

I the connected the same circuit to Patch SM the same way and it is giving the same response (as with the original Mux circuit I used) with pots output fluctuating between a range of about 5v only when I twist a pot as image below - like they are not receiving required voltage.
There is nothing wrong with the circuit and Mux and I believe it is connected correctly. So I can only assume there is something missing from the code. (edited)

Code:

As I wrote on Discord, the numbers you are getting from analogRead are not in volts.

Suggestion: connect the output of the MUX to one of the CV in pins, and adjust the arduino code to match that. Maybe analogRead just doesn’t work on the ‘normal’ adc pins, I’ve never tried it. But analogRead() definitely works on the CV inputs, and can handle the range -5 to +5, so you can power the pot from 5v.

I was just thinking exactly this :slight_smile: I will try CV pin but shouldn’t you be able to use pots on ADC pins? Or is it multiplexers don’t work on them… Will investigate. I hope when I get this working it will be good reference for anyone else.

I got this working with Arduino IDE, DaisyDuino.
It works using C5 CV_1 pin.
It doesn’t work with ADC pin - I read somewhere about having to initialise ADC to use but don’t know if this is correct.

Here is the code below for Patch SM.

On Arduino that AD input should just work, same as the CV pins (though without the circuitry to handle -5…+5).

By Arduino, I assume you mean using DaisyDuino for Patch SM. It doesn’t work using the analogue A2 ADC_9 pin. I don’t know why.

I suspect you used the wrong number in AnalogRead(), maybe an error in the DaisyDuino header files. Others have gotten ADC_9 on Patch SM to work, but using C++.

I got it working. I checked the ADC pins and with all the other wires I didn’t see I had it connected to the wrong side of the header. I had it connected to A9 and not A2. Now I get a reading of 1 to 1023.

That makes more sense, those headers can be surprisingly confusing.

Sill mistake but so easy to make with everything else going on, you need a lot of attention to detail :slight_smile:
One for the checklist of gotcha’s!