Mutliplexing sensors into single Analog pin

I've made a circuit to multiplex stain gage signals into a single analog pin on a Teensy 3.6

All the channels multiplex correctly. The multiplexer feeds into an instrumentation amplifier. When reading from a channel every 5ms, it works great!


However, I may have had an oversight in the design. I was hoping to multiplex through these strain gages VERY quickly. Let's say for example, 10 strain gages at 1000hz.

The problem I am running into is that if I change channels too fast (~faster than 5ms per channel), then the values become the same, or at least start to meld into each other.

Is there anything I can do about this? Or is my only alternative to use an external ADC, possibly multiple ADC's to capture everything I want at a fast enough rate..?
It honestly might require a large re-design, but I was just wondering if I am correct in assuming that there's nothing more I can do about the fact that I am saturating the analog pin by trying to read too many different signals, all on the same pin, too fast.

If you need more information, I am happy to provide!

I've made a circuit to multiplex stain gage signals into a single analog pin

So how about sharing it with us?

The problem I am running into is that if I change channels too fast (~faster than 5ms per channel), then the values become the same, or at least start to meld into each other.

That is because the sample and hold capacitor is not getting enough time to charge up fully.
Solutions are:-

  1. Reduce the impedance of the signal by using an amplifier before the multiplexer. That will mean an amplifier on each sensor.
  2. Take two readings of each gauge but only use the second one.
  3. Take two readings of each gauge with a delay between them and only use the second one.

Hey Grumpy Mike,
Here's an image of the circuit

Ignore the V_ref voltage divider, it's actually connected to ground but I was just playing with things. (which is a whole other problem/topic in itself. It really would be better off as a dual supply)

I agree with your solutions. I've tried #2 and that did help me go from 10ms down to 5ms or 4ms. I'll try #3 next to at least improve things a little bit more.

It does seem that in the end I will need to go with solution #1.

And that's okay! This project has been a good learning experience so far. Thank you for the guidance!

Thanks for posting that. The thing I don't understand is why the output of the amplifier goes through an 8 way switch and then it appears to loop back round the the beginning of the multiplexer.

Or if In_1 is a different pin to in_1, then why is the switch there in the first place?

In hindsight, I don’t know why I chose those net-names for the 8-way switch. It’s pretty confusing. Nonetheless, there are 3 different ‘in_#’'s.


The first two represent input-channel_1-positive, and negative.
The IN_1 represents the input to different analog pins. If anything it should be called OUT_1

The reason is that this is supposed to be a “shield” of sorts that can read 16 inputs/16 strain gages.
Then you could stack another shield on top, and read an additional 16 strain gages.
Each shield feeds into a separate analog pin by changing which switch is ON.

If you’re curious,

for (int i=1; i<=shields; i++){
for (int j=1; j<=channels; j++){
// set the channel to read the signal from
int value = analogRead(shieldBuffer[i-1]);
value = analogRead(shieldBuffer[i-1]);
Serial.print(value); Serial.print(" ");

For every shield
->For every channel

That cuts my sample rate down by /128 if I set the variables to 8 shields and 16 channels.
Given the speeds of the Teensy 3.6 sample rates, I should potentially be able to hit the ball-park of my sample speed goal but I think I’m hosed by not having dedicated amplifiers for every channel.
Reading 1 single channel works great and I can get over 100kHz beautifully, but once I try reading 2 channels, anything about ~250Hz introduces so much cross-talk that they meld together entirely.
If that’s the correct way to use that term in this case.

edit: Technically I can’t read a single channel at 100kHz truthfully to what is happening in the real-world based on my next post in this thread

Are the unused channels grounded? I find that helps reduce cross talk.

In case anyone stumbles into this thread in the future...

In the end I decided that the input impedance wasn't too high for the speeds I was after (however, it would be smart to buffer the input anyway). Based on T=RC calculations.
The problem was in my instrumentation amplifier. It had a settle time in the 1's of milliseconds. This was something I was unaware of. The fix is to get a high-speed instrumentation amplifier. For example, the INA110 that has a FET input and settle times in the 1's of microseconds.

good luck!

Thanks for wrapping that up. I wish others did this more. Have a Karma point. :slight_smile: