A sensor system (100, 200) for measuring the index of refraction of a sample, the sensor system comprising: a sample chamber (110, 210) for receiving a sample; a first temperature sensor coupled to the sample chamber; one or more heating and/or cooling elements coupled to the sample chamber; an index of refraction sensor exposed to the sample chamber; and a controller comprising a memory having a sampling temperature setpoint associated with the sample chamber stored therein, and a spike mode controller (SMC; 274), the controller electronically coupled to and in communication with the first temperature sensor, the one or more heating and/or cooling elements and the index of refraction sensor, wherein if the controller determines that a temperature of the sample chamber is outside a tolerance of the sampling temperature setpoint as measured by the first temperature sensor, the controller is configured to activate the spike mode controller to operate the one or more heating and/or cooling elements to reach a maximum hot or a maximum cold temperature to rapidly bring the temperature of the sample within the tolerance of the sampling temperature setpoint of the index of refraction sensor as determined by the first temperature sensor, the controller further comprising a PID controller, wherein if the controller determines that the temperature of the sample chamber as determined by the first temperature sensor is within the tolerance of the sampling temperature setpoint, the system controller is configured to activate the PID mode controller to maintain the temperature of the sample within the tolerance of the sampling temperature setpoint. a sample chamber (110, 210) for receiving a sample; a first temperature sensor coupled to the sample chamber; one or more heating and/or cooling elements coupled to the sample chamber; an index of refraction sensor exposed to the sample chamber; and a controller comprising a memory having a sampling temperature setpoint associated with the sample chamber stored therein, and a spike mode controller (SMC; 274), the controller electronically coupled to and in communication with the first temperature sensor, the one or more heating and/or cooling elements and the index of refraction sensor, wherein if the controller determines that a temperature of the sample chamber is outside a tolerance of the sampling temperature setpoint as measured by the first temperature sensor, the controller is configured to activate the spike mode controller to operate the one or more heating and/or cooling elements to reach a maximum hot or a maximum cold temperature to rapidly bring the temperature of the sample within the tolerance of the sampling temperature setpoint of the index of refraction sensor as determined by the first temperature sensor, the controller further comprising a PID controller, wherein if the controller determines that the temperature of the sample chamber as determined by the first temperature sensor is within the tolerance of the sampling temperature setpoint, the system controller is configured to activate the PID mode controller to maintain the temperature of the sample within the tolerance of the sampling temperature setpoint.