viam-nau7802

command module
v0.0.0-...-d07900b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

README

viam-nau7802

A Viam module to use a nau7802 load cell amplifier

Setup

Add the module to your robot from the Viam registry. The component may then be added to your configuration as follows (using example values)

  ...
  "components": [
    ...,
    {
      "name": "componentNameHere",
      "model": "biotinker:sensor:nau7802",
      "type": "sensor",
      "namespace": "biotinker",
      "attributes": {
        "zero": 161000,
        "kg": 50000,
        "gain": 128,
        "samples": 16,
        "i2c_bus": "0"
      }
    },
    ...,
  ],
  ...

The attributes gain and samples are optional.

If gain is not set, it will default to 64. Valid gain values are 1, 2, 4, 8, 16, 32, 64, and 128. Gain should be set higher for lower capacity load cells. Any change to gain requires re-calibration.

If samples is not set, it will default to 8. This value is the number of readings which will be taken in quick succession and averaged together to give the reading. Valid samples values is any positive integer.

Calibration

The output of the sensor has two values, a raw reading and a kg reading. The kg reading will be meaningless without proper calibration.

First, assemble your apparatus. Take a reading with nothing on the scale. This raw value should be entered into the zero field in your configuration.

Then, place an item of known weight on the scale and record the raw value. The value to fill in for kg is the amount that the raw value is expected to change for each kg of weight. For example, if your zero value is 163540, and you place a 200g item on the scale and that raw value is 167315, then your kg value should be (167315-163540) * (1000g/200g) which equals 18875

The kg value may be negative, for example if your load cell is installed upside down.

Documentation

Overview

package main is a module providing a nau7802 driver

Directories

Path Synopsis
Package nau7802 implements a nau7802 sensor for load cell amplification datasheet can be found at: https://cdn.sparkfun.com/assets/e/c/8/7/6/NAU7802_Data_Sheet_V1.7.pdf example repo: https://github.com/sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library
Package nau7802 implements a nau7802 sensor for load cell amplification datasheet can be found at: https://cdn.sparkfun.com/assets/e/c/8/7/6/NAU7802_Data_Sheet_V1.7.pdf example repo: https://github.com/sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL