Vicenc Rubies Royo SmartPills Parsa Mahmoudieh December … · 2014-12-20 · Vicenc Rubies Royo...

Post on 12-Aug-2020

4 views 0 download

Transcript of Vicenc Rubies Royo SmartPills Parsa Mahmoudieh December … · 2014-12-20 · Vicenc Rubies Royo...

SmartPillsEE149/249 Final Project Presentation

December 17th, 2014

Vicenc Rubies RoyoParsa MahmoudiehJoshua Goldberg

Gil Lederman

1

SmartPills

• Detect the number of pills in the bottle, based on high-precision weight measurement combined with an accelerometer.

• Send usage information from the bottle to an Android App, and Configuration commands/data from the App to the bottle

• Unlock the bottle based on fingerprint scan.

2 2

Component Breakdown

• Processor– mbed LPC1768

• Sensors– Accelerometer (ADXL345)

– 100g Load Cell

– Fingerprint Scanner (GT-511C3)

3 3

Component Breakdown

• Actuators– Servo for locking mechanism

• Communication – BLE BlueSMiRF Family

4 4

Module Breakdown

• Mechanical structure of the bottle and hardware integration (Josh/Parsa)

• Number of pills detection (Josh/Parsa)

• Bottle safety (locking/fingerprint scanning) (Gil)

• Software architecture (Gil/Vicenc)

5 5

Mechanical Structure

6 6

Unlocked Bottle

7 7

3D Printed Prototype

8 8

Enclosed Circuits

Amplifier mbed

BLE

Accelerometer

9 9

Load Cell

10 10

Load Cell

11 11

Amplifier

• Instrumentation amplifier to measure voltage difference between outputs of load cell

12 12

Amplifier

13 13

Load Cell Summary

• Load cell is much more repeatable than FSR

• There is no creep like with the FSR

• We tuned the gain of the instrumentation amplifier to get the dynamic range necessary to measure individual pills

• Pill weighs about 770mg, 12-bit ADC can measure differences of 0.8mV

• Currently amplifying to about 48 mV/gram = 36mV/pill = 45 adc-units/pill

14 14

Bottle Safety

• Only authorized users allowed access to the pill bottle.

• Bottle is locked until a verified fingerprint scan is detected.

• Servo attached to the cap of the bottle, automatically opening after successful identification.

15 15

Bottle Safety

• GT-511C3 only responds to commands, must be periodically polled to check if finger is pressed.

• Bottle only “wakes up” the fingerprint scanner after an interrupt from the accelerometer/button wakes it up.

• Fingerprint enrollment initiated by command from Android app

16 16

Controller FSM

Wait for Identification

INACTIVE

Sample Load Cell

OPEN ACTIVE

CLOSED

true

/ upd

ate

And

roid

deactivate /

identified / unlock

misiden

tifica

tion/

reset

coun

ter

coun

ter =

20

/ tu

rn o

ff sc

anne

r

RE

SE

T / T

urn

on

Sca

nner

counter = 20 / lock

activate / Turn on Scanner

OPEN INACTIVE

activ

ate

/ can

cel

tmer

inac

tivat

e / s

tart

timer

17 17

Software Architecture

• Leverages the mbed-rtos, based on the RTX implementation of the CMSIS-RTOS API.

• 3 threads - Controller, BLE communication, GT-511C3 scanner

• Communicating via RTOS queues.• All threads are based on a common

FsmThread class, implementing an event loop that demultiplexes events in sub-classes.

18 18

Software Components

• ScannerFsm (fingerprint sensor), based on a GT-511C3 library by Toshihisa T.

• AdxlModule (accelerometer control), based on the ADXL345 library by Aaron Berk. This module programs the ADXL to drive ACTIVATE/INACTIVATE interrupts.

• Servo module, based on a library by Simon Ford.

19 19

Software Components-LoadCell

• Calibrated once on empty by measuring the last voltage bias.

• During each ADC measurement doing average of 10,000 samples.

• Saves history of measurements, sends it to the Android when it pairs.

20 20

Android Application

• Android code:

-Modified version of BluetoothChat sample code provided in Eclipse IDE. -Code distributed under Apache License v2.0. -Usage compliant with License.

21 21

Android Application

22 22

Communication

• Message Structure:1.) Header = 4 bytes (0xCCCCCCCC)2.) Type = 4 bytes3.) Length = 4 bytes4.) Payload = (Length) bytes [mult. of 4]

23 23

Communication

• Message Types From Android to MBED:1.) RequestCalibrateMessage2.) RequestEnrollMessage3.) SetWeightMessage4.) RequestUnlock5.) RequestHistory

24 24

Communication

• Message Types From MBED to Android:1.) NewSampleMessage2.) AcknowledgeEnrollMessage3.) RequestRemoveFingerMessage4.) RequestPressFingerMessage

25 25

Things that could be improved...

• Noisy load cell measurements• Fingerprint sensor is not very reliable• With a PCB, we could drastically reduce

the size of the mechanical design• Android App could have enhanced user

interface• Add pill usage metrics

26 26

Demo

27

Watch our demo on youtube!

Thank you!Any questions?

28