Blog

 

Reading sensor data using HiFiBerry ADCs

HiFiBerry offers a wide range of analog-to-digital converters. With the new ADC8x add-on, you can sample eight independent channels at up to 192kHz. This makes our ADCs ideal not only for high-quality audio recordings but also for certain data acquisition tasks. Standalone ADCs with 24-bit resolution can be quite expensive—so why not consider a HiFiBerry ADC for these applications? In many cases, this is a great option. However, there are some important limitations to keep in mind:

  • DC Blocking: For audio applications, it is essential to block the DC component of the input signal. All our ADCs use AC coupling, meaning they cannot measure DC voltages.
  • Input Voltage Range: The typical input range is ±3V. While slightly higher voltages may not immediately damage the ADCs, significantly larger voltages—such as 10V or more—can. To prevent damage, avoid applying excessive input voltages. If necessary, use protection circuits like Zener diodes to limit voltage spikes.
  • Streaming API: The ALSA API is designed for continuous data streaming and does not support reading a single sample at a time. Instead, it returns a buffer of multiple samples (typically 128 or more, depending on application settings).
  • Supported Sample Rates: These ADCs only support standard audio sample rates (44.1kHz, 48kHz, 96kHz, and 192kHz). Non-audio sample rates such as 20kHz or 100kHz are not supported.

Does your application align with these constraints? If so, a HiFiBerry ADC could be a great solution for your data acquisition needs. You can interface with it using the ALSA API to develop custom applications or leverage existing tools like sox or arecord. ALSA API bindings are available for almost any programming language. If the C API seems too complex, consider using the Python bindings via pyalsaaudio for easier integration.

March 24, 2014

Subscribe to new blog posts