Pages: [1]   Go Down
Author Topic: FIO Voltage anomalies between 2 units..  (Read 235 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
// 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?

Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12092
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: