dual mode cpap pressure monitor

42
DUAL MODE PRESSURE MONITOR ECE445 Fall 2017 Group #48 Yijun Feng, Hanming Li, Yan Zhan [feng42, hli113, yanzhan2] @illinois.edu

Upload: others

Post on 22-Mar-2022

11 views

Category:

Documents


0 download

TRANSCRIPT

DUAL MODE PRESSURE MONITOR

ECE445 Fall 2017 Group #48

Yijun Feng, Hanming Li, Yan Zhan

[feng42, hli113, yanzhan2] @illinois.edu

Background and design objective

Symptom

•Painful sleeping

Reason

•Interrupted Breathing

Solution

•Forced airflow

New Question

•Pressure changes

Proposed Solution

•Monitor pressure

Expectation for the device

Accuracy•Record pressure in a good error and frequency;

Flexibility•Compatibility with most commonly used machine;

Accessibility•The convenience for the users to inspect data

Accuracy: Range and Scale

■ 𝑇 𝑅𝑎𝑛𝑔𝑒

𝑈𝑝𝑝𝑒𝑟 𝐿𝑖𝑚𝑖𝑡

𝑀 𝑅𝑎𝑛𝑔𝑒 ቐ𝑈𝑝𝑝𝑒𝑟 𝐿𝑖𝑚𝑖𝑡

𝑀𝑖𝑛𝑖𝑚𝑢𝑚 𝑆𝑐𝑎𝑙𝑒𝐿𝑜𝑤𝑒𝑟 𝐿𝑖𝑚𝑖𝑡

𝐿𝑜𝑤𝑒𝑟 𝐿𝑖𝑚𝑖𝑡

■ Tolerance Range: The maximum pressure

under which sensor can work without

damage;

■ Measurement Range: The maximum

pressure which sensor can measure and

record;

■ Measurement Scale: The minimal

difference which sensor can react to.

In order to accurately measure the

pressure inside the CPAP tube, we need

three major parameter of accuracy:

Accuracy: Range and Scale for Measurement

■ In order to accurately measure the pressure inside the CPAP tube, we need three

major parameter of accuracy:

■ 10 centimeter for a typical user of CPAP,

■ 20 centimeter for serious obstruction

■ Thus we have design the measurement range to be 20 cm;

■ a good scale for this one is 1 mm.

■ Typically, the machine should tolerate more than the measurement: we set it to 40

cm for the unexpected situation.

Compatibility: types of CPAP machines

■ There are many different

type of CPAP Machines:

■ some for Home (left), and

■ some for Travelling (right).

■ Here is a comparison of

CPAP Machines for home

and for travel, with a ball

indicating relative size.

Compatibility: types of CPAP machines

■ The difference on the design of machines has determined the different needs on the power supply of the systems:

■ there may be powered

■ by home power, and

■ by internal power (battery).

■ Also found that most machine have USB port for power supply.

■ Thus, we choose USB and battery as main power supply.

Home Usually fixed around the bed

Powered with Power Inverter

Usually with AC Supply nearby

Travel Usually bought with travellers

Powered with Battery

Limited AC Supply nearby

Accessibility: Data Visualization

■ Provide a human-friendly

visualization that present the raw

sensor data gathered.

■ Typical usage scenarios are:

1. immediate visual feedback: adjust

by user themselves

2. delayed data feedback: adjust by

professional technicians

Data Gathered

Immediate feedback on screen

User view screen

User adjust machine

Delayed feedback in storage

Technician receive storage

Technician adjust machine

Accessibility: “Customer” Survey

■ have a talk with our “final user”

■ Smartphone shall be used for its

common usage

■ Change screen to Bluetooth Adapter

■ Yan provided a good idea:

■ use Memory Card as storage media

Bluetooth for immediate feedback

Memory Card for delayed feedback

Final feature set

Accuracy

•The ability to measure pressure from 0 to 20 centimeter of water

•The minimum precision shall be within one millimeter;

1

Flexibility

•For the home usage, support for the USB power supply;

•For portable usage, support for the battery supply.

2

Accessibility

•The ability to display on Android cellphone via wireless transmission.

•The ability to keep a record in the memory card for later reference

3

BLOCK DIAGRAM

SENSORHow pressure sensor is chosen and designed to minimize time and cost

1st Candidate: Pressure = Force / Area

■ Pressure equal to the quotient of Force on Area.

■ Know the force, know the pressure.

■ Sensor named FlexiForce A401

■ change its resistance according to the pressure

■ the higher force lead to the lower resistance.

1st Candidate: not sensitive

1st Candidate: Error Analysis

■ not sensitive to the change of air

pressure

■ shape changed as pressure on it

■ the volume expands, the pressure

will drop (pV=nRT)

1st Candidate: More Attempts

2nd Candidate: Single Absolute Pressure

■ commercial pressure sensor that

directly measures pressure

■ Sensor named Vernier Sensor

■ change its out put voltage

