Project Review

ukrainianlegalΗλεκτρονική - Συσκευές

2 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

92 εμφανίσεις

Department of
Electrical and Electronic Engineering







Progress

Report


Title:

Indoor Localization Sensor for Elderly People


Student:

Damien Reilly

07027940


Project
Supervisor:

Dr. John Breslin


Technical
Supervisor:

Mr.
Antonio

Aguilar






Department of Electrical and Electronic Engineering



2


Project Abstract


With the increase of the elderly population in Europe in the recent years, it has become important to
be able to monitor the health and daily activities of elderly people without affecting their
independent living. This moni
toring will have to be performed in an “invisible” and unobtrusive
manner. Several technologies have been developed to facilitate this. For example, RFID tracking
technology, activity monitors based on accelerometers and gait monitors based on foot switche
s.

However, the current application of these technologies is limited to detecting simple independent
events without contextual information such as when the person stands, sits, walks, etc. or when the
person has entered or exited a room in their house.

It

is currently quite difficult to obtain additional contextual information such as, how many times has
the person has gone to the toilet during the day? What are their resting or sleeping patterns?. These
questions may seem trivial at first, however, being
able to answer them would yield valuable
information to diagnose early signs several diseases common in elderly people, e.g. heart failure,
kidney problems, nocturia, metabolic imbalances, etc.

The aim of this project is to develop a sensor which combine
s indoor localization to track the
locations (e.g. bedroom, kitchen, living room, bathroom, etc.) and accelerometers to detect activities
(standing, sitting, walking, laying, etc.) of an elderly person. Combining both localization and activity
information
would yield more accurate information about the daily activities of the elderly person.

Figure 1 shows the general idea of the sensor tracking a person around their home following the
activities they are doing.


Figure
1
: Genera
l Idea of Sensor

Department of Electrical and Electronic Engineering



3




Table of Contents

Project Abstract

................................
................................
................................
.........................

2

Acknowledgements

................................
................................
.......

Error! Bookmark not defined.

Declaration
of Originality

................................
..............................

Error! Bookmark not defined.

Table of Contents

................................
................................
................................
.......................

3

Table of Figures

................................
................................
.............

Error! Bookmark not d
efined.

Sensor Design Diagram

................................
................................
................................
.............

4

Hardware Being Used

................................
................................
................................
................

4

Compass Mo
dule with Tilt Compensation
-

HMC6343

................................
.........................

4

Mounting Orientations
................................
................................
................................
...........

5

Open Log

................................
................................
................................
................................

6

Transceiver nRF2401A with Chip Antenna
................................
................................
...........

6

Arduino Pro Mini/ FTDI Basic

................................
................................
...............................

7

What i s Ardui no?

................................
................................
................................
........

7

Sofware Being Used

................................
................................
................................
...................

7

Arduino Development Environment

................................
................................
.....................

7

Processing IDE

................................
................................
................................
.....................

10

Eagle PCB

................................
................................
................................
.............................

10

Project Plan
................................
................................
................................
..............................

11

Progress to Date
................................
................................
................................
...................

11

Tasks to Complete
................................
................................
................................
................

12

References

................................
................................
................................
................................
.

1




Department of Electrical and Electronic Engineering



4




Sensor Design Diagram












The
sensor consists of
4

main modules: (1) the digital
compass, (2) the data logger, (3) the
Reciever/Transmitter and (4) the Arduino Pro Mini,
which uses the FTDI Basic as the programmer
.

Below is a brief description of the functionality of each of the components.


Hardware Being Used

Compass Module with Tilt Compensation
-

HMC6343


Digital
Compass and
A
ccelerometer

Serial Data Logger


Arduino Pro Mini

FTDI Basic


Transceiver



Department of Electrical and Electronic Engineering



5


