Hii,
I was looking for a programm what can read 2 SparkFun Qwiic Scale - NAU7802 boards. But can’t find anywhere.
For the calibration i want mV/V as data? is there a simple option to configure this or do i need to calibrate the 2 prints?
Thanks!
Hii,
I was looking for a programm what can read 2 SparkFun Qwiic Scale - NAU7802 boards. But can’t find anywhere.
For the calibration i want mV/V as data? is there a simple option to configure this or do i need to calibrate the 2 prints?
Thanks!
You’d need to use a mux and make a simple program that does so
Go through the scale guide and then the mux guide and call/print the readings separately
It does not realy work. I did everything the same like the guide.
/*
Use the Qwiic Scale to read load cells and scales
By: Nathan Seidle @ SparkFun Electronics
Date: March 3rd, 2019
License: This code is public domain but you buy me a beer if you use this
and we meet someday (Beerware license).The Qwiic Scale is an I2C device that converts analog signals to a 24-bit
digital signal. This makes it possible to create your own digital scale
either by hacking an off-the-shelf bathroom scale or by creating your
own scale using a load cell.This example merely outputs the raw data from a load cell. For example, the
output may be 25776 and change to 43122 when a cup of tea is set on the scale.
These values are unitless - they are not grams or ounces. Instead, it is a
linear relationship that must be calculated. Remeber y = mx + b?
If 25776 is the ‘zero’ or tare state, and 43122 when I put 15.2oz of tea on the
scale, then what is a reading of 57683 in oz?(43122 - 25776) = 17346/15.2 = 1141.2 per oz
(57683 - 25776) = 31907/1141.2 = 27.96oz is on the scaleSparkFun labored with love to create this code. Feel like supporting open
source? Buy a board from SparkFun!
SparkFun Qwiic Scale - NAU7802Hardware Connections:
Plug a Qwiic cable into the Qwiic Scale and a RedBoard Qwiic
If you don’t have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (Qwiic Cable - Breadboard Jumper (4-pin))
Open the serial monitor at 115200 baud to see the output
*/#include <Wire.h>
#include “SparkFun_Qwiic_Scale_NAU7802_Arduino_Library.h” // Click here to get the library: http://librarymanager/All#SparkFun_NAU7802
NAU7802 myScale; //Create instance of the NAU7802 class
#define NUMBER_OF_SENSORS 2
void setup()
{
Serial.begin(115200);
Serial.println(“Qwiic Scale Example”);Wire.begin();
for (byte x = 0 ; x <= 7 ; x++)
{
disableMuxPort(x);
}//Initialize all the sensors
for (byte x = 0 ; x < NUMBER_OF_SENSORS ; x++)
{
enableMuxPort(x); //Tell mux to connect to port X
accel.init(); //Init the sensor connected to this port
disableMuxPort(x);
}Serial.println(“Mux Shield online”);
if (myScale.begin() == false)
{
Serial.println(“Scale not detected. Please check wiring. Freezing…”);
while (1);
}
Serial.println(“Scale detected!”);
}void loop()
{
for (byte x = 0 ; x < NUMBER_OF_SENSORS ; x++)
{
enableMuxPort(x); //Tell mux to connect to this port, and this port onlyif(myScale.available() == true)
{
int32_t currentReading = myScale.getReading();
Serial.print("Reading: ");
Serial.println(currentReading);
}
disableMuxPort(x); //Tell mux to disconnect from this port
}delay(1); //Wait for next reading
}
What isn’t working?
Can you get 1 sensor working by itself?
one sensor is working with the library GitHub - sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library: An Arduino library to interface with load cells using the Qwiic interface and the NAU7802.
But when i add the library to add multiple qwixx Nau7802 interfaces i can not figur out how i need to implement the code.
You need to use a multiplexer (device) to connect multiple devices with a fixed address (0x2A) like you’ve described.
It’s conceptually similar to the wifi router or switch you need to share internet & network activity at home or office. You could do away with a router but then you’d only be able to connect one end device to the modem’s ethernet at a time.