0
\$\begingroup\$

In order to acquire 3 analog signals with a Raspberry Pi 4, I want to use Waveshare's ADS1256 AD expansion board (8 channels single-ended, 24 bit.)

I was wondering if there's a way to set a different sampling frequency to each channel.

The ADS1256's datasheet states that the maximum fs is 30kSPS. Since I need to acquire 3 signals and one of them needs to be sampled at 10kHz, I want to know if there's a way to set a specific fs to each channel.

In this way I could sample correctly the audio signal (10kHz) and not oversample the other ones. So far, I've just downloaded the source code (Python) provided by Waveshare but I don't understand if there's a way to change it to do what I want.

\$\endgroup\$
2
\$\begingroup\$

The ADS1256 has a single ADC that is multiplexed between all channels.

If you read from a single channel continuously, then you can get 30000 samples per second out of it.

Since switching channels takes a couple of commands and some settling time before you get valid data, the total throughput drops when you start switching channels.

Page 21 of the datasheet shows the effective sampling rates when using all channels:

enter image description here

The datasheet doesn't explicitly describe what happens if you constantly change the sampling rate, but it will probably result in a total sampling rate slower than you get just from cycling through all the channels.


This is not a good chip if you want to sample audio at a high rate on one channel while sampling sensor data at a slow rate on the other channels.

Either use a different chip, or use two ADS1256 - one for your audio and the second for the sensors.

\$\endgroup\$
6
  • \$\begingroup\$ So, according to table 14, if I only read one channel at 30 kSPS I get a sampling frequency of 4374 Hz? \$\endgroup\$ – Tagalog Oct 30 '20 at 13:44
  • \$\begingroup\$ No. If you read all the channels by switching the multiplexer you will only get 4374Hz. You can read one channel at 30kSPS and really get 30kSPS. \$\endgroup\$ – JRE Oct 30 '20 at 13:50
  • \$\begingroup\$ And is it possible to enable channels one by one with different sampling frequencies each time? For example, I need to acquire signal from a sensor at a certain fs until a certain treshold is found, then switch to another Channel with another fs until a condition is detected and finally I need to acquire the signal at the highest frequency (10kSPS). In this way there would be only one channel enabled at a time. \$\endgroup\$ – Tagalog Oct 31 '20 at 9:17
  • \$\begingroup\$ Yes, you could do that. \$\endgroup\$ – JRE Oct 31 '20 at 11:36
  • \$\begingroup\$ I tried to enable only 1 channel and to set a sampling frequency. The only way to check if the sampling rate is exactly what I set is to read DRDY signal on oscilloscope measuring the length between falling edges, is it true? \$\endgroup\$ – Tagalog Nov 13 '20 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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