element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sudden Impact Wearables Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sudden Impact Wearables Design Challenge
  • More
  • Cancel
Sudden Impact Wearables Design Challenge
Blog Software part
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shubhamgarg.arg@gmail.com
  • Date Created: 10 Jan 2015 6:35 AM Date Created
  • Views 345 views
  • Likes 3 likes
  • Comments 1 comment
Related
Recommended

Software part

shubhamgarg.arg@gmail.com
shubhamgarg.arg@gmail.com
10 Jan 2015

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.


image

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.


image


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.


imageimage


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.


image


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.


image

 

Figure 5 : Structure of Data Packet

Currently this completes my idea regarding software portion...

  • Sign in to reply

Top Comments

  • tomaja
    tomaja over 10 years ago +1
    Nice work! RPi app looks very good. Dragan
  • tomaja
    tomaja over 10 years ago

    Nice work!

    RPi app looks very good.

     

    Dragan

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube