         }
         if(!dust.isSamplingComplete()) {
           unsigned long duration = pulseIn(DUST_PIN, LOW);
-          dust_concentration = dust.getConcentration(duration, current_ms);          
+          sample.dust_concentration = dust.getConcentration(duration, current_ms);          
         }
         if(mq131.isSamplingComplete() && dust.isSamplingComplete() && tgs2602.isSamplingComplete()) {
-          tgs2602_sewer = tgs2602.getSewerGasPercentage(tgs2602_sample_avg, tgs2602_Ro);            
-          mq131_ozone = mq131.getOzoneGasPercentage(mq131_sample_avg, mq131_Ro);
-          mq131_chlorine = mq131.getChlorineGasPercentage(mq131_sample_avg, mq131_Ro);          
+          sample.tgs2602_sewer = tgs2602.getSewerGasPercentage(tgs2602_sample_avg, tgs2602_Ro);            
+          sample.mq131_ozone = mq131.getOzoneGasPercentage(mq131_sample_avg, mq131_Ro);
+          sample.mq131_chlorine = mq131.getChlorineGasPercentage(mq131_sample_avg, mq131_Ro);          
           rs.setSamplingComplete();         
         }
         delay_ms=0;

#define CALIBRATE_BTN           D4

ReadingSync rs (INTERVAL_MINS, PRE_HEAT_SECS, Time.now());

SimpleEeprom flash;

union float2bytes {float f; char b[sizeof(float)]; };
int unix_time = 0;
int delay_ms = 0;
int reading_time = 0;
int heating_count=0;
int calibration_count=0;
int stage=0;

          tgs2602.startSampling(current_ms);
          mq131.startSampling(current_ms);
          dust.startSampling(current_ms);
          sample.reading_time = unix_time;
        }
        if(!tgs2602.isSamplingComplete()) {
          tgs2602_sample_avg = tgs2602.getResistanceCalculationAverage(analogRead(SENSOR_TGS2602), current_ms);
