     sensorData.tempIn = smoothedAverage(sensorData.tempIn, tempIn, firstTime);
     int tempOut = int(oneWireSensors.getTempC(thermometerOutside) * 10);
     sensorData.tempOut = smoothedAverage(sensorData.tempOut, tempOut, firstTime);
+    
+    // read battery voltage
+    int val = analogRead(APIN_BATTERY);
+    int battery = int(val * 0.00488 * VDD_RATIO * 10);
+    sensorData.battery = smoothedAverage(sensorData.battery, battery, firstTime);
   
 }
 

        Serial.print((int) sensorData.tempIn);
        Serial.print(' ');
        Serial.print((int) sensorData.tempOut);
        Serial.println();
        serialFlush();
    #endif

            byte door;    // door sensor: 0..1
            int tempIn;   // temperature: -500..+500 (tenths)
            int tempOut;  // temperature: -500..+500 (tenths)
            int battery;  // battery voltage
        };
    };
};
