Measure Sound and Vibration
This app continuously acquires data of the IEPE sensors like accelerometer and microphones for a user-specified group of channels until the acquisition is stopped by the user.
Hardware
- Raspberry Pi registered in RESWARM (For Detail Click Here)
- MCC DAQ HAT 172 (MCC HAT)
- IEPE Sensor/s (IEPE Standard)
Usage Instructions
Install the 2x20 receptacle with extended leads (MCC provides a Samtec SSQ-120-03-T-D or equivalent) onto the Raspberry Pi GPIO header by pressing the female portion of the receptacle onto the header pins, being careful not to bend the leads of the receptacle. Please don't forget to attach the IEPE sensor/s with the board channel/s.
Install the App
To use the app on your Raspberry Pi, go to RESWARM into the devices menu of the swarm where your device is registred (How To Navigate in RESWARM. There create a group and add the device to the group and install this app to this group as well (Add a New Group). Now the device will start downloading the app. To setup the device with your MCC DAQ HAT you can provide some parameters. To do that go to the group you created and find the app that is listed in this group. There you can click on the environment variables and you can provide the below mentioned environment variables. These environment variables are required to setup the MCC DAQ 172 device and in case no environment variable is provided, default values of the environment variables are used.
Variable | Value | Default Value |
---|---|---|
DATA_SUBFOLDER | Output directory for csv files | /shared/mccdaq |
LOW_CHANNEL | First channel whoes output must be written to the output file e. g. 0 or 1 | 0 |
HIGH_CHANNEL | Last channel whoes output must be written to the output file e. g. 0 or 1 | 1 |
SCAN_RATE | Scan Rate of the channel/s | 51200.0 |
ENABLE_IEPE_CH0 | Enable IEPE for channel 0 | 0 |
ENABLE_IEPE_CH1 | Enable IEPE for channel 1 | 0 |
MAX_OUTPUT_FILE_SIZE_MB | After this size in MB a new file will be started | 50 |
SAMPLE_PER_CHANNEL | How many samples must be written to a channel/ buffer size | 100000 |
SENSITIVITY_CH0 | Sensitivity of the channel 1 | 1000.0 |
SENSITIVITY_CH1 | Sensitivity of the channel 2 | 1000.0 |
HAT_ADDRESS | Address of the DAQ HAT | 0 |
How it works
This App uses daqhats python module to communicate with the MCC DAQ 172. The status LED starts blinking as soon as the App establishes a connection with the module and start communicating. Moreover, the frequency at which each channel is scanned/ the values of each channel are read depends on environment variable SCAN_RATE. The defualt value of SCAN_RATE for a channel is set to 51200.0 which is also the highest possible scan rate value for a single channel. Having set SCAN_RATE = 51200.0, the user can expect that the device will fetch data from the attached sensor 51200.0 times per second. The scanned values are fetched and written to a mccdaq/*.wav file. The wav file is saved in the user specified output directory ready for sending to a cloud storage which by default is /shared/mccdaq.
Not to forget, the value of SAMPLE_PER_CHANNEL allows the MCC DAQ HAT 172 to save scanned values onto the Raspberry Pi. The default values of SAMPLE_PER_CHANNEL is set to 100000.0 which means that the DAQ device puts measurement values continously onto the Raspberry Pi/ Buffer during the scan and these values must be read/fetched before they reach the limit of 100000. In case the device keeps putting scanned values onto the Raspberry Pi/ Buffer and these values are not read/fetched then an error e. g. buffer overrun error is thrown by the device. In this case, the scan must be stopped and the buffer must be cleaned in order to restart the scan.
Additionally, a user can change the size of output file by providing the above mentioned environment variables. Each file can be distinguished by its name, as the file name also contains the timestamp at which the file was created. In case of stacked/multiple DAQ HAT board, please don't forget to install the appropriate jumpers onto address header locations A0-A2 of the new HAT board. For more detail please visit the page related to installation of DAQ HAT boards (Installing the DAQ HAT board).
For Developers
To develop and build the app we are creating a Docker image that can be run on the device. Please check this git repository (daqhats) to find detailed information about the installation of MCC DAQ HAT. Moreover, dtparam=spi=on must be added to the Boot Configuration in order to activate/enable the SPI device. The Boot Configuration can be found in Device Maintanance under Devices Tab. At last, you just have to restart the device 2 times. On first attempt, the configuration file is change while on the second attempt, the changed configuration file is used to enable SPI module during the boot.