RasPI ADC Logger


To acquire and subsequently process analog data from sensors, it is necessary to use an Analog – Digital converter : an ADC card. The possible solutions are manifold. For example, it is possible to use a PSoC chip that provides ADC components, acquire the data and subsequently transmit the data to a Raspberry Pi for subsequent processing, as we have described in the Raspberry Pi Logger (ENG) project. Alternatively you can use the excellent Theremino ADC24 module. In this post we want to describe a different solution based only on the use of the Raspberry.

There’s no AD/DA function on the Raspberry Pi GPIO interface, this may trouble you in the Pi development. However there is the possibility to use expansion boards that add AD/DA functionality to Raspberry Pi. One of these boards is the waveshare board which is a High-Precision AD/DA Board that allows you to add high-precision AD/DA functions to the Raspberry Pi.


  • Standard Raspberry Pi 40 PIN GPIO extension header, supports Raspberry Pi series boards
  • Onboard ADS1256, 8 ch 24 bit high-precision ADC (4 ch differential input), 30 ksps sampling rate
  • Onboard DAC8532, 2 ch 16 bit high-precision DAC
  • Onboard input interface via pin headers, for connecting analog signal
  • Onboard input/output interface via screw terminals, for connecting analog/digital signal
  • Features AD/DA detect circuit, easy for signal demonstration

The image below shows the board with the main components / functions :

RPi expansion board on board resource

  1. Raspberry Pi GPIO interface: for connecting with the Pi
  2. AD/DA input/output : screw terminals
  3. AD input : pin headers
  4. 7.68M crystal
  5. LM285-2.5 : provides reference voltage for the ADC chip
  6. Photo resistor
  7. LED output indicator
  8. 10K potentiometer
  9. DAC8532 : 16 bit high-precision DAC, 2 ch
  10. Power indicator
  11. ADS1256 : 24 bit high-precision ADC, 8 ch (4 ch differential input)
  12. ADC testing jumper
  13. DAC testing jumper
  14. Power selection jumper
  15. ADC reference ground configuration : when AD single inputted, the AINCOM is reference terminal, can be connected to GND or external reference voltage

Python Code

The python code can be found at this link : AccelerPI. It must be taken into account that the operation of reading an analogue channel takes around 7 msec. So the sample rate cannot be faster than 100 Hz. In case of reading more than one channel the sample rate must be consequently slower.

C Code

The C code can be found at this link : wiringpi. The C code is much faster than the python code : the operation of reading the value from one channel takes around 1 msec, so the sample rate can be much faster.

Acquisition of Signals from an Accelerometer

As an example of application of the AD card we present the reading of the analog signals produced by a solid state accelerometer.

The LIS344ALH is an ultra compact consumer low-power three-axis linear accelerometer that includes a sensing element and an IC interface able to take information from the sensing element and to provide an analog signal to the external world.

The LIS344ALH has a dynamically user selectable full-scale of ± 2 g / ± 6 g and it is capable of measuring accelerations over a maximum bandwidth of 1.8 kHz for all axes. The device bandwidth may be reduced by using external capacitances.

The images below show the component mounted on a breakout board equipped with leveling capacitors.

The sensor output signal is buffered by operational, as indicated in the diagram shown below. The signal is also translated on an intermediate level of 1.65V in order to exploit the entire 3.3V range made available by the ADC converter.

The image below shows the sensor and the board with the front end electronics for the pre-processing of the signals produced by the accelerometer. The yellow components are the polyester capacitors for the filtration of the continuous component. The following image shows the box with the three SMA outputs corresponding to the three channels X, Y and Z of the accelerometer.

The signals acquired by the ADC card and subsequently processed by a python software can be viewed in a classic seismic trace such as those shown below. These are the recordings of the signals obtained from the three channels X, Y and Z. At the end of the track there is an oscillation caused artificially.

For the recording of seismic events it should be taken into account that these accelerometers are not very sensitive, this means that they can mainly provide the recording of intense seismic events and can be useful especially in cases where the strong signal saturates normal seismometers.

If you liked this post you can share it on the “social” Facebook, Twitter or LinkedIn with the buttons below. This way you can help us! Thank you !


If you like this site and if you want to contribute to the development of the activities you can make a donation, thank you !

Check Also

KC761B: the new Gamma Spectrometer from DEEPACE

Abstract: in this article, we present an interesting new apparatus dedicated to gamma spectrometry and dosimetry measurements. It is a device based on a CsI(Tl) scintillator coupled to solid-state photomultipliers: SiPM. In addition to the scintillation sensor, the instrument has a PIN diode sensitive to beta radiation.