Vsens Sofware Design Document

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

Software Design

Document
Date Comments Author Reviewers
04-5-2019 Added vSens generic sensor architecture Vijaylakshmi K Chethan S
different layers
17-05-2019 Added Packet Information and Parsing logic
31-05-2019 Feasibility Check for wired vibration sensor. Vishwanath G G Chethan S
08-07-2019 Configuration Packet details Vijaylakshmi K Chethan S
25-07-2019 Moved vSens generic information to Vijaylakshmi K
corresponding section
24-05-2021 Added Analytics configuration and data packet Vamshi Krishna Chethan S
formats
22-10-2021 Described accelerometer & velocity RMS packet Vijaylakshmi K Chethan S
structure

Abbreviations
Abbreviations Description
CC Connected Continuous
UUID Universally Unique Identifier
BLE Bluetooth Low Energy
BIST Built-In Self test
POR Power On Reset
BLE Bluetooth Low Energy
BI Burst Interval
BD Burst Duration

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
Contents

Abbreviations..............................................................................................................................................1
1 Introduction........................................................................................................................................4
2 vSens Advertising Packet Information................................................................................................4
2.1 Accelerometer Data.........................................................................................................................5
2.2 EPOCH timestamp Parser:...............................................................................................................6
2.3 Accelerometer Data Parser:.............................................................................................................7
2.4 Calculate Timestamp for each sample.............................................................................................8
2.5 Temperature Data...........................................................................................................................8
2.6 Battery Data.....................................................................................................................................9
3 Feasibility Check for Wired Vibration Sensor...................................................................................11
3.1 Block Diagram with Wired Sensor Approach.................................................................................11
3.2 Hardware (Wired Vibration Sensor)...............................................................................................11
3.3 Software (Wired Vibration Sensor)................................................................................................12
4 Generic Sensor Architecture.............................................................................................................13
5 Generic Configuration Packet Details...............................................................................................15
5.1 vSens Product................................................................................................................................16
5.2 Accelerometer...............................................................................................................................16
5.2.1 Sensor Configuration.........................................................................................................17
5.2.2 Sampling Frequency...........................................................................................................17
5.2.3 Range.................................................................................................................................17
5.2.4 Accelerometer offset Operation........................................................................................17
5.3 Temperature..................................................................................................................................17
5.3.1 Sensor Configuration.........................................................................................................18
5.3.2 Read Rate...........................................................................................................................18
5.3.3 Thresholds.........................................................................................................................18
5.4 Battery...........................................................................................................................................19
5.4.1 Read Rate...........................................................................................................................19

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
5.4.2 Thresholds.........................................................................................................................19
5.5 Analytics........................................................................................................................................19
5.5.1 FFT enabled........................................................................................................................20
5.5.2 Accelerometer RMS enabled.............................................................................................20
5.5.3 Velocity RMS enabled........................................................................................................20
5.5.4 FFT Window size................................................................................................................20
5.5.5 Averaging...........................................................................................................................20
5.5.6 Peak Filtering size..............................................................................................................20
6 Generic Data Packet Details..............................................................................................................21
6.1 Accelerometer...............................................................................................................................21
6.2 Temperature..................................................................................................................................21
6.3 Battery...........................................................................................................................................21
6.4 Accelerometer Offset.....................................................................................................................22
6.5 FFT data.........................................................................................................................................22
6.6 RMS data.......................................................................................................................................22

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
1 Introduction
This document describes the vSens sensor generic architecture design details and vsens specific
design details.

2 vSens Advertising Packet Information


Packet Structure
Total size of the advertisement packet is up to 31 bytes. Following is the packet structure.
Byte 1 to 6 7 to 31
Description Header Data

Header
Byte Name Value
1 Length of this Data 0x02
2 Advertisement type flag. General Discoverable mode 0x01

3 LE General Discoverable Mode and BR/EDR Not 0x06


Supported
4 Data Length 0x06 to 0x1B
5 Manufacturer Specific Data 0XFF
6 Packet Identifier 0x03,0x04,0x0E,0x0F

