Friday, May 4, 2012
Final Project: Strengths and Weaknesses
Final Project: Feature-Benefit Table
Feature
|
Benefit
|
Button
|
Each button press adds one “use” to a counter
that tells the user how many uses are remaining and when a refill is
required.
|
LCD Screen
|
The LCD screen is used to deliver messages to
the user such as the number of uses remaining or an inhaler refill is
required. In the future, the LCD screen could be replaced with an LED or a
auditory alert to notify the user.
|
Accelerometer
|
Used to quantify shaking. Provides us with the
tools to measure both the magnitude and frequency of shaking.
|
Portability
|
Competitive products (i.e. T-Haler) are
intended for use in physicians’ offices or pharmacies. InhaleSur allows users
to keep the device with them at all times.
|
Usage Tracking
|
This feature offers the user with a simple way
to recognize when a refill is required instead of having to keep track with a
calendar and simply guessing when the canister is empty. Avoids waste and
ensures optimal dosage delivery.
|
Real-time Monitoring
|
This coincides with portability, but there is
no guesswork or delay involved with using the InhaleSur product. Patients
know exactly when their inhaler is sufficiently shaken.
|
Final Project: Proof-of-Concept Device
Device Description
Representative InhaleSure Device
Picture of circuit used on Arduino board
Device being shaken
Inhaler is sufficiently shaken
Device notifying the user how many uses remaining
Device notifying the user that refill is required
Final Project: Block Diagram
Block Diagram
Final Project: Specifications
Specification
|
Value, Value Range, or
Quality Relating to Spec
|
Comments about rationale
for specification
|
Battery
life
|
4
months
|
Device
needs to last the duration of use for the inhaler. Inhalers typically contain
200 dosages (Bailey, 2012). At
minimum, 2 sprays per day is equivalent to a minimum battery life of 100 days.
We added an additional safety margin to this value.
|
Button Sensitivity
|
Button must register
only one “use” per canister compression
|
Button needs to count
to relay reliable data about remaining medication to user
|
Shaking Voltage
|
Minimum thresholds to qualify
as a sufficient shake in the x, y, and z directions is 800 units
|
The threshold of
shaking was defined via experimental testing. Shaking with a voltage greater
than 800 was classified as one successful shake. The accelerometer generates
a number between 0 and 1023 corresponding to a voltage value between 0V and
5V, so the threshold of 800 corresponds to a voltage of 3.9V measured by the
accelerometer.
|
Number of times
shaking
|
Reach the voltage
threshold 12 (each within 500 msec) times to qualify as sufficiently shaken
|
This is equivalent to
six seconds of shaking; the minimum on official Instructions for Use for
inhalers often states at least five seconds (PDR Network, 2011).
|
Final Project: Competitive Technologies and Reverse Engineering
T-Haler: A competitive technology and its design
REVERSE ENGINEERING ADVANTAGES AND DISADVANTAGES
Final Project: Need for Device and Desired Outcome
Final Project: Target Population
Here are the references for the Final Project Blog posts:
References
Tuesday, April 17, 2012
Final Project: Prior Iterations of the Code
#include
LiquidCrystal lcd(12,11,13,10,9,8);
int buttonpin = 4;
int buttonstate;
int uses = 20; //Literature search for the average number of uses per inhaler
const int groundpin = 14;
const int powerpin = 18;
const int ypin = 2; //changed inputs for x, y, and z because of newer software (it splits it directly with analogRead)
const int xpin = 3;
const int zpin = 1;
int yaccel;
int xaccel;
int zaccel;
int VecSum;
int force;
int FTvariable;
int time = 0;
int LEDpin;
int HardShakeCounter;
int SoftShakeCounter;
//play with these numbers
int mass = 5; // mass of the standard arduino
int LowThreshold = 597; //added this so its easier to change
int UpperThreshold = 1000; //
void setup(){
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
LEDpin = 9;
pinMode(LEDpin, OUTPUT);
lcd.begin(16,2);
pinMode(buttonpin, INPUT);
Serial.begin(9600);
}
//PUSH A BUTTON FIRST THAT SAYS "START SHAKING"
//press button, make sure counters are set to 0)
void loop(){
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
if (zaccel < 900 && zaccel > 800)
{
HardShakeCounter++;
while (zaccel >500)
zaccel=analogRead(zpin); //keep reading until
Serial.print("Number of Hard Shakes = ");
Serial.println(
}
else if (zaccel > 500 && zaccel < 700);
{
SoftShakeCounter++;
while (zaccel >500)
zaccel=analogRead(zpin);
Serial.print("Number of soft shakes = ");
Serial.println(
}
}
----
Ammended Code Rev 2:
#include
LiquidCrystal lcd(12,11,13,10,9,8);
int buttonpin = 4;
int buttonstate;
int uses = 20; //Literature search for the average number of uses per inhaler
const int groundpin = 14;
const int powerpin = 18;
const int ypin = 2; //changed inputs for x, y, and z because of newer software (it splits it directly with analogRead)
const int xpin = 3;
const int zpin = 1;
int yaccel;
int xaccel;
int zaccel;
int VecSum;
int force;
int FTvariable;
int time = 0;
int LEDpin;
//play with these numbers
int mass = 5; // mass of the standard arduino
int LowThreshold = 597; //added this so its easier to change
int UpperThreshold = 1000; //
void setup(){
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
LEDpin = 9;
pinMode(LEDpin, OUTPUT);
lcd.begin(16,2);
pinMode(buttonpin, INPUT);
Serial.begin(9600);
}
void loop(){
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
VecSum = sqrt((xpin)^2+(ypin)^2+(zpin)^
force = (VecSum*mass);
FTvariable = (force*time);
Serial.println(FTvariable);
if (VecSum > LowThreshold) //1st threshold is the zero state --> change this to a button to start time.
{
time = millis();
}
while (FTvariable >= UpperThreshold)//find how much shaking over how much time you need to be fully mixed
{
uses=uses-1;
if (uses == 0)
{
lcd.print("Refill Required");
}
digitalWrite(LEDpin, HIGH);
delay(5000);
digitalWrite(LEDpin, LOW);
FTvariable = 0;
}
}
----
/* read the amount of shaking
determine the force exherted, F=ma
count the time of shaking
when the force * time hits a certain threshold, turn on the led
count the number of button pushes
print the number of uses left
when the number of uses equals zero, print "refill needed"
--to be sufficiently mixed, F*time = x, use x as threshold
--also must use x,y,z direction, so take the vector sum to get the overall force
--time should start counting when above another total acceleration threshold
*/
#include
LiquidCrystal lcd(12,11,13,10,9,8);
int buttonpin = 4;
int buttonstate;
int uses = ????;
const int groundpin = 14;
const int powerpin = 18;
const int ypin = 16;
const int xpin = 15;
const int zpin = 17;
int yaccel;
int xaccel;
int zaccel;
int VecSum;
int force;
int mass = ???;
int FTvariable;
int time = 0;
int LEDpin;
void setup(){
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
LEDpin = 9;
pinMode(LEDpin, OUTPUT);
lcd.begin(16,2);
pinMode(buttonpin, INPUT);
Serial.begin(9600);
}
void loop(){
yvalue=analogRead(ypin);
xvalue=analogRead(xpin);
zvalue=analogRead(zpin);
VecSum = sqrt((xpin)^2+(ypin)^2+(zpin)^2);
force = (VecSum*mass);
FTvariable = (force*time);
if (VecSum > 1st THRESHOLD)
{
time = millis();
}
while (FTvariable >= UPPER THRESHOLD)
{
uses=uses-1;
if (uses == 0)
{
lcd.print("Refill Required");
}
digitalWrite(LEDpin, HIGH);
delay(5000);
digitalWrite(LEDpin, LOW);
FTvariable = 0;
}
}
Final Project: Asthma Device Code
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,13,10,9,8);
int buttonpin = 4;
int buttonstate;
int uses = 3; //Literature search for the average number of uses per inhaler
const int groundpin = 14;
const int powerpin = 18;
const int ypin = 2;
const int xpin = 3;
const int zpin = 1;
double yaccel;
double xaccel;
double zaccel;
double VecSum;
double total_VecSum;
int newtime=0;
int newesttime=0;
int counts=0;
int counting = 0;
void setup(){
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
pinMode(buttonpin, INPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
lcd.begin(16,2); //inserted
Serial.begin(9600);
}
void loop(){
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
newesttime++;
delay(2);
if (!counting && xaccel>800 || yaccel>800 || zaccel>800)
{
newesttime = 0;
counting = 1;
}
if (counting && newesttime<500 && xaccel>800 || yaccel>800 || zaccel>800)
{
newesttime=0;
while (xaccel>800 || yaccel>800 || zaccel>800)
{
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
}
counts++;
Serial.println(counts);
}
else if (counting && newesttime>=500)
{
counting = 0;
counts=0;
Serial.println(counts);
}
if (counts>=12)
{
Serial.println("Ready to use!");
lcd.print("Ready to use!");
delay(3000);
lcd.clear(); //alysa added this
counts=0; //added this
lcd.setCursor(0,0);
}
buttonstate = digitalRead(buttonpin);
if (buttonstate==0)
{
uses=uses-1;
delay(200);
lcd.print(uses);
lcd.println(" uses remaining ");
delay(5000);
lcd.clear();
if (uses == 0)
{
lcd.print("Refill Required");
lcd.setCursor(0,0);
}
}
}
The following is the final draft of the code for our asthma inhaler device.
------------
const int groundpin = 14;
const int powerpin = 18;
const int ypin = 2;
const int xpin = 3;
const int zpin = 1;
double yaccel;
double xaccel;
double zaccel;
double VecSum;
double total_VecSum;
int newtime=0;
int newesttime=0;
int counts=0;
int counting = 0;
void setup(){
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
Serial.begin(9600);
}
void loop(){
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
newesttime++;
delay(2);
if (!counting && xaccel>800 || yaccel>800 || zaccel>800)
{
newesttime = 0;
counting = 1;
}
if (counting && newesttime<500 && xaccel>800 || yaccel>800 || zaccel>800)
{
newesttime=0;
while (xaccel>800 || yaccel>800 || zaccel>800)
{
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
}
counts++;
Serial.println(counts);
}
else if (counting && newesttime>=500)
{
counting = 0;
counts=0;
Serial.println(counts);
}
if (counts>=12)
{
Serial.println("Shaken");
}
}
/* while (newtime < 5000)
{
yaccel=analogRead(ypin); //changed these from yvalue to yaccel (just to match inputs above)
xaccel=analogRead(xpin);
zaccel=analogRead(zpin);
VecSum = sqrt((xaccel*xaccel)+(yaccel*
total_VecSum=total_VecSum+
delay(100);
newtime=newtime+100;
}
Serial.println(total_VecSum);
}
*/
//down increases (700) up decreases
/*break it down to categories - light, light medium , medium, hard
if acceleration value is between here and here, then build conditions for each of the shakes
assign a value to each of the shakes*/