Close

Testing the Scale

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/08/2017 at 04:000 Comments

Calibration

Five measurements are taken per weight measurement and averaged. No effort is made to put these resulting value in units of weight since I am working off percent remaining. These calibration values will be placed in EEPROM so calibration doesn't need to be done every time the device loses power.

Moving Average

As seen above, a new measurement value takes the place of the first value, and the oldest value is pushed out of the calculation. Every cycle the result is compared to the alarm weight to determine whether or not to sound the alarm.

Discussions