

ADcmXL3021 adapter
Data Acquisition (DAQ) of the Analog Devices ADcmXL3021 vibration sensor.
- Size
- 13 × 12.7 mm
- Copper layers
- 2
- Thickness
- 0.8 mm
- Parts
- 5
- Nets
- 14
- Pads
- 34
- Tracks, vias
- 75, 6
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 5 (file 20171130)
- Created
- 6 Jul 2020
- Updated
- 28 Aug 2022
Overview
ADcmXL3021 adapter is an open-source printed circuit board by jolau, from the jolau/VibrationDAQ repository on GitHub, published under the MPL-2.0 licence. It is a 2-layer board of 13 × 12.7 mm with 5 parts on 14 nets, routed with 75 tracks and 6 vias.
It is built around the DF12(3.0)-14DP-0.5V(86). Its parts include 3 connectors and 2 capacitors. It belongs with the interfaces and adapters boards of this library.
Main components
1README
README.mdVibrationDAQ
Data Acquisition (DAQ) of the Analog Devices ADcmXL3021 vibration sensor. The VibrationDAQ was developed as part of an internship at Wingtra by Jonas Lauener.
For any technical questions, please open an issue: https://github.com/jolau/VibrationDAQ/issues/new/choose
Copyright (c) 2020, Jonas Lauener & Wingtra AG

Hardware
- Raspberry Pi
- Analog Devices ADcmXL3021 vibration sensor capabilities
- Corrected data sheet
- Sensor orientation:

- Mass: 13 g
- Frequencies up to 110 kHz
- ±50 g measurement range
- MFFT mode: Spectral analysis through internal FFT
- 2048 bins per axis with user configurable bin sizes from 0.42 Hz to 53.7 Hz
- Windowing options: rectangular, Hanning, flat top
- MTC mode: Time domain capture
- 4096 samples per axis
- Features a status LED
Pinout Raspberry Pi

| pin | pin | ||
|---|---|---|---|
| RST 1 | 13 | ||
| BSY 1 | 15 | 16 | RST 2 |
| 3V3 | 17 | 18 | BSY 2 |
| MOSI | 19 | 20 | EMPTY |
| MISO | 21 | 22 | SYNC |
| SCLK | 23 | 24 | CE 1 |
| GND | 25 | 26 | CE 2 |
The vibration sensor only works on the main SPI pins (SPI0) of the Raspberry Pi - the other SPI ports don't support SPI mode 3.
Custom adapter board
The pins of the ADcmXL3021 vibration sensor can be accessed by using a custom adapter board. The PCB was created by using the software KiCad: KiCad project files

