A circuit for producing an output signal at an output thereof in response to an input signal at an input thereof is comprised, in one embodiment, of a first switch for connecting the output to a first voltage source and a second switch for connecting the output to a second voltage source. According to one aspect, the method includes the steps of: forming a treatment fluid comprising: a carrier fluid; and a first reactant and a second reactant; and introducing the treatment fluid into a section of conduit used for the production or transmission of hydrocarbon. The sensor head includes a wiring substrate having electrodes formed thereon and on which the light source and photodetector are disposed at predetermined positions and a light transmitting material that covers the wiring substrate, light source, and photodetector.