0
\$\begingroup\$

I have an arduino mega and 256 analog sensors that I have to read. I already did it with a lot of 4067 16:1 multiplexers. At first it took all of my pins. Then I paralleled the multiexers to use only 4 digital pins to Control them and played with the E of them to turn them on or off.

Now my question is : is there a 256 : 1 multiplex that operates in the 5v range so my mega can handle it (or even smaller arduino) or if not a 128:1,64:1, 32:1. In order to make my board simpler.

Thank you very much for your time reading this. Have a nise day.

\$\endgroup\$
3
  • \$\begingroup\$ other microcontrollers than the atmega have multiple ADC channels (8 is pretty common, typically realized through an integrated mux). So, by switching to a less expensive platform than Arduino, you could also reduce your hardware complexity by a factor of 8. Depending on the bandwidth of your 256 signals, an array of ADCs and a few shift registers or digital muxes might be way easier than external analog muxing. It all depends on your signal! \$\endgroup\$ May 1, 2021 at 11:28
  • \$\begingroup\$ Do you actually need analog multiplexers, or are you looking for digital levels? The ATmega2560 has 16 ADC channels. What is the input range of your signal? \$\endgroup\$
    – Reinderien
    May 1, 2021 at 17:18
  • \$\begingroup\$ What if I used 2 16:1 multiplexers, 1 for 5v & 1 for gnd, for all of my sensor in a 16x16 matrix. Use 4 digital pins for each mux to control and 1 digital pin to set high for the 5v mux and low for the gnd mux. So every time I have only one sensor powered and provide to A0 data. This is 10 digital & 1 analog. Even an uno could do that. Should I use any diodes? Is my thinking correct? Am I missing something? \$\endgroup\$ May 4, 2021 at 8:14

2 Answers 2

3
\$\begingroup\$

You can use 3 pins (2 with some cleverness) to control a 74HC595 shift register. The shift register has 8 bits, which is sufficient to address 256 inputs.

You would feed 4 bits to 16 74HC4067 or similar and the other 5 bits to a 1 low of 16 decoder, such as 2x 74HC138, and use those outputs to enable the '4067 chips.


There are serially controlled MUX chips such as the 32:1 ADG731 32-input chip however they are higher performance, sometimes better protected, and tend to be more expensive (and perhaps may suffer from availability issues in the future). To use the required 8 chips you could use a 74HC138 as the selector. You'd need the three address pins plus the 2 + 1 SPI pins for a total of 6 pins.

As a rough comparison, USD Digikey price for Q100 each of the first solution is $8.28 vs. $89.40 for the second. Or if you prefer LCSC, $3.17 for the first one.

\$\endgroup\$
4
  • \$\begingroup\$ Makes sense. The series impedance might be an issue to the OP. But who knows given the lack of specs and the fact that a 74HC4067 is already stated as acceptable. So I'd guess that twice the impedance would also be fine. I'm not sure the OP has a lot of other reasonable options. +1 \$\endgroup\$
    – jonk
    May 1, 2021 at 7:41
  • \$\begingroup\$ @jonk OP didn't even say 74HC. The CD4067 is 5x worse than the 74HC4067 (1200 vs. 225 ohms max at 85°C). \$\endgroup\$ May 1, 2021 at 7:48
  • 1
    \$\begingroup\$ Ah. I guess even that much is unsure from the OP's writing. \$\endgroup\$
    – jonk
    May 1, 2021 at 7:56
  • \$\begingroup\$ What if I used 2 16:1 multiplexers, 1 for 5v & 1 for gnd, for all of my sensor in a 16x16 matrix. Use 4 digital pins for each mux to control and 1 digital pin to set high for the 5v mux and low for the gnd mux. So every time I have only one sensor powered and provide to A0 data. This is 10 digital & 1 analog. Even an uno could do that. Should I use any diodes? Is my thinking correct? Am I missing something? \$\endgroup\$ May 4, 2021 at 8:14
0
\$\begingroup\$

With microcontrollers available for sub $1 these days, it is not unreasonable to use a number of them vs 1 microcontroller and a large mux. Benefits might be less pcb area, faster acquisition time (as a number of adcs are working in parallel) and redundancy. Downsides might be the need to program (ie load the code into) a number of microcontrollers along with a bootloader etc.

\$\endgroup\$
1
  • \$\begingroup\$ What if I used 2 16:1 multiplexers, 1 for 5v & 1 for gnd, for all of my sensor in a 16x16 matrix. Use 4 digital pins for each mux to control and 1 digital pin to set high for the 5v mux and low for the gnd mux. So every time I have only one sensor powered and provide to A0 data. This is 10 digital & 1 analog. Even an uno could do that. Should I use any diodes? Is my thinking correct? Am I missing something? \$\endgroup\$ May 4, 2021 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.