A method for in-situ detection, speciation, and measurement of a concentration of at least one mercury analyte in a liquid in an oil and gas reservoir, a downhole, or a wellhead platform, comprising:
- a. providing a sensor assembly comprising:
- i. a housing for containing elements of the sensor assembly;
- ii. a sensor array within the housing comprising a surface acoustic wave sensor array, a chemiresistor sensor array, or a combination of both;
- iii. an inlet channel through which the liquid is drawn into the housing and into contact with the sensor array;
- iv. an outlet channel through which the liquid is expelled from the housing;
- v. a sampler within the housing for drawing the liquid into the housing via the inlet channel and expelling the liquid via the outlet channel;
- and
- vi. a processor located within the housing;
- wherein the sensor array includes a plurality of sensors each having a thiol layer comprising a thiol selected from the group consisting of substituted or unsubstituted:
- alkanethiol, alkenethiol, alkynethiol, arylthiol, heteroalkanethiol, heteroalkenethiol, heteroalkynethiol, and heteroarylthiol;
- wherein the thiol is terminated at one end with a functional group to interact with the at least one mercury analyte;
- b. placing the sensor assembly in a location selected from the group consisting of the oil and gas reservoir, the downhole, and the wellhead platform wherein the location has a temperature from about 60° C. to about 300° C. and a pressure of from about 2000 psi to about 8000 psi;
- c. drawing in by the sampler the liquid through the inlet channel to the sensor array of the sensor assembly such that the at least one mercury analyte in the liquid interacts with the functional group of the thiol layers by sorption to a degree depending on the type and concentration of the at least one mercury analyte in the liquid;
- d. continuously producing an electrical output signal indicative of the type and concentration of the at least one mercury analyte sorbed based on the interaction of the at least one mercury analyte in the liquid with the functional group of the thiol layers in step (c);
- e. in the processor, receiving the electrical output signal from the sensor array;
- and
- f. in the processor, applying principal component analysis to the electrical output signal to determine the type and concentration of the at least one mercury analyte sorbed.