 
 /* ******************** get and display the System on Chip internal data: temp, Vcc, ... ******* */
 
+// simple low-level subroutine to get the VDD supply voltage
+uint16_t readVDD() {
+  uint16_t value;
+
+  // Compare VDD against VBG(1.2v reference) at 10 bit resolution
+  NRF_ADC->CONFIG = 0x0000001A;
+  NRF_ADC->ENABLE = 0x00000001; // Enable the ADC
+  NRF_ADC->TASKS_START = 1; // Start a conversion
+  while(NRF_ADC->BUSY == 1){} // Busy Wait for completion
+  delay(1); // needed if used on RFduino for some reason.
+  value = (uint16_t)NRF_ADC->RESULT; // Read the ADC Result
+  NRF_ADC->TASKS_STOP = 1; // Turn off ADC
+  NRF_ADC->ENABLE = 0; // Disable the ADC
+  return(value);
+}
+
 void getSoCData()
 {
   analogReference(VBG);
   analogSelection(VDD_1_3_PS);
+#ifdef RFD
   int sensorValue = analogRead(1);
-
   SoCData.voltage = sensorValue * (360 / 1023.0) * 10;
-  SoCData.voltagePercent = map(SoCData.voltage, MIN_VOLTAGE, MAX_VOLTAGE, 0, 100);
-#ifdef RFD
   SoCData.temperatureC = RFduino_temperature(CELSIUS);
   SoCData.temperatureF = RFduino_temperature(FAHRENHEIT);
 #else
+  uint16_t sensorValue = readVDD();
+  SoCData.voltage = sensorValue * (380 / 1023.0) * 10;
   SoCData.temperatureC = Simblee_temperature(CELSIUS);
   SoCData.temperatureF = Simblee_temperature(FAHRENHEIT);
 #endif
-  if (SoCData.voltage < 2400) BatteryOK = false;
-  else BatteryOK = true;
+  SoCData.voltagePercent = map(SoCData.voltage, MIN_VOLTAGE, MAX_VOLTAGE, 0, 100);
+  if (SoCData.voltage < MIN_VOLTAGE) 
+    BatteryOK = false;
+  else 
+    BatteryOK = true;
 }
 
 void printSoCData(void)

  nRawRecord msg;
  unsigned char msgbuf[80];

  print_statef("sendBGOverBLE(raw %d), delay %d min", pPkt->raw/1000, (mymillis() - pPkt->ms)/60000);

  if ( !BTconnected ) {
    print_state("no BT connection, skip");

  // count the minutes from program start using sensor minutes counter
#ifdef SIM_MINUTES_UPCOUNT
  // simulate upcounting minutes using a dead sensor
//  print_state("adding "); Serial.printf(" %d * %d = %d", loop_cnt-1, runPeriod, (loop_cnt-1)*runPeriod);
  sensorData.minutesSinceStart += (loop_cnt-1)*runPeriod;
#endif
  minutesSinceProgramStart = sensorData.minutesSinceStart - startMinutesSinceStart;
