How to change calibration factor to Kg

Hi, im using a code and I want to change the calibration factor to Kilograms. Can anyone share thoughts on how to change the factor to kg? Thanks!

Btw this is the code:

/*
 Example using the SparkFun HX711 breakout board with a scale
 By: Nathan Seidle
 SparkFun Electronics
 Date: November 19th, 2014
 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
 
 This example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your
 specific load cell setup.
 
 This example code uses bogde's excellent library: https://github.com/bogde/HX711
 bogde's library is released under a GNU GENERAL PUBLIC LICENSE
 
 The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge
 based load cell which should allow a user to measure everything from a few grams to tens of tons.
 Arduino pin 2 -> HX711 CLK
 3 -> DAT
 5V -> VCC
 GND -> GND
 
 The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.
 
*/

#include "HX711.h"

#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

#define DOUT  3
#define CLK  2

HX711 scale(DOUT, CLK);

void setup() {
  Serial.begin(9600);
  Serial.println("HX711 scale demo");

  scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
  scale.tare();	//Assuming there is no weight on the scale at start up, reset the scale to 0

  Serial.println("Readings:");
}

void loop() {
  Serial.print("Reading: ");
  Serial.print(scale.get_units(), 1); //scale.get_units() returns a float
  Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor
  Serial.println();
}

Why not put a known weight on the scale, and calibrate it yourself?

Computers (and microcontrollers) are really-really good at math... ;) But, you have to give it the "formula" or equation/expression.

Try this:

Serial.print(0.454 * scale.get_units(), 1); //scale.get_units() returns a float

Serial.print(" kg");

License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

:D :D :D I've never seen that one before! :D :D :D

DVDdoug: Computers (and microcontrollers) are really-really good at math... ;)

Generally, they're properly rubbish at mathematics, but rather good at arithmetic. ;)

Groove: Generally, they're properly rubbish at mathematics, but rather good at arithmetic. ;)

In binary, at least.

I would imagine that you need to either multiply or divide the calibration factor for pounds by 2.205.

I can't say whether it is multiply or divide because i don't know how the calibration factor is used.

If you try both methods, and you are lucky, one will be correct, the other out by a factor of around 5.

  Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor

Translation: I'm a Murrican, programming for other Murricans, and if you don't use Murrican units, well, that's your problem, not mine!

If you buy him a beer, make it a Budweiser or some such. Murrican units gets you Murrican beer.

I feel like when I am programming, I tend to forget units. But in recent years, I've reformed a habit of including units in the names such as timer1_us, factor_kg_per_lb or factor_kg_per_input etc. so I know the unit of each variable or which way the factor converts numbers. I don't think programmers or many engineers practice this in programming in general.

macoy-marc:

define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

Use the calibration sketch with Kgs, or is that a bit obvious?