The present invention provides a closed loop control method in an artificial pancreas and a system using the method, comprising sensing an activity level of a patient by at least one motion sensor and providing signals to at least one processer; then adjusting a series of related algorithms depending partly on the signals by the processer to provide more accurate and reliable data that is the basis of desirable treatment plans, and sending corresponding instructions by the processer for automatic operations of the artificial pancreas to realize a closed loop control.