The HMC6343 is a solid
-
state compass module with tilt compensation from Honeywell. The
HMC6343 has three axis of magneto, three axis of accelerometer, and a PIC core running all the
calculations. What you get is a compass heading over I2C that stays the sa
me even as you tilt the
board
.



Mounting Orientations

The HMC6343 provides for three standard mounting orientations, with a flat horizontal ori
entation
(Level) as the factory
default. For vertical mounting, there are two upright orientations with either
the X
-
axis
or the Z
-
axis designated as the
forward reference directions. To change the forward
reference direction temporarily, se
nd the appropriate command byte
(0x72, 0x73, or

0x74) for level
or upright orientations. For other orientations, yo
u can add or subtract 90 degree
increments of
deviation angle as required from the three choices. The figure below shows pictorially the
orientations.

To permanently change orientation, po
ke EEPROM Operational Mode Register 1 (0x04) w
ith the
appropriate binary bits
set for Level, Upright Edge (UE), or Upright Front (UF). The HMC6343 will
operate in the selected orientati
on after a
power
-
up or reset command. More on the EEPROM
regis
ters in t
he following sections.


HMC6343 ORIENTATIONS

Red Arrow is the Forward Direction





Department of Electrical and Electronic Engineering



6



Open Log




OpenLo
g is an open source data logger



It stores the information sent to it on a microSD card up to

2GB




Input voltage from 3.3V to 12V




2mA idle, 6mA at maximum recording rate



Dimensions:

0.16 x 0.6 x 0.75" (
4 x 15 x 19mm)


Transceiver nRF2401A with Chip Antenna





Frequency: 2.4~2.524 GHz



Modulation

type: GFSK



Operating Voltage: 3V



Data Rate: 1Mbps; 250Kbps



Small footprint size:
0.7x1.3" (18x33mm)



Long

range:



50ft. indoors



125ft. line
-
of
-
sight



Built
-
in antenna



Very low cost



Applications:

Telemetry,

Wireless Toys, Remote Control, Wireless

Speaker, Wireless
Earphone or Walkie
-
Talkie,

Wireless Mouse and Keyboard, Utility Meters Data
Downloading,
etc.



Department of Electrical and Electronic Engineering



7


Arduino Pro Mini/ FTDI Basic



What is Arduino?

Arduino is a tool for making computers that can sense and control more of the physical world than
your desktop computer. It's an open
-
source physical computing platform based on a simpl
e
microcontroller board, and a development environment for writing software for the board.

This module is the main programming part of the project. The arduino connects straight to the FTDI
basic breakout board and uses this to program and connect to the other modules. The arduino is
used as the microcontroller and sends all the signals out on t
he various pins to the various modules
which are all connected to this arduino. The arduino has dimensions of
0.7x1.3" (18x33mm)

and has
on board status LEDs.

The FTDI Basic is the
basic breakout board for the FTDI FT232RL USB to serial IC. The pinout of
this
board matches the FTDI cable to work with official Arduino
.


This board has TX and RX LEDs that
make it a bit better to use over the FTDI cable. You can actually see serial traffic on the LEDs to verify
if the board is working.



Sofware Being Used

Arduino
Development Environment

The Arduino development environment contains a text editor for writing code, a message area, a
text console, a toolbar with buttons for common functions, and a series of menus. It connects to the
Arduino hardware to upload p
rograms and communicate with them.

Software written using Arduino are called sketches. These sketches are written in the text editor. It
has features for cutting/pasting and for searching/replacing text. The message area gives feedback
while saving and exp
orting and also displays errors. The console displays text output by the Arduino
environment including complete error messages and other information. The toolbar buttons allow
you to verify and upload programs, create, open, and save sketches, and open the

serial monitor


Department of Electrical and Electronic Engineering



8


Sample code for setting up compass:

#include <Wire.h>

int compassAddress = 0x32 >> 1; // From datasheet compass address is 0x32 for write operations,


// or 0x33 for read operations.


// shift the address 1 bit right, the Wire library only needs the 7


