A gel-based sensor material that responds to an analyte or group of analytes of interest in a mixture that includes a solution, by changing dimension while in contact with the solution, wherein the sensor material comprises a hydrogel or an organogel, and the hydrogel or organogel comprises an initial crosslinked gel, a volume resetting agent, and a solvent system, wherein:
- a) the crosslinked gel or the volume resetting agent contains moieties on a molecular recognition agent that specifically react to an analyte or group of analytes;
- b) the crosslinked gel or the volume resetting agent that does not include the molecular recognition agent contains heteroatom functionalities that reversibly bind to the molecular recognition agent moieties to form reversible crosslinks within the sensor material such that the sensor material shrinks in volume when the volume resetting agent is added to the gel;
- and
- c) the solvent system comprises water, an organic solvent, or a combination thereof;
- wherein the molecular recognition agent is specific to the analyte or group of analytes of interest such that an increase in the concentration of the analyte or group of analytes causes the bonds between the molecular recognition agent and the volume resetting agent to break as a function of the concentration of the analyte or group of analytes so that the volume of the hydrogel or organogel increases, and conversely, wherein decreasing the concentration of the analyte or group of analytes causes the bonds between the molecular recognition agent and the volume resetting agent to form as a function of the concentration of the analyte or group of analytes so that the volume of the hydrogel or organogel decreases.