Data
Explained under each p acket Identifier
Packet Identifier Types
Different data packets are advertised.
Sl Packet Data Data type Description
No

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
Identifier Length
Value
1 0x0F 0x1B Accelerometer Contains up to 3 Accelerometer samples
2 0x03 0x08 Temperature Contains 1 temperature sample
3 0x04 0x08 Battery Contains 1 battery sample
4 0x0E 0x06 End of data Contains only accelerometer sample
collected time stamp. It indicates there are no
sensors and battery sample to advertise at
present

2.1 Accelerometer Data

Byte Name Value Notes


7 EPOCH time stamp byte 3 -

8 EPOCH time stamp byte 2 - Date and time when


accelerometer sample is
9 EPOCH time stamp byte 1 - collected

10 EPOCH time stamp byte 0 -

11 Accelerometer Sampling Rate 0x09 0x09-200 Hz accelerometer


sampling rate
12 Accelerometer packet index 0x01 to 0x0E 3 axis 40 samples are collected.
One packet contains up to 3
samples of 3 axis.
13 Accelerometer Range 0x00 to 0x03 0x00-2G
0x01-4G
0x02-8G
0x03-16G
Accelerometer range is
configurable in connected
mode.
14 Accelerometer X-axis LSB Byte 0x00 to 0xFF

15 Accelerometer X-axis MSB Byte 0x00 to 0xFF

16 Accelerometer Y-axis LSB Byte 0x00 to 0xFF Accelerometer sample-1.


Output in 2’s complement
17 Accelerometer Y-axis MSB Byte 0x00 to 0xFF format.MSB byte has the sign
bit.
18 Accelerometer Z-axis LSB Byte 0x00 to 0xFF

19 Accelerometer Z-axis MSB Byte 0x00 to 0xFF

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
20 Accelerometer X-axis LSB Byte 0x00 to 0xFF

21 Accelerometer X-axis MSB Byte 0x00 to 0xFF

22 Accelerometer Y-axis LSB Byte 0x00 to 0xFF Accelerometer sample-2.


Output in 2’s complement
23 Accelerometer Y-axis MSB Byte 0x00 to 0xFF format.MSB byte has the sign
bit.
24 Accelerometer Z-axis LSB Byte 0x00 to 0xFF

25 Accelerometer Z-axis MSB Byte 0x00 to 0xFF

26 Accelerometer X-axis LSB Byte 0x00 to 0xFF

27 Accelerometer X-axis MSB Byte 0x00 to 0xFF

28 Accelerometer Y-axis LSB Byte 0x00 to 0xFF Accelerometer sample-3.


Output in 2’s complement
29 Accelerometer Y-axis MSB Byte 0x00 to 0xFF format.MSB byte has the sign
bit.
30 Accelerometer Z-axis LSB Byte 0x00 to 0xFF

31 Accelerometer Z-axis MSB Byte 0x00 to 0xFF

Note-If all 3 axis sample value is 0x00, which indicates no accelerometer sample.
Example –If byte number from 26 to 31 received values is 0x00 which indicates no accelerometer
sample.

2.2 EPOCH timestamp Parser:


To convert hex value bytes to timestamp in seconds the bytes has to be converted to decimal base and
to be combined as follow:
(((Epoch_byte_3, 10) * 16777216) + ((Epoch_byte_2, 10) * 65536) + ((Epoch_byte_1, 10) * 256) +
(Epoch_byte_0, 10)).
 (Epoch_byte_3, 10) - Converting Hex value to decimal value.
 Multiplying and adding will convert individual byte to a complete number.

For Ex: Let’s take a sample accelerometer packet:


0201061BFF0F5CD4015F09010069FA673F2A04F5FA8A3F4404E9FAA93E2904

* Epoch time stamp bytes are:


Epoch_byte_3 - 5C
Epoch_byte_2 - D4
Epoch_byte_1 - 01
Epoch_byte_0 - 5F

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
* Converting Hex values to Decimal:
Epoch_byte_3 - 92
Epoch_byte_2 - 212
Epoch_byte_1 - 01
Epoch_byte_0 - 95

* Combining to form an Integer number which represents Epoch Time in seconds


epoch_timestamp = ((92 * 16777216) + (212 * 65536) + (01 * 256) + 95) = 1557397855

2.3 Accelerometer Data Parser:


