Documentation
Sensor Agnostic Module for ICP Signal Conditioner
roto_icpsc.aar Library for Androidâ„¢
- Version: 1.01
- Author: David Bukowitz
- Created: 04 Dec, 2020
- Update: 1 Nov, 2021
If you have any questions that are beyond the scope of this document, Please feel free to email via info@rotovibes.com
Description
roto_icpsc.aar is an Androidâ„¢ library that allows communication with the 2-Channel USB ICP Signal Conditioner. The library provides simple commands to scan, connect, collect and post-process the vibration data.
Installation
Follow the steps below to install the roto_icpsc.aar library
- In your projects top bar menu, select >File >New >New Module... A new window will appear, select "Import .JAR/.AAR Package" from the options
- In the new popup window browse and select the roto_icpsc.aar library adn click on "Finish"
- The roto_icpsc library will appear on the right
- in your App build.gradle add the following dependency
...
dependencies {
...
implementation files('libs/roto_icpsc.aar')
}
...
Configuring your project
- Add the MODIFY_AUDIO_SETTINGS, RECORD_AUDIO and WRITE_EXTERNAL_STORAGE permits to the Android Manifest
- In your Activity import com.rotovibes.roto_icpsc.icpsc_conn and add the permissions request
...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rotovibes.sam_modules_test">
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
...
import com.rotovibes.roto_icpsc.icpsc_conn;
...
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActivityCompat.requestPermissions(this,new String[]{
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1001);
ActivityCompat.requestPermissions(this,new String[]{
Manifest.permission.RECORD_AUDIO, Manifest.permission.RECORD_AUDIO}, 1002);
...
Connecting to the Sensor
- Create actions to scan and connect to the USB ICP Signal Conditioner.
- Once connected to a device, send the icpsc_conn.collectSignal(int numberSamplesCode, int samplingRateCode) command to collect data with the specific number of samples and sampling rate. There are 4 sampling rates and 6 number of samples options for this sensor in this library.
- There are other functions for Overall vibration values processing, spectrum data generation, integration, etc. This documentation will be available soon
- Fixed Bug Fixed
...
//start scanning for the usb sensor
icpsc_conn.scanSensor(yourContext);
...
Once the device is connected to the USB port the output in the console should display the ID of the device
Collecting Data
//samplingRateCode:3 -> SamplingRate = 5512
//samplingRateCode:2 -> SamplingRate = 11025
//samplingRateCode:1 -> SamplingRate = 22050
//samplingRateCode:0 -> SamplingRate = 44100
//numberSamplesCode:0 -> NumberOfSamples = 1024
//numberSamplesCode:1 -> NumberOfSamples = 2048
//numberSamplesCode:2 -> NumberOfSamples = 4096
//numberSamplesCode:3 -> NumberOfSamples = 8192
//numberSamplesCode:4 -> NumberOfSamples = 16384
//numberSamplesCode:5 -> NumberOfSamples = 32768
...
icpsc_conn.collectSignal(int numberSamplesCode, int samplingRateCode)
...
Combine this framework with vibEngine.framework to perform signal post-processing and with the vibeFDaD.framework to analize the machine condition. Third party frameworks can also be used to plot and enhance the users interface.
Changelog
See what's new added, changed, fixed, improved or updated in the latest versions.
Version 1.01 (1 Nov, 2021)
Version 1.0 (4 Dec, 2020)
Initial Release for Androidâ„¢