Smart patch