// most s
ignificant bits for the address

int heading = 0; // variable to hold the heading angle

int tilt = 0; // vari
able to hold the tilt angle

int roll = 0; //
variable to hold the roll angle

byte responseBytes[6]; // for ho
lding the sensor response bytes

void setup()

{


delay(2000); //Wait at least 500 milli
-
seconds for device initialization


Wire.begin(
); // join i2c bus (address optional for master)


Serial.begin(9600); // start serial communication at 9600bps


pinMode(48, OUTPUT);


digitalWrite(48, HIGH); // just turn ON the onboard LED

}

void loop()

{


readSensor(); // read data f
rom the HMC6343 sensor


// Note that heading, tilt and roll values are in tenths of a degree, for example


// if the value of heading is 1234 would mean 123.4 degrees, that's why the result


// is divided by 10 when printing.


Serial.print("Heading: ")
;


Serial.print(heading / 10, DEC);


Serial.print(" Tilt: ");


Serial.print(tilt / 10, DEC);


Serial.print(" Roll: ");

Department of Electrical and Electronic Engineering



9



Serial.println(roll / 10, DEC);


delay(200); // wait for half a second

}

void readSensor()

{


// step 1: in
struct sensor to read echoes


Wire.beginTransmission(compassAddress); // transmit to device


// the address specified in the datasheet is 66 (0x42)


// but i2c adressing uses the high 7 bits so it's 3
3


Wire.send(0x50); // Send a "Post Heading Data" (0x50) command to the HMC6343


Wire.endTransmi
ssion(); // stop transmitting


// step 2: wait for readings to happen


delay(2); // datashee
t suggests at least 1 ms


// step 3: request reading from sensor


Wire.requestFrom(compassAddress, 6); // request

6 bytes from slave device #33


// step 4: receive reading from sensor


if(6 <= Wire.available()) // if six bytes were received


{


for(int i = 0; i<6;

i++) {


responseBytes[i] = Wire.receive();


}


}




heading = ((int)responseBytes[0]<<8) | ((int)responseBytes[1]); // heading MSB and LSB


tilt = (((int)responseBytes[2]<<8) | ((int)responseBytes[3])); // tilt MSB and LSB


roll = (((int)re
sponseBytes[4]<<8) | ((int)responseBytes[5])); // roll MSB and LSB

}



Department of Electrical and Electronic Engineering



10



Processing IDE

Processing

is an

open source

programming language

and

integrated development environment

(IDE)
built for the electronic
arts and visual design communities with the purpose of teaching the basics
of

computer programming

in a visual context, and to serve as the foundation for electroni
c
sketchbooks
. I plan to use this language next year to create a GUI to interact with the compass in
tracking the person around the house etc.

Eagle PCB

EAGLE

(Easily

Applicable

Graphical

Layout

Editor) is a schematic capture and PCB layout tool. EAGLE
contains a

schematic editor, for designing

circuit diagrams. Parts can be placed on many sheets and
connected together through ports.

The

PCB

layout editor allows back annotation to the schematic and auto
-
routing to automatically
connect traces based on th
e connections defined in the schematic. Eagle is a very easy to use drag
and drop like application. I plan to use this in early January to create a PCB layout for the elements in
my project.














Department of Electrical and Electronic Engineering



11





Project Plan

As a guideline and that I would

stic
k to my aims a
nd goals for the project, I

made up a project p
lan

in
September

(outlined below)
. Hopefully throughout the next few months I

would

follow these aims
and keep me motivated throughout the duration of the project.

Specific
deliverables:





*
D1: Project Plan (this document)





* D2: Documented design of the sensor: This will include a detailed diagram of how the
compone
n
ts are wired together. Also, an actual schematic using EaglePCB. So, the deliverable will be
a documented diagram of all the

compone
n
ts and high level function of the sensor
and

a schematic
circuit and PCB layout.






