Documentation
Sensor Agnostic Module for Sensor-Works BluVib M-V-T-3
roto_bluvibmvt3.framework for iOS®/iPadOS®
- Version: 1.01
- Author: David Bukowitz
- Created: 5 June, 2021
- Update: 20 Oct, 2021
If you have any questions that are beyond the scope of this help file, Please feel free to email via info@rotovibes.com
Description
roto_bluvibmvt3 framework is an iOS®/iPadOS® library that allows communication with the Sensor-Works BluVib M-V-T-3 bluetooth 3-axis acceletometer. The framework provides simple commands to scan, connect, collect and post-process the vibration data.
Installation
Follow the steps below to install the roto-bluvibmvt3 framework
- Drag and drop the roto_bluvib3.framework file into your Xcode project
- Select the "Embed & Sign" option in the Framworks, Libraries and Embedded Content menu
Configuring your project
- Add the bluetooth usage key "NSBluetoothAlwaysUsageDescription" to the info plist and enter your customized value string
- Import the roto_bluvib3.framework to your project class
#import "ViewController.h"
#import "roto_bluvibmvt3/roto_bluvib3.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
Connecting to the Sensor
- Create an action to scan the bluetooth sensors and add the scanBleSensor function.
- Request the available sensors peripheral info using (NSMutableArray*)getListOfSensor function. This will return an array of CBPeripheral.
- Connect to a specific sensor by sending the selected peripheral Id using: connectToSensorId: (CBPeripheral*)sensorId. Pass the object from the previous sensor array list to this command
...
- (IBAction) scanBleSensor {
[roto_bluvib3 scanBleSensor];
}
The output in the log console should display:
...
- (IBAction) scanBleSensor {
[roto_bluvib3 scanBleSensor];
}
- (IBAction) getListOfSensor {
NSLog(@"ListOfSensor: %@", [roto_bluvib3 getListOfSensor]);
}
The output in the log console should display:
...
- (IBAction) getListOfSensor {
NSLog(@"ListOfSensor: %@", [roto_bluvib3 getListOfSensor]);
}
- (IBAction) connectToSensorId {
[roto_bluvib3 connectToSensorId:[[roto_bluvib3 getListOfSensor] objectAtIndex:yourSelectedPeripheralId]];
}
The output in the log console should display:
Collecting Data
- Once connected to a sensor, send the getDataWithSamplingRate: (int)samplingRate numberOfSamples:(int)numberOfSample command to collect data with the specific number of samples and sampling rate. There are 6 sampling rates and 7 number of samples options in this sensor. Use (int)samplingRateCode:(int)samplingRateCode and (int)numberSamplesCode:(int)NumberSamplesCode to return the actual number of samples and sampling rate.
- Use (bool)didFinishMeasuring to check if data collection is completed. Use the getOverallRmsAcc, getOverallRmsAcc and getOverallRmsAcc to return the Acceleration Overall, Velocity Overall and Raw Data Arrays repectively. Note: Data returned wil be for the 3 Axes.
//samplingRateCode:0 -> SamplingRate = 512
//samplingRateCode:1 -> SamplingRate = 1280
//samplingRateCode:2 -> SamplingRate = 2560
//samplingRateCode:3 -> SamplingRate = 5120
//samplingRateCode:4 -> SamplingRate = 12800
//samplingRateCode:5 -> SamplingRate = 25600
//numberSamplesCode:0 -> NumberOfSamples = 512
//numberSamplesCode:1 -> NumberOfSamples = 1024
//numberSamplesCode:2 -> NumberOfSamples = 2048
//numberSamplesCode:3 -> NumberOfSamples = 4096
//numberSamplesCode:4 -> NumberOfSamples = 8192
//numberSamplesCode:5 -> NumberOfSamples = 16384
//numberSamplesCode:6 -> NumberOfSamples = 32768
...
- (IBAction) connectToSensorId {
[roto_bluvib3 connectToSensorId:[[roto_bluvib3 getListOfSensor] objectAtIndex:yourSelectedPeripheralId]];
}
- (IBAction) getDataWithParamters {
[roto_bluvib3 getDataWithSamplingRate:2 numberOfSamples:2];
NSLog(@"NumSamples: %i", [roto_bluvib3 numberSamplesCode:2]);
NSLog(@"SampRate: %i", [roto_bluvib3 samplingRateCode:2]);
}
The output in the log console should display:
...
- (IBAction) getOVerallRmsGs {
if ([roto_bluvib3 didFinishMeasuring]) {
NSLog(@"Overall Acc: %@", [roto_bluvib3 getOverallRmsAcc]);
NSLog(@"Overall Vel: %@", [roto_bluvib3 getOverallRmsVel]);
NSLog(@"Raw Data: %@", [roto_bluvib3 getsignalRawData]);
}
}
The output in the log console should display:
Changelog
See what's new added, changed, fixed, improved or updated in the latest versions.
Version 1.01 (20 Oct, 2021)
- Updated Optimized for iOS®15
Version 1.0 (5 June, 2021)
Initial Release for iOS©