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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.