Electronic – Homemade NAU7802 breakout board not preforming like reference

adcload cell

I am designing an NAU7802 breakout PCB for a small weight scale project I'm working on, but I've had bad luck getting it working. I am comparing its performance with the Sparkfun Quiic Scale (their NAU7802 breakout board). My board is based on their schematic and board layout.

The following graphs show data collected with each board over ~five minutes at 10Hz with steady state conditions. Gain = 128, input voltage = 3.3v. The same 3kg load cell and micro controller are used to collect the data from both breakout boards. This data is representative of many trials I’ve conducted.

Homemade NAU7802 data
Sparkfun NAU7802 data

You can see that the data from my board is much less stable than the Sparkfun board, in addition to being negative. Again, the same load cell and MCU are used to collect data from both boards.

Here is my schematic, board layout, and assembled PCB:

Homemade NAU7802 schematic
Homemade NAU7802 board layout
Homemade NAU7802 board assembly

Linked are the specific components I’m using on my board:

I would appreciate any help I could get. Thanks!

Edit 1:

#include "SparkFun_Qwiic_Scale_NAU7802_Arduino_Library.h"
NAU7802 myScale; //Create instance of the NAU7802 class

void setup()
{
  Serial.begin(115200);
  Serial.println("NAU7802 Test Code");
  
  Wire.begin();

  if (myScale.begin() == false)
  {
    Serial.println("Scale not detected. Please check wiring. Freezing...");
    while (1);
  }
  //myScale.reset();
  myScale.setGain(NAU7802_GAIN_128);
  myScale.setSampleRate(NAU7802_SPS_10);

  myScale.setBit( 2, 0x02 ); // Set bit = 1 to start cal
  int calCheck = 1;
  while( calCheck == 1 ){ // check status bit and exit when cal is done
    //Serial.println( "waiting for NAU7802 calibration" );
    delay(10);
    calCheck = myScale.getBit( 2, 0x02 );
    //Serial.println( "calCheck: " + String( calCheck ) );
  }
  
  Serial.println("Scale detected!");
  Serial.println( "Zero offset set: " + String( myScale.getZeroOffset() ) );
  Serial.println( "Calibration factor set: " + String( myScale.getCalibrationFactor() ) );
  Serial.println( "CAL_ERR: " + String( myScale.getBit(3, 0x00) ) );
}

void loop()
{
  if(myScale.available() == true)
  {
    long currentReading = myScale.getReading();
    Serial.println(currentReading);
  }
}

Here's a startup cycle from my homemade board:

Homemade board startup cycle

And this is from the sparkfun:

Sparkfun board startup cycle

Edit 2:

Some comments prompted me to inspect the offset calibration and gain calibration registers of the NAU7802. Below are are those values. It's interesting that the offset value are so consistent on the sparkfun boars, vs the inconsistent values from my homemade board. Im not sure what would cause this, though…

NAU7802 offset and gain calibration data

As I was exploring this, I started getting i2c errors from my MCU (NodeMCU ESP32-S, V1.1). The logs read:

[E][esp32-hal-i2c.c:318] i2cDumpI2c(): i2c=0x3ffbdbb4
[I][esp32-hal-i2c.c:319] i2cDumpI2c(): dev=0x60013000 date=0x16042000
[I][esp32-hal-i2c.c:321] i2cDumpI2c(): lock=0x3ffb8440
[I][esp32-hal-i2c.c:323] i2cDumpI2c(): num=0
[I][esp32-hal-i2c.c:324] i2cDumpI2c(): mode=1
[I][esp32-hal-i2c.c:325] i2cDumpI2c(): stage=3
[I][esp32-hal-i2c.c:326] i2cDumpI2c(): error=1
[I][esp32-hal-i2c.c:327] i2cDumpI2c(): event=0x3ffb84c4 bits=200
[I][esp32-hal-i2c.c:328] i2cDumpI2c(): intr_handle=0x3ffb84f4
[I][esp32-hal-i2c.c:329] i2cDumpI2c(): dq=0x3ffb84a0
[I][esp32-hal-i2c.c:330] i2cDumpI2c(): queueCount=1
[I][esp32-hal-i2c.c:331] i2cDumpI2c(): queuePos=0
[I][esp32-hal-i2c.c:332] i2cDumpI2c(): errorByteCnt=0
[I][esp32-hal-i2c.c:333] i2cDumpI2c(): errorQueue=0
[I][esp32-hal-i2c.c:334] i2cDumpI2c(): debugFlags=0x00000000
[I][esp32-hal-i2c.c:311] i2cDumpDqData(): Debug Buffer not Enabled
[I][esp32-hal-i2c.c:354] i2cDumpInts(): Debug Buffer not Enabled
[I][esp32-hal-i2c.c:1130] i2cProcQueue(): Bus busy, reinit
[D][esp32-hal-i2c.c:1336] i2cProcQueue():  Busy Timeout start=0x588db, end=0x5890d, =50, max=50 error=1

This will loop several times, then either crash, or measure zero (0), or return to measuring values as 'normal'. I have no idea why it's doing this, and why I'm seeing this now. As far as I can tell, this only happens on my homemade board, not the Sparkfun board.

Best Answer