Arduino Analog I/O Multiplexer

[SeanHodgins] has a project in mind where he needs to sample over 500 analog sensors. To get ready, he made a breakout board for 32-channel analog multiplexer device he wants to use. He put the project out on Hackaday.io and also has a video tutorial you can see below.

There are five input pins to the chip which lets you connect one analog pin to any one of 32 analog pins. Of course, in addition to the five control lines, you need some handshaking lines, too so you could use as many as eight digital pins to control the device.

The device in question is an ADG732. The board layout and the source code is all available on GitHub. Because the switches are analog, they are bidirectional. That is, it isn’t really connecting one output to 32 inputs. It is more like a 32-position switch that connects a single pin out of 32 to one other pin.

Keep in mind that these sort of devices have some practical limitations. For example, the switch resistance is nominally 4 ohms at room temperature. The switches that route the signals also have some capacitance that varies depending on if they are on or off. There’s nothing wrong with any of this, of course. But it isn’t quite the same as having, for example, a 32-position rotary switch. Of course, it can switch faster than a mechanical switch and is easy to control, so — as always — its a tradeoff.

Notice, too, that the mux chip can operate rail-to-rail. However, for some applications, you’ll need a negative supply and the device can accept a +/- 2.5V  supply for that purpose.

There are a lot of uses for something like this. Routing audio signals, for example, or switching between multiple test points in an automatic test system. We looked at a mux last year with a paltry eight channels. Then again, you can always go old school and make mechanical multiplexers.

14 thoughts on “Arduino Analog I/O Multiplexer

  1. The datasheet of the ADG732 says that the address pins are level sensitive. So you don’t need 8 digital IOs of an Arduino to control one of these chips, you can connect EN, WR and CS to GND, and then just change A0-A4 to select the input. Of course, with 500 input and multiple of these chips, the CS signals etc. make sense, to share the address signals with multiple chips.

  2. Hmm has me intrigued, is this the type of device worthy of exploiting within a system for muxing multiple cell voltages for the likes of a Tesla type car battery array And seeing how the array responds to transients during driving as well as regenerative braking ? ie I like the idea of observing a graphic arranged to map the batteries as they deliver and absorb charge during around town and highway type cycles…

    1. In series connected cells, measuring is complicated by the large common mode voltage. E.g. the highest cell might have negative terminal at +400V and positive terminal at +404V. You could resistor-divide that to a 5V range, but it would lose a lot of accuracy.

      It seems that most reasonable way would be to have individual ADCs for each group of ~10 cells, and then use optocouplers to isolate the digital signals.

  3. ADG732 is a >$10 chip, why not buy 4x bluepills instead of one multiplexer. STM32F103C8T6 has 16 ADC inputs, so right of the bat you get double the fun without soldering a single wire.

      1. And trading off cost for on resistance – you can get 4051’s all the way down to 1 ohm. But they are $1US. And many in between (going all the way up to 125 ohms).

  4. i already built the series array sensor for temperature amperage and voltage in a 20 cell honda insight using 2 unos and a muxii from mayhew labs. the series voltage is overcome using proper galvanic isolation of the sensors. TEMPANERD youtube

  5. I am doing a project that needs to multiplex 64 channel, is there any thing I need to be aware of when using two ADG732 together? should I just directly connect the two sets of A0-A4 in same digital write pins on the microcontroller or do I need to add a buffer or something else, since I need 2 of the channels read at the same time?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.