Described herein is a programmable portable infusion device. The infusion device may include electronics such as sensors and can be programmed to detect parameters related to the proper administration of infusion. If the sensors detect that a parameter is outside of a defined boundary or range the infusion device may notify a user that it may not be safe to administer infusion and may prevent infusion from occurring.