Installation
In case you want to setup your own VibrationDAQ on a Raspberry Pi:
- Install yaml-cpp (as described below)
- Clone this repo.
cd VibrationDAQmkdir build & cd buildcmake ..sudo make install
Make sure that you have enabled SPI.
You can use it now with vibration_daq_app [full path to config.yaml].
Installation of yaml-cpp
wget https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.tar.gztar -xvf yaml-cpp-0.6.3.tar.gzcd yaml-cpp-yaml-cpp-0.6.3/mkdir buildcd buildcmake .. -DYAML_BUILD_SHARED_LIBS=ONsudo make install
Enable/Disable auto-start
- Edit config.yaml path in vibration_daq.service file to own needs
sudo systemctl enable [full path to vibration_daq.service file]
This automatically links the service and enables it. Replaceenablewithdisableto disable service.
Dependencies
Many thanks to the authors of the following libraries:
Usage
Workflow
- Connect to the Raspberry Pi and adapt the
~/Documents/config.yamlto your requirements. Make sure that auto-start is enabled. If it's the first time you use it, test it by running it manually:vibration_daq_app [full path to config.yaml] - Mount the vibration sensor with the double sided tape 3M™ Adhesive Transfer Tape 950. This shouldn't distort the vibration too much.
- Do your measurement.
- Download the collected data over SFTP. I recommend to also download the used config file.
- Open a vibration CSV file in Google Sheets.
- For FFT measurement:
- Hide the first two data points as these have usually very high magnitude and don't give meaningful information
- Plot the data using a column chart.
- For FFT measurement:
Status led
If the status led is enabled in config, it will glow when running:
- Constant glow: data acquisition is running normally
- Blink: measurement completed, saving data to a new csv file
Config file
Short primer on the syntax of yaml: https://learnxinyminutes.com/docs/yaml/
Decimation Filter
Setting the right decimation_factor is crucial for getting meaningful data. Choose it according to the maximum vibration frequency you're expecting.
Of course, the decimation factor also affects the predefined FIR filters i.e. with a FACTOR_64, the LOW_PASS_10kHz is actually a 156 Hz low pass filter.
| decimation_factor | Effective Sample Rate, fS (SPS) | Effective FFT Bin Size, f_MIN (Hz) | Effective Maximum FFT Frequency, f_MAX (Hz) |
|---|---|---|---|
| FACTOR_1 | 220000 | 53.71094 | 110000 |
| FACTOR_2 | 110000 | 26.85547 | 55000 |
| FACTOR_4 | 55000 | 13.42773 | 27500 |
| FACTOR_8 | 27500 | 6.713867 | 13750 |
| FACTOR_16 | 13750 | 3.356934 | 6875 |
| FACTOR_32 | 6875 | 1.678467 | 3437.5 |
| FACTOR_64 | 3437.5 | 0.839233 | 1718.75 |
| FACTOR_128 | 1718.75 | 0.419617 | 859.375 |
Spectral average count
The spectral_avg_count determines the number of FFT records that the ADcmXL3021 averages when generating the final FFT result. Up to 255 records. Good for getting FFT measurements over longer time periods.
Calculate measurement duration
FFT
4096 samples / (220'000 sample rate / decimation_factor) * spectral_avg_count = record time [s]
Example with FACTOR_64 and 255 spectral averages:
4096 samples / (220000 sample rate / 64) * 255 = 303.84 seconds = 5.06 minutes
MTC
4096 samples / (220'000 sample rate / decimation_factor) = record time [s]
Example config with explanation
storage_directory: "/home/pi/Documents/"
recordings_count: 2 #number of recurring measurements, infinite if == 0
external_trigger: false # false: triggering over SPI;
# true: triggering over dedicated pin, useful for triggering multiple sensor at exact same time (connect them to same pin)
external_trigger_pin: 4 # only read if external_trigger == true
status_led: true # enable/disable status led, blinks everytime a vibration file is written
status_led_pin: 21 # only read if status_led == true
sensors:
- name: sensor1 #will be used for logging and filenames
busy_pin: 22 #BCM pin number
reset_pin: 27 #BCM pin number
spi_path: "/dev/spidev0.0"
recording_mode: MFFT # MTC and MFFT supported
MFFT_config: &mfftConfig #only read if recording_mode == MFFT
decimation_factor: FACTOR_2 #supported: [FACTOR_1 = 0, FACTOR_2 = 1, FACTOR_4 = 2, FACTOR_8 = 3, FACTOR_16 = 4, FACTOR_32 = 5, FACTOR_64 = 6, FACTOR_128 = 7]
fir_filter: CUSTOM #supported: [NO_FILTER, LOW_PASS_1kHz, LOW_PASS_5kHz, LOW_PASS_10kHz, HIGH_PASS_1kHz, HIGH_PASS_5kHz, HIGH_PASS_10kHz, CUSTOM]
custom_filter_taps: [6, 21, 53, 107, 193, 316, 480, 686, 930, 1203, 1490, 1774, 2034, 2251, 2407, 2489, 2489, 2407, 2251, 2034, 1774, 1490, 1203, 930, 686, 480, 316, 193, 107, 53, 21, 6]
spectral_avg_count: 2 # value between 1-255
window_setting: HANNING #supported: [RECTANGULAR, HANNING, FLAT_TOP]
MTC_config: #only read if recording_mode == MTC
decimation_factor: FACTOR_2
fir_filter: CUSTOM
custom_filter_taps: [6, 21, 53, 107, 193, 316, 480, 686, 930, 1203, 1490, 1774, 2034, 2251, 2407, 2489, 2489, 2407, 2251, 2034, 1774, 1490, 1203, 930, 686, 480, 316, 193, 107, 53, 21, 6]
- name: sensor2Example data
The following data was collected on a self-made vibration bench. The bench consists of an unbalanced mass attached to an electrical motor.
- MFFT raw data example
- Plot of MFFT data:

- Plot of MFFT data:
- MTC raw data example
Parts
5| Qty | Value | Footprint | References |
|---|---|---|---|
| 1 | 10UF 25V | Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder | C1 |
| 1 | 1UF 25V | Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder | C2 |
| 1 | Aux Pin Header | Connector_PinHeader_1.27mm:PinHeader_1x03_P1.27mm_Vertical | J3 |
| 1 | DF12(3.0)-14DP-0.5V(86) | Connector_Hirose:Hirose_DF12(3.0)-14DP-0.5V(86) | J1 |
| 1 | Pin Header | Connector_PinHeader_1.27mm:PinHeader_1x09_P1.27mm_Vertical | J2 |
Questions
How big is the ADcmXL3021 adapter PCB?
It measures 13 × 12.7 mm and has 2 copper layers, 0.8 mm thick.
What parts does the ADcmXL3021 adapter use?
5 parts, built around the DF12(3.0)-14DP-0.5V(86). The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the ADcmXL3021 adapter KiCad files?
From the jolau/VibrationDAQ repository on GitHub, at the commit this page was made from: the board is ADcmXL3021_adapter/ADcmXL3021_adapter.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the ADcmXL3021 adapter design in my own project?
Its repository publishes it under the MPL-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).
Similar boards
- 2 layers98 × 27 mm

- 2 layers21 × 33 mm

24g2usb pico2w
joypad-ai/joypad-os
Universal controller firmware for building adapters, dongles, and custom controllers.
5 parts1.7kApache-2.0 - 2 layers53.2 × 59.6 mm

A10 OLinuXino Lime Rev B SHIELD TEMPLATE
OLIMEX/OLINUXINO
OLINUXINO is Open Source / Open Hardware, low cost from EUR 24 Linux Industrial grade Single Board Computer capable to operate -25+85C
5 parts1.5k - 2 layers30 × 11 mm

Main control board servo tester
jamro/tiny-engineer
A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.
5 parts1.1k - 2 layers78.8 × 35.3 mm

KiCadTest
hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!
5 parts915 - 2 layers50 × 23 mm

- 2 layers43.2 × 28.5 mm

- 2 layers20.3 × 15.2 mm

L0 light sensor
Luos-io/luos_engine
Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.
5 parts546MIT