100+ channel analog input

Hi there,

I would want to connect about 100 pressure sensors the the spark core/photon and read them sequentially in a few milliseconds. I’ve used a 16 channel analop mulitplexer in the past, but can’t find a 128 channel one. Can anyone recommend one?

thx
sven

You could have a look at a 128 channel ADC
http://www.analog.com/en/products/analog-to-digital-converters/ad-converters/adas1128.html
or these muxes
https://www.maxwell.com/images/documents/81840rp_rev5.pdf
http://www.ic72.com/pdf_file/s/159447.pdf

Or you connect 7x16, 4x32 or 2x64 channel muxes or cascading a suitable combination of them.

Another option is to daisy-chain 8 of these: MAX11131AUI+. They are 12-bit 16-channel A/D converters that can run up to 3MSPS. Mouser has 12 in stock, and they come in SSOP-28–difficult to hand-solder, but manageable.
Alternatively, you could daisy-chain 16 eight-channel A/Ds with a more friendly package: MCP3208-CI/P is a 8-channel, 12-bit A/D in a 16-pin DIP package. Yup, the 0.1" pin spacing that you can breadboard! (You have to love Microchip for thinking of the hobbyists! On top of that, Mouser has 423 in stock.) 100ksps should be fast enough for air pressure, I assume. (If that isn’t fast enough, you need a microphone :grin:)

Both of the above A/Ds support SPI. While I haven’t daisy-chained SPI devices before, I don’t see any reason why it won’t work. (It could be a little challenging to sort out in software, though: be forewarned!) I2C would be easier to handle (set each device to a different A-code), but you can only have a maximum of 8 same-type devices on a bus, and I couldn’t find any 16-channel I2C A/D converters.

@hansamann, 100 sensors in a few milliseconds is a lot! Say you want to sample all 100 in 10ms, that’s 100uS per channel which may not be enough time. With SPI devices you would need 16 chip-select lines meaning a serial shift register type of arrangement. With I2C you have to assume the devices you use have a wide programmable address range to have up to 8 or 16 devices. Then comes the issue of voltage range and sampling time. All this to say that careful design will be required.

The question begs to be asked. Assuming you can sample that fast, what will you do with the data on the Photon?

According to this link, daisy-chaining of SPI devices is possible, and only requires one /SS line: http://www.eeweb.com/design-articles/daisy-chaining-spi-devices
I will not by any means say that it will be easy to sort this out in software…but it appears to be feasible. Alternatively, you can use a CD4515 active-low 4->16 line decoder (for 16 /SS lines), and only need 4 outputs from the Particle device.

AFAIK, there really aren’t many A/D converters supporting I2C.

1 Like

@WebDust21, you are correct about the daisy chaining. An alternative is to use this 48-channel mux based on the 74HC4067 analog multiplexer. Like you said, a 4-16 multiplexer could be used with 3 boards to get 144 channels.

The ADC interrupt vector will be exposed when the latest firmware gets released so creating fast, interrupt driven A/D code will be easier. The A/D is still finicky and will still be slowed by the input capacitor (recommend 0.1uF external) having to charge but that should not be too big a problem.

The question still begs to be asked as to what will be done with the data after it is sampled!

1 Like

…not quite sure if this was clear, but the CD4515 is NOT an analog multiplexer. It is a digital “1 of x” output, so you could address 16 /SS lines via four outputs on the Particle chip. There are other CMOS chips that can do analog input multiplexing, including the 74HCT4067 (=CD4067) used on the Sparkfun board you mentioned.

Me too… @hansamann, are you working for NOAA?

@WebDust21, yup I know about the 4515. It can be used to do the multi-4067 mux selection :smile:

Hi all, sorry for the long delay. I am working on some kind of 10x10 matrix that senses where you put you hand on. For that I am thinking of either capacitive input or some simple switch-based / pressure based push-down mechanism. Either way, it’s 10x10, so 100 inputs.

1 Like

@hansamann, doing capacitive touch sensing with the Photon will be difficult. You may want to consider a capacitive touch sensor chip for that. Switch-based sensing will be easier since it can use logic levels. You will need the rows and colums to be both outputs and inputs if multiple buttons will be pressed simultaneously. If the touch area is small, you could use a resistive touch screen, without the display (or with!). There are lots of libraries for that (with or without sensor chips).

1 Like