   digitalWrite(THERMISTOR_MOSFET, HIGH);
   double avg = (double) sum / count;
 
-  double inp_voltage = avg * 1.1 / 1023; // Reference voltage = 1.1V,
-                                         // maximum value = 1023 (10 bits)
+  //return(filt_2nd_stage.processReading(avg));
+
+  // Reference voltage is supposed to be 1.1V. Measuring the actual
+  // temperature inicates it is a little too low.
+  // Maximum value @10 bits resolution: 1023
+  double inp_voltage = avg * 1.0598865 / 1023;
   // voltage divider 1k over PT100 thermistor connected to 5V
   double R_PT100 = 1000./(5./inp_voltage-1);
 

// only for plotting:
char oven_is_on = 0;

//Specify PID pointers and initial tuning parameters
PID control_PID(&PID_in, &PID_out, &PID_setpoint,2,5,1, DIRECT);

// Digital outputs
//     relay -> fan

 * timestamps, the temperature is interpolated linearly.
 */
const unsigned int tprofile_n = 5;
const unsigned long tprofile_times[] = {10000000, 20000, 30000, 50000, 60000};
const float tprofile_temps[] =         {80, 200, 235, 235,   0};
reflow_profile tprofile(tprofile_n, tprofile_times, tprofile_temps);

void plot_callback(void) {
  // plotting thread
  plotter.Plot();
  //Serial.println(PID_in);
}

void control_callback(void) {
