Hi! I initially wanted to use some analog sensors (resistive touch strips, x/y joystick, resistive x/y touchscreen) as inputs to the do-it-yourself UMC32 MIDI controller mother-brain.
My "issue" is that these various sensors don't have ranges in the form of "0 - N Ohms".... they have a range of "M - N Ohms".
The problem with this is that the UMC32 translates 0V at one of it's inputs to a MIDI value of 0 (min) and 5V as a MIDI value of 127 (max). If I used the above sensors, I'd end up with a MIDI value range of "somewhere greater than 0 to somewhere less than 127", and I need to produce a range of 0 (min) to 127 (max)... i.e. I need to send it a range of 0 - 5V.
Now, if assuming the above is correct, I conjured up this idea: read the analog sensors into an analog input on an Arduino, bound them, and then send the bounded data out to a serial controlled DAC which then connects to the UMC32 input... one problem.... I don't have enough Arduino pins for everything...
I thought to use 4051 to 1) read the raw analog input from the sensors into the Arduino sequentially, and as well 2) use 4051s to choose which DAC to send the newly formatted analog value to from the Arduino.
So, assuming ALL of the above is necessary to achieve what I want with the UMC32, are there any issues sending serial data through a 4051 to a destination, the DACs connecting to the UMC32 in my case?
Why use an analogue multiplexer why not a digital one? You only need to use an analogue one if you have bi-directional communication. Remember you will need one multiplexer channel for the data and one for the clock (assuming they are SPI).
Anyway why not just map the range you have into the range you want? Using some simple arithmetic or the map() routine if you can't be bothered working it out.
What D/A are you thinking of using?
I need an analog de-multiplexer to read some number of analog values from the touchpad, joystick, and resistive touchstrip INTO the Arduino. Once the data is into the Arduino, I'd use something like the map() function to create a range of "0 - whatever the max to send to the DAC is".
I'd then like to send the value I just "mapped" via serial through a multiplexer to the correct DAC that's connected to a pin on the UMC32.
I guess my real question was: "Given how the UMC32 converts a voltage 0-5V into a MIDI value 0-127, is what I'm proposing required to get a 0-127 MIDI range using analog sensors that don't range from "0 - a max value" (i.e. at it's "max" it wouldn't still be creating a voltage divider, so that I can get the Vcc of 5V out of the sensor, and not just some large fraction)?
P.S. I was planning to use Texas Instruments 5616 12-bit DACs... I believe they have an SPI interface.
is what I'm proposing required to get a 0-127 MIDI range
Basically yes if you want to go through the arduino. You could do the shifting / range adjustments using an operational amplifier and bypass the arduino altogether if you want. This is much lower cost but you will have to design it for each sensor and know what values you get at full range and zero.
If you do go the digital route, there is no point in having a 12 bit resolution, as the MIDI only has a range of 0 to 127 then 7 bits is all you need. So if you choose an 8 bit one it will be cheaper.
How about using one of these there are 8 D/As in one package.