Go Down

Topic: FIO Voltage anomalies between 2 units.. (Read 255 times) previous topic - next topic

jchamilt

I have 2 FIO's running the same code pulled from here..

http://semifluid.com/2012/09/09/arduino-fio-internal-voltmeter-and-thermometer/

Code: [Select]
// See: http://code.google.com/p/tinkerit/wiki/SecretVoltmeter
float readVcc() {
  signed long resultVcc;
  float resultVccFloat;
  // Read 1.1V reference against AVcc
  ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
  delay(10);                           // Wait for Vref to settle
  ADCSRA |= _BV(ADSC);                 // Convert
  while (bit_is_set(ADCSRA,ADSC));
  resultVcc = ADCL;
  resultVcc |= ADCH<<8;
  resultVcc = 1126400L / resultVcc;    // Back-calculate AVcc in mV
  resultVccFloat = (float) resultVcc / 1000.0; // Convert to Float
  return resultVccFloat;
}


I am getting way different Voltage readings.. one FIO is around 3.3v the other is around 3.18v, I have swapped batteries pack between the two units.. on is constantly lower than the other..


measuring the voltage at the 3.3 and ground pins gives me 3.29 + or - .01 on both units..

any ideas?


MarkT

Not surprising, the 1.1V reference has a very wide variation between devices IIRC.  You have to calibrate each FIO's voltage reference to get decent accuracy.  One idea is to put the relevant calibration constant into EEPROM so the code can be common to both.
[ I won't respond to messages, use the forum please ]

Go Up