* D3: Hardware Prototype of the sensor: This includes a prototype version of the sensor in a
breadboard based on the schematic used in the design stage. At this
stage, we can decide if we will
need to get a PCB manufactured for the sensor or just a wiring board.





* D4: Testing and Evaluation of the Sensor: This deliverable includes measurement results from
the sensor, e.g. the tracking of trajectories of people
. This measurements will be downloaded from
the data logger either using Bluetooth or an SD card. We will plot the data from the sensor to
evaluate its accuracy.





* D5: The thesis report.


Progress to Date

September:


At the beginning

of September I was

told of the project I would have to undertake. I
spent most of this month researching and reading up on different typed of technologies and
products I could use in developing the sensor. I met with Antonio, my Technical Supervisor, and we
spoke about diff
erent ways in incorporating the different parts of the project and the what parts
were most important for the sensor to work most efficiently.


October
:


After the research and original meetings of September, the project moved on to planning
and ordering o
f the different modules needed.
Our original plan was to use an MSP
-
430
microcontroller to program the compass module. However, when I wired up the compass to the
Department of Electrical and Electronic Engineering



12


microcontroller there was a problem with initialising the compass and the idea of using the M
SP
-
430
had to be discarded. After another meeting with John and Antonio we decided that it would be best
to use an Arduino. I researched the Arduino pro mini and this module was then ordered so we could
begin putting the sensor together.


November:

After
all the materials I needed had arrived I started to build the hardware one by one.
First I connected the compass to the Arduino and ran a simple program (shown above). On viewing
the serial port I could see that the compass headings were being read back co
rrectly.

I then connected the data logger and began storing data on the SD card being read from the
compass. After this the transceiver module was connected

and I began transmitting and receiving
data on the data logger. By the beginning of December all o
f the hardware has been built.


From the project plan below I am pleased with the current progress the project has made. After the
initial setback with the microcontroller, I have seen great progress being made throughout the
month of November. Now that th
e hardware is built, I can see how the compass will work physically
and can now concentrate on visual design and the software side of the project.




Tasks to Complete

December/January:

Throughout the Christmas weeks I plan to familiarise myself in using Eagle
PCB. There are several useful online tutorials that can help me to create a suitable layout for the
sensor. The first weeks of January will then involve creating the best PCB layout

and getting the PCB
made to suit the project.

After this is done, I can then move onto the improving the workings of the compass by improving the
coding.


February:

I

plan is to use the stored data on the SD card and map the data by using the heading an
d
accelerometer

data

coordinates using matlab.
Hopefully, I can

have it mapping in such a way as it
tracks the movement in a 2
-
D style. I hope to further the development of the software in making the
system more energy efficient in the consumption of batte
ry power which I see as a major factor.


Department of Electrical and Electronic Engineering



13


March/April:

In the final two months of the project I plan to set out several tests to carry out, such
as how well the data tracks, how long the battery lasts, etc. I will use the TCL application to create
GUI’s
.

T
he final prototype will be developed in the final weeks for presentation. Along with all this I will put
together my final Thesis on the report.


Department of
Electrical and Electronic Engineering





Overview of Project Plan


Department of
Electrical and Electronic Engineering






References


1.

http://www.freebiehouseplans.com/?cat=3

2.

http://www.sparkfun.com/commerce/product_info.php?products_id=8656

3.

http://www.sparkfun.com/products/153

4.

http://www.magneticsensors.com/datasheets/HMC6343.pdf

5.

http://www.sparkfun.com/products/9716

6.

http://www.sparkfun.com/commerce/product_info.php?products_id=9530

7.

http://www.sparkfun.com/products/9220

8.

http://arduino.cc/en/Guide/Introduction

9.

http://arduino.cc/en/Guide/Environment

10.

http://en.wikipedia.org/wiki/Tcl

11.

http://processors.wiki.ti.com/index.php/EZ430
-
RF2560