Apparatus is provided that includes a drug capsule containing an oral drug, and a sensing apparatus that includes a housing and a sensor. The housing is shaped so as to define exactly one hemispherical portion and exactly one cylindrical portion, which together define an internal surface tightly fitted to at least a portion of an external surface of the drug capsule. The sensor includes first and second electrodes, which comprise first and second electrode surfaces, respectively; and circuitry, which (a) is attached to the housing, (b) is electrically coupled to the first and the second electrode surfaces, and (c) is configured to drive a current between the first and the second electrode surfaces. Other embodiments are also described.