according to the pressure

■ the higher force lead to the higher

output voltage.

2nd Candidate: Reference

■ 2nd One measures Absolute

Pressure: the reference is zero.

■ However CPAP pressure is relative

to local atmosphere

■ Especially when travelling: pressure

could change from place to place

■ Pressure also sensitive to

temperature and humidity

■ Not reliable

■ Left Pic: the pressure in inHg (34.5

cmH2O) around United States

3rd Candidate: Relative pressure

■ the pressure difference between two ports.

■ SSCSNBN010NDAA5

■ takes a 5V power supply, and

■ output an analog signal from 0.5 V to 4.5 V,

■ range -2.49 kPa to +2.49 kPa

■ (-25.4 cmH2O to 25.4 cmH2O).

3rd Candidate: Performance Verification

■ Provide the 5V power to the sensor and connect one

measure port to one side of the U-tube.

■ Use an injector to apply air pressure to that side of

the U-tube.

■ Use a multimeter to measure the output voltage

■ Computed the linear regression line

■ Work perfectly: see the next table

■ the equation: V =P/12.57+2.478

3rd Candidate: Pressure Measurement

Pressure

cmH2O

0 1 2 3 4 5 6

Voltage V 2.492 2.553 2.632 2.715 2.795 2.877 2.962

Pressure

cmH2O

7 8 9 10 11 12 13

Voltage V 3.032 3.106 3.193 3.279 3.354 3.445 3.519

Pressure

cmH2O

14 15 16 17 18 19 20

Voltage V 3.595 3.662 3.736 3.820 3.910 4.000 4.080

CONTROLLERThe peripheral components regarding the interface with computer

Design requirement

Parameter Requirement

Measurement

Frequency

200Hz (i.e. records interval less than 5 ms)

Power bus 5V DC via USB directly, and

6V DC via power conversion chip

Connectivity Bluetooth communication with cellphone, and

Card access with memory cards.

Bluetooth module

■ bridge between our solution and cellphone clients.

■ protocol called Serial Port Profile (SPP)

■ emulates Bluetooth as a serial port.

■ Our selection is HC-06 with internal antenna

■ accepts 5V voltage,

■ use a pair of serial TX/RX signal to transfer signal.

Memory Card Module: Card Slot

■ read or written via Serial Peripheral Interface (SPI).

■ bi-directional between microcontroller and Memory Card,

■ integrated in Memory Card, so no necessity to design.

■ uses 3.3V signal, have to design a signal converter.

■ four ports: Clock, D0 (reading), CMD, and D3 (writing)

■ Thus four converters

Design of Logical Converter

■ designed it with a MOSFET

and some pull-up resistors.

■ The left side is with 3.3V,

right side 5V.

■ Ideal situation bidirectional:

■ L 3.3, R 5; L 0, R 0

■ R 5, L 3.3, R 0, L 0

Converter: simulation on computerFrom 3.3V to 5V From 5V to 3.3V

Input = 0

(0V)

Input = 1

(3.3V or 5V)

Microcontroller: ATmega328p

■ Commonly used in Arduino

■ Ease of migration from prototype to product

■ Internal ADC with 10 bits accuracy

■ With 16 MHz running frequency

■ Powered with 5V

■ Cheap

Analysis on ADC’s accuracy

■ Sensor is output analog signal

■ The accuracy dependent on ADC

■ Range from -25.4 cm to 25.4 cm

■ Length is 50.8 cm, 509 mm

■ With 1mm unit, 509 units

■ Need at least 9 bits (2^9 = 512)

■ ATmega328p has 10 bits

■ Enough!

3 Level Power Supply

■ from battery (6V) to 5V for most

components,

■ from 5V to 3.3V for Memory Card.

■ implemented with two low drop

regulators (LDOs), ASM1117.

■ 1st: accepts 6V, output 5V

■ in parallel with USB, already in 5V

(4.4V to 5.25V)

■ 2nd: accepts 5V, output 3.3V

GND Black

Vin Magenta

5V Red

GND Black

Vin Red OUT

3.3V Orange GND Black

5V Red

State

RXD Blue Blue TXD Sensor

Antenna TXD Green Green RXD D3

GND Black Red 5V CMD

5V Red Black GND CLK

EN D0 Yellow

WP

D1

D0 Yellow

GND Black Yellow D0 D0

3.3V Orange Red CLK CLK Red

CLK Red Orange 3.3V 5V Red

CD Black GND GND Black

CMD Green CMD CMD Green

D3 Blue Blue D3 D3 Blue

D2

ASM117 5

HC-06

Bluetooth

Module

Memory

Card

Module

Logic

Level

Converter

ASM117 3.3

Slot

Sensor

Micro

Controller

Block Diagram

■ Left Upper is the design on prototype breadboard;

■ Left Lower is the design on PCB board;

■ Next Page is the schematic graph

Android Software

■ ATmega328p is a single-thread system,

■ we have to include all routine in one thread.

