This is an update on our work on creating a bluetooth home health monitor in my class BME 440/441 “Senior Design in Biomedical Engineering”. The idea is to create an iPhone app that can connect to several Bluetooth LE sensors (ECG, EEG, Galvanic Skin response) and then display and record the data. There will also be a data analysis component to actively monitor the health of the subject.
This post will describe a simple Arduino sketch that measures an analog signal at regular time intervals and then sends it through the Bluetooth connection of the RedBear BLE Shield. The sketch uses a timer to set the frequency at which analog pin 5 is measured and writes it into a buffer that is then sent through the BLE shield. I had to add a flag analog_enabled to make sure that the BLE shield only receives data when connected to the iPhone app. Unfortunately, there is a bug in the RedBear BLE shield software that makes it necessary to first receive data before it can send (I used BLE_Shield_Library 1.0). I could not get this project to work without the iPhone first sending at least one byte of data. In our case, when the iPhone sends “I” then the BLE shield starts sending. When the iPhone sends “0” then the BLE shield stops sending. I also included the parameters for 100Hz and 2Hz data transmissions. Here is the sketch:
false;
void
void
boolean analog_enabled =