Until I receive the kit, I though of working on the software portion of the project...
Currently a small application is ready for testing the ECG and other data. The application is running on Raspberry pi which is receiving the data wirelessly using Bluetooth low power module. This application will be used for initial testing and implementation. The application is built on python tkinter.
Figure 1: Application running on Raspberry Pi
In software application, following data needs to be received wirelessly from the wearable electronics.
1. ECG signals
2. Impact Sensor data
3. EEG signal data
4. Temperature sensor data
The health monitoring application consists of three layers: physical register layer, hardware abstraction layer and application layer as shown in Fig.2. The physical register layer module handles the operation of ADuCM350 registers. On the other hand, the Hardware Abstraction Layer (HAL) module defines various different communication between ADuCM350 and different sensor. And more importantly SPI communication between nRF8001 and ADuCM350. The port of Bluetooth protocol to ADuCM350 is performed on the Hardware Abstraction Layer (HAL). The HAL layer module primarily defines logical operations on how microcontroller controls nRF8001 over the physical SPI interface. The application layer module defines Bluetooth low energy protocols.
According to nRF8001 product specification the SPI mode 0 is required to configure the data exchange over the SPI interface. In the mode 0, the Least Significant Bit (LSB) is sent first (for data order), the base value for clock is set as zero (for clock polarity) and the data is read on the clock’s rising edge (for clock phase). The SPI operation is executed at a frequency of 2 MHz.
Figure 2 : Software Architecture
The data exchange between ADuCM350 and nRF8001 has been split into two types: command and event. Command is a data exchange which will be initiated by ADuCM350 microcontroller and transmitted to nRF8001, while event will be the data exchanged in the opposite direction.
Firstly, ADuCM350 sends a request of sending a command to nRF8001 by setting REQN low. Next, nRF8001 responses the microcontroller by setting RDYN low when it is ready to receive the command. Then ADuCM350 starts to transmit this command over the MOSI pin (shown in Fig.3)
On the other hand, the event is initialized by nRF8001 setting RDYN low. Then ADuCM350 informs nRF8001 that it is ready to receive events by setting REQN low. The event is exchanged over the MISO pin.
Figure 3 : Flowchart of SPI Communication
The application layer module defines different health parameters. The system operates in four modes: setup, standby, active and sleep. Fig 4 shows the state transition between four operational modes.
When the power is on, the system will be in the setup mode. After initialization, it is transferred to the standby mode. Then, the Bluetooth low energy radio starts advertising and will make a connection with a smart phone. Once it successfully establishes connection, the system enters the active mode. In the active mode, a smart phone will be able to control the ECG device by sending a remote command. According to the received remote command from a smart phone, the device starts to sense vital health parameters and will transmit them via the Bluetooth link to the smart phone. When the connection between the smart phone and the wearable device is lost, the system enters the sleep mode in order to save power.
Figure 4 : State transaction between four operational mode
How Data Packets will be send ??
Commands and events will be organized in the packets itself. Every packet consists of a two-byte header followed by a variable length packet payload, described in Figure 18. The first byte of a packet header represents the total length of this packet in bytes, and the second byte defines the unique operation code for a specific command or event. The length of a payload is command or event dependent. The LSB in the text data of a command or an event will be transmitted first.
Figure 5 : Structure of Data Packet
Currently this completes my idea regarding software portion...






Top Comments