■ two modes In the design document,

■ Online mode: Under this mode, client

1. poll data from microcontroller, and attach the data with the timestamp from the internal clock.

2. display the content on the screen when the recording is stopped.

■ Offline mode: Under this mode, microcontroller

■ Receive the current time stamp as t𝑤𝑜𝑟𝑙𝑑,𝑠𝑡𝑎𝑟𝑡 at the beginning and compute t𝑐𝑜𝑛𝑡𝑟𝑜𝑙𝑙𝑒𝑟,𝑠𝑡𝑎𝑟𝑡.

■ independently calculate the timestamp based on the start timestamp and the time difference based on formula 𝑡𝑤𝑜𝑟𝑙𝑑,𝑛𝑜𝑤 = 𝑡𝑤𝑜𝑟𝑙𝑑,𝑠𝑡𝑎𝑟𝑡 + 𝑡𝑐𝑜𝑛𝑡𝑟𝑜𝑙𝑙𝑒𝑟,𝑛𝑜𝑤 − 𝑡𝑐𝑜𝑛𝑡𝑟𝑜𝑙𝑙𝑒𝑟,𝑠𝑡𝑎𝑟𝑡

Start

Yes ← SDCard Inserted? → No

↓ ↓

Status = Idle → Initialize Bluetooth ← Status = OnlineOnly

→ → → → Instruction Received? → Yes

↑ ↑No↑ ↓ ↓

↑ Status = Busy? ← No ↓

↑ ↓Yes↓ ↓

↑ Take a Record "Get current status" ← What is the Instruction? → "Toggle Offline"

↑ ↓ ↓ ↓ ↓

↑ ← Write into Memory Card Send Status back "Online Mode Data" Status = OnlineOnly? → No

↑ ↓ ↓ ↓ ↓

↑ ← ← ← ← Take a Record Yes Status = Idle? → No

↑ ↓ ↓ ↓Yes↓ ↓

↑ ← ← ← Send Data back ← ← ↓ ← Status = Busy Status = Idle

↑ ↓ ↓

↑ ← ← ← ← ← ← ← ← ← ← ← ←

Demo: Approach

Demo: Result

Failure during demo: Shortage of Surface Mounted Devices

■ some of our ordered components are not able to be delivered in time.

■ included a lot of SMD (surface mounted devices) in the board When designing our circuit board

■ No supplies at ECE parts shop and other available sources.

■ significantly delayed our process of manufacturing:

■ some of our components, especially like Memory Card Slot, even have to be shipped from China in ship.

■ Ordered from another available source

Failure during demo: Inadequate frequency

With debug code (96 mseach request)

Without debug code (4 mseach request)

Cost

Component Name Model Purchase Price Mass Price

Bluetooth Module HC-06 $8.99 $99.99 for 100

SD 4UCON 19608 $5.99 $4.99 for 10

Sensor SSCSNBN010NDAA5 $20.00 $12.99 for 10

LDO ASM1117-5,

ASM1117-3.3

$5.99 $0.99 for 10

Microcontroller ATmega328p Free (Sample) $49.99 for 10

Other peripheral components Capacitors, Resistors, etc. Free (pre-owned) Negligible

Labor We have spent about 50 hours (3 months * 4 weeks * 4 hours per week) on

this project. Thus, the labor cost for this project is among $20 per hour (the

average salary of a well-trained worker) * 50 hours * 2.5 = $2500

Conclusion

■ This project has finally succeeded in:

1. measuring CPAP pressure with the precision of 1mm,

2. presenting it in a graph via wireless transmission, and

3. storing it in memory card for later analysis.

■ run as a fast-enough frequency (200Hz),

■ user will not miss any tiny but important change during their night.

■ There are still some uncertainties during our development.

■ Limited by the weather condition, we are not able to verify if the sensor will work correctly even after user have travelled for a long distance with significant environmental pressure change.

■ Also, we have not tested how will the tube leaking affect our pressure reading, thus its influence on the recording accuracy is still unknown.

Ethical Concerns and Future Plans

■ This design also may have something to enhance regarding engineering ethics and professionalism. If the machine is not calibrated, it is too late for the user to adjust it next day, because they will have to suffer an uncomfortable night.

■ In the IEEE ethics, we are told that we shall use technologies to enhance the happiness of its user and everybody else.

■ Thus, we have a future plan that focus on these points:

■ Try to add an automatic calibration: once the user set its optimal pressure, the controller can automatically try to maintain the pressure at it;

■ Try to add a hand-driven generator: user can push it to generate enough energy to power this machine at night, reducing usage of batteries and electricity;

■ Try to integrate it with cellphone (for example, use 3.5 mm jack to transfer data as audio) to reduce the traveling burden of user.

DUAL MODE PRESSURE MONITOR

ECE445 Fall 2017 Group #48

Yijun Feng, Hanming Li, Yan Zhan

[feng42, hli113, yanzhan2] @illinois.edu