dac to adc - to reduce number of wires

Hi

I have 23 digital inputs to my arduino which are going to be located a fair distance away from the board itself and also be able to be unpluged. Originally I thought of using a 40 or 39 pin IDE header and cable to achieve this. However then I got thinking what if I could use a DAC (2 x 12bit or 1 x 24 bit) located where the switches are then just run a few wires (vss, gnd and 1 or 2 analog) to a ADC located close to the arduino then wire that ADC into the digital inputs.
Just wondering if anyone has done something like this before or knows if it can be done and also would I need to use "matching" ADC and DAC that is with the same sample rate, input chanel type, data interface, etc Also should I be using a shielded cable for this?
Does anyone know of a ADC and DAC that would work together? Otherwise a push in the right direction would be appreciated.

The slightest bit of noise or signal loss, or mismatch in Aref to Vcc between them, and your information becomes garbage.

Why not use a serial protocol?

The telephone company... known for dealing with them things called "long runs of many copper wires" has solved this problem, many times and a few different ways.

  1. Multi-plexing
  2. Modem (modulator/demoduator)
  3. Optical Fiber
  4. Radio Transmission

Guess which one they don't do...

Describe what "fair distance" means to you...

No where near long enough for optic, radio or modem.

Really it is not far at all as far as everday things go only around 1 meter to a conector then another 1.5 to 2 meters for a grand total of 3 meters. This exersise would be more just to reduce the number of wires needed and hence reduce the plug size required also less wires means a neater install. Also which ever method I go for has to be as light weight as possible.

How would multiplexing work in this situation?
Is there a reason why DAC to ADC is not used?

What is a serial protocal?

I will do reaserch on both these methods when I get home of corse just dont have much spare time at work.

Is there a reason why DAC to ADC is not used?

Yes, the reasons I gave.

24 bits is 16.8 million levels. 16777216 to exact. 5V divided by 16777216 is 0.000000298023223876953125V or 298nV. Yes, nanovolts. The slightest bit of noise will screw up your data. The slightest bit of mismatch between the DAC and ADC will screw your data up.

You can use the Serial library to talk from Arduino to Arduino. It takes two wires and Ground.

http://playground.arduino.cc/learning/4051

Using this method you can read your 24 inputs
With 3 4051 multiplexers 3 arduino inputs and 3 digital outputs.

The arduino will read 3 multiplexed inputs at a time, but run thru all
Inputs very fast

Or, you can have 4 multiplexers, and use one Arduino input and 6 Arduino outputs.

The arduino will read one multiplexed input at a time, but run thru all
Inputs very fast

Of coarse, Serial coms using 2 arduinos :slight_smile:
thanx Polymorph This is the method I think I will use.