A device configured to delivery medication is disclosed. The device contains a plurality of sensors, including a magnetic proximity sensor and a temperature sensor. The proximity magnetic sensor can detect whether all the medication has been injected into a patient. The temperature sensor can ascertain whether the temperature of the medication has reached a predetermined or proper level for injection. The device also contains a locking device that can lock the device when the temperature of the medication is below this proper temperature and can automatically unlock the device when the temperature reaches or exceeds this proper temperature.