To convert hex byte value to X, Y and Z Accelerometer values in G unit, follow below steps:
1. Convert hex value to decimal number, then combine MSB and LSB bytes to form an integer number
using below formula:
(((Accelerometer X-axis MSB, 10) *256) + ((((Accelerometer X-axis LSB, 10))
(((Accelerometer Y-axis MSB, 10) *256) + (Accelerometer Y-axis LSB, 10))
(((Accelerometer Z-axis MSB, 10) *256) + (Accelerometer Z-axis LSB, 10))
 (Accelerometer_X_MSB, 10) - Converting Hex value to decimal value.

And Apply 2’s compliment on the results of above calculation to obtain signed values.

2. Convert the value in unit G by applying below calculation:


(Accelemeter_X_2’s_complimeted / 32768) * range
(Accelemeter_Y_2’s_complimeted / 32768) * range
(Accelemeter_Z_2’s_complimeted / 32768) * range
 Device will send the range Index value in 13 th byte. Use the index value to calculate the range
from the array: [2, 4, 8, 16]

For ex: Let’s consider the sample accelerometer packet:


0201061BFF0F5CD4015F09010069FA673F2A04F5FA8A3F4404E9FAA93E2904
Range index is 00 (13th byte)
Fetching 0th index from the range array will give you range value as 2.
Sample 1: 69FA673F2A04
Accelerometer X-axis MSB – FA, Accelerometer X-axis LSB – 69
Accelerometer X-axis MSB – 3F, Accelerometer X-axis LSB – 67
Accelerometer X-axis MSB – 04, Accelerometer X-axis LSB – 2A
* Converting from Hex value to decimal:
Accelerometer X-axis MSB – 250, Accelerometer X-axis LSB – 105
Accelerometer X-axis MSB – 63, Accelerometer X-axis LSB – 103
Accelerometer X-axis MSB – 04, Accelerometer X-axis LSB – 42
* Combining to form an integer value:
Accelerometer_X = ((250 * 256) + 105) = 64105
Accelerometer_Y = ((63 * 256) + 103) = 16231
Accelerometer_Z = ((04 * 256) + 42) = 1066
* Applying 2’s compliment
Accelerometer_X_2’s_complent = -1431
Accelerometer_Y_2’s_complent = 16231

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
Accelerometer_Z_2’s_complent = 1066

* Convert the value in unit G by applying below calculation:


Accelerometer X-axis in G = (-1431/ 32768) * 2 = -0.087341309
Accelerometer Y-axis in G = (16231/ 32768) * 2 = 0.990661621
Accelerometer Z-axis in G = (1066/ 32768) * 2 = 0.065063477

2.4 Calculate Timestamp for each sample


The timestamp received in the accelerometer is the time when the burst data has started. To calculate
particular sample timestamp, follow below steps:
1. Calculate value of sampling rate using the information from Packet:
Device will send the Sampling rate Index value in 11 th byte. Use the index value to calculate the Sampling
rate from the array: [0, 0.78, 1.5, 3.1, 6.25, 12.5, 25, 50, 100, 200, 400]
For ex: 11th byte index number is 0x09 and 9 th index of the array is 200. Thus, sampling rate is 200Hz.
* Note: When device is not connected with the VegamGSensors android app or gets reset after
connecting, the sampling rate index value sent by the device will be 0x0A. This is a known issue and will
be fixed in next firmware update

2. Based on sampling rate calculate the time for each sample:


Sampling Seconds = ((1000 / sampling Rate) / 1000)
For ex: If sampling rate is 200, applying above formula will give value as 5ms. Thus, each accelerometer
sample is obtained at the rate of 5ms.
3. Packet Time Stamp:
Calculate timestamp of a packet based on packet index (12 th byte):
* Apply the formula to calculate packet time stamp:
- packet_timestamp = epoch_timestamp + (((packet Index - 1) * 3) * Sampling Seconds)
* 3 represents the total accelerometer samples.
* Sampling Seconds is the value calculated in Step 2.
* This will give the time when first sample in the packet is obtained.
For ex: Let’s consider the sample accelerometer packet:
0201061BFF0F5CD4015F09040004FB013F0104D9FA7E3F0404DAFA923ECA03
Packet index value is 4 in the above packet (12 th byte), so first calculate epoch_timestamp using EPOCH
timestamp Parser.
* Calculate packet time stamp:
packet_timestamp = 1557397855 + (((4 – 1) * 3) * 5) = 1557397900

4. Calculate Sample_Timestamp.
* Apply the formula:
- sample_timestamp = packet_timestamp + (Sampling Seconds * (sample number -1)).
Sample number: Indicates the position of the sample from 3 samples which are available in
Accelerometer packet
* This will give the time of when each sample was obtained.
For ex: Let’s consider the sample accelerometer packet:
0201061BFF0F5CD4015F09010069FA673F2A04F5FA8A3F4404E9FAA93E2904
For first sample time stamp would be 1557397855

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
For second sample,
sample_timestamp = 1557397855 + (5 * (2 -1)) = 1557397860
For third sample,
sample_timestamp = 1557397855 + (5 * (3 -1)) = 1557397865

2.5 Temperature Data

Byte Name Value Notes


7 EPOCH time stamp byte 3 -

8 EPOCH time stamp byte 2 - Time when temperature


sample is collected
9 EPOCH time stamp byte 1 -

10 EPOCH time stamp byte 0 -

11 Temperature Alert 0x00 to 0x03 If temperature alert is enabled


following values are possible,
0x00 to 0x03. For more details
see the temperature alert
table.

12 Temperature Data 0x00 to 0x46 Current temperature

Temperature Alert table

Sl Temperature Alert Alert Description


No Values Type
1 0 No-Alert Temperature alert is disabled or no alert occurred.
No Alert-If current temperature value is not more than
warning temperature value.
2 1 Warning If current temperature >= warning temperature and < critical
temperature
3 2 Critical If current temperature >= critical temperature and < fatal
temperature
4 3 Fatal If current temperature > fatal temperature

Note: Temperature alerts are configured in the device connected mode.


a. User can prompt for enabling warning.
If warning is enabled the critical and fatal is also enabled.
b. User can prompt for enabling critical.
If critical is enabled then fatal is also enabled
c. User can prompt for enabling only fatal.

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
2.6 Battery Data

Byte Name Value Notes


7 EPOCH time stamp byte 3 -

8 EPOCH time stamp byte 2 -


Time when battery sample is
9 EPOCH time stamp byte 1 - collected

10 EPOCH time stamp byte 0 -

11 Battery alert 0x00 to 0x02 If battery alert is enabled


following values are possible,
0x00 to 0x02. For more details
see the battery alert table.

12 Battery percentage 0x37 to 0x64 Current battery %

Battery Alert Table


Sl Battery Alert Alert Description
No Values Type
1 0x00 No Alert Battery alert is disabled or no alert occurred.
No alert-If current battery % is greater than the alert %
2 0x01 Warning Warning-if current battery % is lesser than or equal to the warning
alert % and greater than critical %.
Critical % is not configurable. Its % is 65.
3 0x02 Critical Critical-If current battery % is lesser than the critical battery %.
Device does not work below the 55% and hence replace this battery
with charged battery.

 End Of Data Packet


Byte Name Value Notes
7 EPOCH time stamp byte 3 -

8 EPOCH time stamp byte 2 -


Time when accelerometer
9 EPOCH time stamp byte 1 - sample is collected

10 EPOCH time stamp byte 0 -

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
Vegam.IO Solutions Private Limited
CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
3 Feasibility Check for Wired Vibration Sensor
This section details the software and hardware feasibility of developing or upgrading
the vSens 3 Axis to a wired version. The primary use case of wired version is in the
enclosed environments, where the wireless connectivity/access to vSens is poor. Wired
vibration sensor is expected to provide the vibration data via serial communication.

3.1 Block Diagram with Wired Sensor Approach

o WiredvSens shall be deployed in use-cases where the BLE range or connectivity


is a challenge.
o WiredvSens shall be configured using BLE mobile app at a very close range.
o Multiple WiredvSens Sensors can be connected to a single master via serial
interface.
o Master shall collect data from connected WiredvSens sensors based on mac_id
arbitration.
o Master shall at as act as aggregator and/or gateway.

3.2 Hardware (Wired Vibration Sensor)

Si. No Requirement Feasibility Challenges/ Cons


GPIO’s for Uart Pins are accessible via Test
Serial Points only. Hence not
1. DIO_10, DIO_11, DIO_12
Communication on recommended for
Jorjin Module deployment.
2. 4-Line Connectivity Option -1
(Vcc, Gnd, Rx, Tx)  TempAlert (DIO_13) and  Custom Adapter Board has
ACC_INT (DIO_6) can be used to be designed that will
and Serial Lines tape-out DIO_13 and

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
 Custom Adapter board (4 Pin DIO_6 from BLE Board to
connector and 2 FPC Sensor Board
connectors) can be used as  Use of ACC_INT as Serial
intermediate between BLE Line will limit the interrupt
Board and Sensor Board. features of Accelerometer
 Aligning the connector
such that it can be easily
accessed through the
4 Pin Connector
3. Yes casing.
Mounting
 Casing Design will have to
be re-looked to maintain
the IP requirements

3.3 Software (Wired Vibration Sensor)

Si. No Requirement Feasibility Challenges/ Cons


Uart Configuration of Available
1. Yes NA
GPIO’s
 ACC will have to be operated in
non-interrupt mode
2. Use of ACC_INT as Serial Line Yes  Wired and Burst mode (BLE)
cannot be implemented on the
same board.
Connecting multiple sensors to a  Protocol for arbitration has to be
3. Yes
single wired gateway (Ex: R-Pi) designed

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
4 Generic Sensor Architecture
Following section details out the vSens generic different software layer details.

Softwar
e Layer Software Details Sensor-Accelerometer Sensor -Temperature
Name
OnPor()
 All sensor’s BLE sensor
layer OnPor() function is called here

OnBleInit()
 Initialize the BLE GAP & GATT services
 All sensor’s BLE Sensor layer OnBleInit() function is called
OnAdvertisement()
 Reconfigure & start BI clock

OnEvent()
typedef
{ 1. OnBroadcastEvent()
OnPor,  Fetch sensor data & store it in a advert buffer
OnBleInit,  Broadcast data
OnAdvertisement, 2. BIEvent()
OnEvent,  Call accelerometer & temp’s OnEventPost(GAP)
App
OnConnect,  Enable Broadcast clock
OnbleCfgParamWrite, 3. OnConnectSensorEvent()
OnSubscribe,  All sensor’s BLE sensor
ConnectedSensorEvent layer OnEventPost(GATT) function is called here
OnDisconnect
}t_appl; OnConnect()
 ResetGlobalVar()
OnBleCfgParamWrite()
 All sensor’s BLE sensor
layer OnbleCfgParamWrite functions are called here
OnSubscribe()
 Based on request start the sensors

OnDisconnect()
 All sensor’s BLE sensor
layer OnDisconnect functions are called here

Generic typedef OnPor () OnPor ()


BLE {  InitPheripheral ()  InitPheripheral ()
Sensor OnPor,
Layer OnBleInit OnBleInit() OnBleInit ()
OnAdvertisement  PerformBist ()  PerformBist ()
OnConnect,

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
OnSubscribe
 ConfigAccelerometer(Enable) based on the
request

OnBleCfgParamWrite()
 Update acc cfg global variables

OnEventPost(GATT)

4. WaterMark
Gap Role Profile state –Connected
OnConnectWmIntr
 ReadAccelDataFromFifo()
 Form & send the packet using BLE data uuid OnSubscribe
call back function.  Start Tmp read clock based on
the request
OnEventPost(GAP)
OnBleCfgParamWrite ()
OnSubscribe, 5. WaterMark  Update tmp global cfg variables
OnEventPost Gap Role Profile state –Advertisement & reconfigure tmp read rate clock
OnbleCfgParamWrite, OnAdvertismentWmIntr
OnDisconnect  ReadAccelDataFromFifo() OnEventPost()
}t_BleSensorApp;  Update total number of samples generated Event-Tmp read rate clock
 ConfigAccelerometer(Disable)  ReadTmpData()
.
 Update Global tmp Global
6. BI Clock variables
OnBurstIntervalEvent()
 ConfigAccelerometer(Enable) OnDisconnect()
 Disable tmp read rate clock
7. Two Second Clock
BroadcastEvent()
 Load acc data & broadcast
8. BMAInterAcitivity Clock
 CheckBmaActivity()-Does
 ConfigAccelerometer(Enable)

OnConnect()
 EnableClock BMAInterAcitivity

OnDisconnect()
 Close the flash
 ConfigAccelerometer(Disable)
 Disable BMA interrupt activity clocks

Generic typedef InitPheripheral ()

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
 Init spi pin table
InitPheripheral ()
 Cfg SPI peripheral
 Intit I2C pin table
 Init external INTR pin & call back
{  Init I2C peripheral
registration
InitPheripheral,
PerformBist, PerformBist ()
PerformBist ()
ConfigAccelerometer(ena  Tmp_AddService
Sensor  Acc_AddService
bkeDisable)  Tmp_bist(perform chip id test)
Typ  Acc_bist(perform chip id test)
ReadAccelDataFromFifo  DevInfo_setParam(BIST)
Layer  DevInfo_setParam(BIST)
}t_SensorOneApp;  Config TMP for suspend mode
ConfigAccelerometer()
ReadTmpData()
 ConfigAcc(EnableDisable)
 Enable I2C
 getTemperauteData(destinati
ReadAccelDataFromFifo()
onAdd).
 getAccelerometerData(destinationAdd).
 Disable I2C
Sensor
BMA driver provided by Bosch manufacturer TMP driver developed by Vegam
Driver
TI_lib
Texas  I2C TI Lib
Instrum  SPI TI Lib
ents  UART TI Lib
 GPIO TI Lib

5 Generic Configuration Packet Details


This section gives details of all configurations information used in vSens generic.

Configuration packet has the configuration information in it. The configuration information has
the following structure,

Byte 1 2 3 4 5 6
Numb
er
Field Sensor Configuration Configuration Configuration Configuration Configuration
ID ID{Mapped to Data Byte-1 Data Byte-2 Data Byte-3 Data Byte-4
configuration
of sensor}

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
5.1 vSens Product

Byte 1 2 3 4 5 6
Number
Field Sensor Configuration Configuration Configuration Data Configuration Configuration
ID ID{Mapped Data Byte-1 Byte-2 Data Byte-3 Data Byte-4
to
configuration
of sensor}
Device 0x01 1-Burst NA NA NA
Mode 2-
Continuous
BI 0x02 Minutes NA NA NA
BD 0x01 0x03 <*Value> NA NA NA
Time 0x04 EPOCH time EPOCH time EPOCH time EPOCH time
stamp byte stamp byte 2 stamp byte 1 stamp byte 0
3
Device 0x05 0– Active NA NA NA
status 1 – Sleep
Data Type 0x06 1 - Raw Data NA NA NA
2 - Analytics
Data

*TBD

5.2 Accelerometer

Byte Number 1 2 3 4 5 6
Field Sensor Configuration Configuration Configuration Configuration Configuration
ID ID{Mapped Data Byte-1 Data Byte-2 Data Byte-3 Data Byte-4
to
configuration
of sensor}
Sensor Config 0x01 <MSB Byte> <LSB Byte> NA NA

Sampling 0x02 Cfg Data NA NA NA


Frequency Byte1
Range 0x02 0x03 Cfg Data NA NA NA
Byte1
Accel Chip ID 0x04 *Cfg Data NA NA NA
Byte1
Acceleromete 0x05 Cfg Data NA NA NA
r offset Byte1
Operation

NA-Contains 0x00

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
*TBD

5.2.1 Sensor Configuration


Value is the word data type, formed from sensor configuration’s MSB & LSB byte.

Cfg Data Byte1 Description


0x0000 Accelerometer data unsubscribed
0x0001 Accelerometer data subscribed

5.2.2 Sampling Frequency

Cfg Data Byte1 Sampling Frequency in HZ

0x01 0.78125
0x02 1.5625
0x03 3.125
0x04 6.25
0x05 12.5
0x06 25
0x07 50
0x08 100
0x09 200
0x0a 400
0x0b 800
0x0c 1600

5.2.3 Range
Cfg Data Byte1 Range
0 2G
1 4G
2 8G
3 16G

5.2.4 Accelerometer offset Operation

Cfg Data Byte1 Description


0x00 Offset correction not requested
0x01 Offset correction requested

5.3 Temperature

Byte Number 1 2 3 4 5 6
Field Sensor Configuration Configuration Configuration Configuration Configuration

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
ID ID{Mapped Data Byte-1 Data Byte-2 Data Byte-3 Data Byte-4
to
configuration
of sensor}
Sensor 0x01 Cfg Data NA NA NA
Configuration 0x03 Byte1

Read Rate 0x02 Cfg Data NA NA NA


Byte1
Thresholds 0x03 Cfg Data Cfg Data Byte2 Cfg Data Byte3 Cfg Data
Byte 1 Byte4

5.3.1 Sensor Configuration

Cfg Description
Byte1

0x00 Temperature data is unsubscribed


0x01 Temperature data is subscribed

5.3.2 Read Rate


Cfg Unit
Byte1

1-255 Min

5.3.3 Thresholds

Cfg Data Byte1 Cfg Data Byte2 Cfg Data Byte3 Cfg Data Byte4
Different Alert Warning temperature Critical temperature Fatal temperature
Enable/disable value value value

Alert Description
Value
0 alert is disabled
1 warning alert is enabled
2 critical alert is enabled
3 fatal alert is enabled

a. User can prompt for enabling warning.


If warning is enabled the critical and fatal is also enabled.
b. User can prompt for enabling critical.
If critical is enabled then fatal is also enabled
c. User can prompt for enabling only fatal.

If user don’t want to monitor any of the above levels then app has to intimate sensor tag with
Alert = 0x00. The Android App takes care of following condition while user enters the

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
temperature value,
‘warning temperature value < critical temperature value < fatal temperature value’

5.4 Battery

Byte 1 2 3 4 5 6
Number
Field Sensor Configuration Configuration Configuration Data Configuration Configuration
ID ID{Mapped Data Byte-1 Byte-2 Data Byte-3 Data Byte-4
to
configuration
of sensor}
Read Rate 0x01 Cfg Data 0 0 0
0x04 Byte1
Thresholds 0x02 Cfg Data Cfg Data Byte2 0 0
Byte1

5.4.1 Read Rate


Cfg Data Byte1 Unit
1-255 Min

5.4.2 Thresholds
Cfg Data Byte1 Cfg Data Byte2
Alert Threshold
Enable/Disable
0x00-Disable *64-99%
0x01-Enable

*Critical threshold value is 65%, which is not configurable from the application.

5.5 Analytics

Byte Number 1 2 3 4 5 6
Field Sensor Configuration Configuration Configuration Configuration Configuration
ID ID {Mapped Data Byte-1 Data Byte-2 Data Byte-3 Data Byte-4
to
configuration
of sensor}
FFT Enabled 0x01 Cfg Data 0 0 0
Byte1
Acceleromete 0x02 Cfg Data 0 0 0
r RMS Enabled Byte1
Velocity RMS 0x05 0x03 Cfg Data 0 0 0
Enabled Byte1
FFT window 0x04 Cfg Data 0 0 0

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
size Byte1
Averaging Size 0x05 Cfg Data 0 0 0
Byte1
Peak filtering 0x06 Cfg Data 0 0 0
size Byte1

FFT enabled
Cfg Description
Byte1

0x00 FFT data is disabled


0x01 FFT data is enabled

5.5.1 Accelerometer RMS enabled


Cfg Description
Byte1

0x00 ACC RMS data is disabled


0x01 ACC RMS data is enabled

5.5.2 Velocity RMS enabled


Cfg Description
Byte1

0x00 Velocity RMS data is disabled


0x01 Velocity RMS data is enabled

5.5.3 FFT Window size


Cfg Description
Byte1

0x00 256 samples


0x01 512 samples
0x02 1024 samples
0x03 2048 samples
0x04 4096 samples

5.5.4 Averaging
Cfg Description
Byte1

0x00 No averaging
0x01 2 FFT windows

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
0x02 4 FFT windows
0x03 8 FFT windows

5.5.5 Peak Filtering size


Cfg Data Byte1 Description
0 Disabled
1 - 255 TBD - Number of
Peak samples to
filter

6 Generic Data Packet Details

Type Of Data
Sensor Data Packet
ID
0x02
Accelerometer
Data
Temperature 0x03
Data
Battery Data 0x04
Accelerometer 0x05
Offset result

6.1 Accelerometer

Byte 1 2 3 4 5-243 244


Numbe
r
Brief Data Packet Accel Accel Data NA
Packet Count 1 Sampling Range
ID Frequency

6.2 Temperature

Byte 1 2 3 4 5-244
Numbe
r
Brief Data Packet Alert Data NA
Packet Count 1
ID

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
6.3 Battery

Byte 1 2 3 4 5-244
Numbe
r
Brief Data Packet Alert Data NA
Packet Count 1
ID

6.4 Accelerometer Offset

Byte 1 2 3--244
Numbe
r
Brief Data Offset NA
Packet Correction
ID Operation
Status

Offset Correction Operation Description


Status
0x00 Offset correction passed & successfully stored offset compensation
values on to EF
0x01 Offset Correction Passed , failed to store offset compensation values in
EF

6.5 FFT data

FFT info packet:


Byte 1 2 3 4 5 6 7 8-13
Numbe
r
Brief Data Packe Accel Accel Window Averagin Peak Timestamp
Packet t Sampling Rang size g size filtering in
ID Count Rate e size milliseconds
1

Byte 14 15 16-244
Numbe
r
Brief Axis FFT FFT
sample Data
count

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
This packet is sent once before, when every new axis FFT data packet being sent.

FFT Data packet:


Byte 1 2 3 4 5-244
Numbe
r
Brief Data Packe Axis FFT FFT
Packet t sample Data
ID Count count
1

FFT sample count- Number of FFT samples being sent in the packet

6.6 RMS data

Accelerometer RMS only packet:


Byte 1 2 3 4 5 6 7-12 13-244
Numbe
r
Brief Data Packe Accel Window Averagin No. of Timestamp in Accel RMS
Packe t Sampling size g size Sample milliseconds samples
t ID Count Rate s
1

Velocity RMS only packet:


Byte 1 2 3 4 5 6 7-12 13-244
Numbe
r
Brief Data Packe Accel Window Averagin No. of Timestamp in Velocity
Packe t Sampling size g size Sample milliseconds RMS
t ID Count Rate s samples
1

Accelerometer and Velocity RMS packet:


Byte 1 2 3 4 5 6 7-12 13-128 129-244
Numbe
r
Brief Data Packet Accel Window Averagin No. of Timestamp Accel Velocity

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io
Packet Count Samplin size g size Samples in RMS RMS
ID 1 g Rate for each millisecond samples samples
data s
type

RMS sample structure:


Accelerometer RMS X0, velocity RMS X0, accelerometer RMS Y0, velocity RMS Y0,
accelerometer RMS Z0, velocity RMS Z0 etc.

Gateway packet structure possibilities:


Gateway Packet structure possibilities:
1. {“b”: [[FFT Info Packet], [FFT X-axis], [FFT Y-axis], [FFT Z-axis]], f: 0} – FFT packet, flag = 0
indicated both accelerometer and velocity RMS values are disabled.
2. {“b”: [[FFT Info Packet], [FFT X-axis], [FFT Y-axis], [FFT Z-axis]], f: 1} – FFT packet, flag = 1
indicated only accelerometer RMS is enabled.
3. {“b”: [[FFT Info Packet], [FFT X-axis], [FFT Y-axis], [FFT Z-axis]], f: 2} – FFT packet, flag = 2
indicated only Velocity RMS is enabled.
4. {“b”: [[FFT Info Packet], [FFT X-axis], [FFT Y-axis], [FFT Z-axis]], f: 3} – FFT packet, flag = 3
indicated both accelerometer RMS is enabled.
5. {“b”: [[Acc RMS Data]]}
6. {“b”: [[Velocity RMS Data]]}
7. {“b”: [[Acc and Velocity RMS Data]]}

Note: Gateway Packet structure is not yet finalized regarding the flag, it can be either a flag added from
the gateway or FFT packet could have entirely different Packet ID based on if RMS is enabled or no.

6.7 NCB Analytics Data

In NCB analytics mode there are 2 packet types information and data packet.
Information packet is sent once a burst and for 1 minute duration and it has only metadata
information.

Data packet structure,


Data 6 7 8 9 10
packet
Index
Packet Packet id Packet Burst Axis no of FFT-
Details number number information samples(4 samples
(4 bits) bits)

Metadata size=4
Packet payload size 22, ie 11 FFT samples.

Vegam.IO Solutions Private Limited


CTIE KLE technology park, KLE technological University, Vidyanagar, Hubli – 580031.
Tel: +91 0836- 2378323. Website: www.vegam.io

You might also like