Algorithm for implementing a safe meal detection that will minimize false-positive detection (invoking an unnecessary insulin bolus). The different detection methods are backward difference (BD), Kalman filter estimation (Kalman), combination of BD and Kalman (BD+Kalman), and second derivative of glucose (G″). The voting algorithm consists of either a two-out-of-three (BD, BD+Kalman, and G″) or three-out-of-four (BD, Kalman, BD+Kalman, and G″) scheme, respectively.