top of page

The Accelerometer

The system includes an accelerometer to identify whether the patient is in resting state or in  activity, which can help achieve a more accurate and continuous monitorization system. Like this the patient’s can have their heart monitored continuously, even if they are not resting. The alarm system will activate taking into account both heart rate and accelerometer data.

​
Overall working principle 

 

The code is based on https://playground.arduino.cc/Main/MPU-6050

The accelerometer GY-87  contains a MEMS accelerometer and a MEMS gyro in a single chip. It is very accurate, as it contains 16-bits analog to digital conversion hardware for each channel. The main adavantage is that an accerlerometer returns the value of  the x, y, and z channel at the same time. ​We openned the Serial Monitor of the Arduino GUI, to try to see how the values change when we move the sensor.

​

To mesure the raw values or the normalized value of the accelerometer we used the MPU 6050 library. 

​

The main goal to use the accelerometer is to be able to deduce if the person is in activoty or not.

When we did our mesurement, the value of the raw value were to much instable to deduce if someone was moving or not so we decided to work with the normalized value. 

TJ eIMMOBILITY THRESHOLD value was determined by checking the max value on the Serial monitor when the accelerometer was not moving at all. 

​

Once the activity is at "1" we consider the person is moving. "ACTIVITY" is the value which will be used for the applicaiton to detect if the high pulse of the person is due to the activity of someone.

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

Communication with the arduino (https://www.arduino.cc/en/Reference/Wire)

 

The sensor uses the I2C-bus to interface with the Arduino Uno. To use the I²C bus easily we used the Wire library. 

I²C is appropriate for peripherals where simplicity and low manufacturing cost are more important than speed. For our project the speed of the I²C is enough to have results.

​

The bus has two roles for nodes: master and slave:

  • Master node that generates the clock and initiates communication with slaves.

  • Slave node that receives the clock and responds when addressed by the master.

​

On the Arduino Uno the ports to use the I²C are on the A4 and A5 ports.

SCL -> A5 (Is a clock)

SDA -> A4 (lines with 7-bit addressing)

The analogic pins are not set on INPUT because it's their default setting. The values read by the analogic pins will be sent to the serial port.

​

​

​

​

​

​

​

Power supply 

VCC -> 3.3 V / 5 V (better results)

GND -> GND

This sensor board has its own a voltage regulator. When using 3.3V to the VCC the resulting voltage might be too low for a good results when the I2Cbus working. This is why It is preferred to apply 5V to the VCC pin.

​

​

Precaution to have the best value when we do the mesurement

  • The sensor was placed as horizontal as possible.

  • It was placed on a wooden table.

    • As a result when we do the mesurement the human must be immobile as much as possible otherwise the programm will return that the person is moving.​

  • An battery of 9V was used, not the less stable voltage from the USB bus. A battery, instead of an adapter avoids any mains noise.

  • The room temperature was 25 degrees Celsius.

 

 

Price

An other main good point is that the MPU-6050 inside the accelerometer is not expensive, especially given the fact that it combines both an accelerometer and a gyro.

We can easily find this component at less than 10£.

i2c01.png
mivement detect.PNG
void loop.PNG
bottom of page