Close

High Level Flow Chart

A project log for CPAP Water Reservoir Monitor - Sleep Apnea

What happens when the humidifier for your CPAP runs dry in the night? It isn't pleasant. Let's fix this.

Scott ClandininScott Clandinin 08/06/2017 at 20:340 Comments


Every measurement of weight is done by taking 5 measurements in 50ms increments, and taking the average of them. At any instance the weight is not exactly the same, so this helps dampen out outlier measurements.

The alarm weight is calculated by: 

((full_weight - empty_weight) * alarm_percent) + empty_weight;

This allows the device to monitor the weight as a function of percent remaining, rather than pre-defined weight.

The weight to be compared to the alarm weight is the result of a 10 measurement moving average to get a stable value that will dampen out any outlying measurements. At any given time, this weight is the result of 50 separate measurements. When a new measurement is made, it adds it to the calculation, and pushes out the oldest measurement. 

As long as the hanger is not in use, and the weight doesn't reach the alarm value, the device will keep making measurements. Weight calibrations can only be made while the mask is on the hanger. The user will be notified by a success or error sound based on whether or not calibration values properly set upon taking the mask off of the hanger. If the full weight is less than the empty weight in calibration, an error sound will play.

Discussions