## Introduction: Make Your Weighing Scale Hack Using Arduino and Hx711

I am working on an application where i need to convert the weight of a person to calculate and use it for other parameter.

So i started searching the internet and found many tutorials using the load cell and arduino.

I started by opening up a bathroom scale and using the sensors available in it.

It turned out after trying with the AD620 insrumentation amplifier that i was not getting linear results and the readings were not accurate so i decided to use HX711 instead.

Also the code provided displays the weight in KG and can measure upto 120KGs.

I am publishing this instructable so it helps someone like me to make their project faster.

## Step 1: Open Up the Scale.

First you need to open the weighing scale and get rid of the internal circuit to use the load sensors

## Step 2: Understanding the Sensor

The load sensor found in the scale is https://www.sparkfun.com/products/10245 4 such sensors are connected in a bridge configuration.

The Sensor has 3 terminal wires as seen in the pic they are:

1. Vcc ------ White
2. Vss ------ Black
3. Signal ------ Red

Generally we consider the white to be signal wire but its not its the red one

Found out my load cell was connected in a bridge configuration in image :

## Step 3: Connecting Sensor to Arduino

So the sensor gives the analog voltage as an output to the arduino but the voltage level is too small to be detected by the adc of the arduino and needs to be amplified using instrumentation amplifiers like AD620 or INA125.

Also the ADC on the arduino is 10 bit which provides a maximum of 2^10 ie. 1024 readings compared to HX711 which is 24 bit ADC and easy to interface. HX711 Datasheet

The Hx711 uses SPI interface to communiacate to the Arduino. (Refer Data sheet for more info)

Connecting to Arduino

Connection is pretty simple.

1. Connect the wires from the load sensors E+ E- on the terminals of the sensor

2. Connect the S+ and S- wires on the A+and A- terminals respectively.

3. Connect Vcc and Gnd

4. Connect the Dt terminal to A1 and Sck terminal to A0 (can be changed according to code)

## Step 4: Library for Arduino

```<p>//The library used for arduino  https://github.com/bogde/HX711<br>// LCD can also be used instead of serial
#include "HX711.h"
// HX711.DOUT	- pin 10
// HX711.PD_SCK	- pin 11
HX711 scale(10, 11); // parameter "gain" is ommited; the default value 128 is used by the  library  library*/</p><p>void setup()
{
Serial.begin(38400);
Serial.println("HX711 Demo");</p><p>  Serial.println("Before setting up the scale:");

Serial.print("get value: \t\t ");
Serial.println(scale.get_value(5));
// print the average of 5 readings from the ADC minus the tare weight (not set yet)

Serial.print("get units: \t\t ");
Serial.println(scale.get_units(5), 1);
// print the average of 5 readings from the ADC minus tare weight (not set) divided by the SCALE parameter (not set yet) </p><p>  scale.set_scale(2280.f);
// this value is obtained by calibrating the scale with known weights; see the README for details
scale.tare();   // reset the scale to 0

Serial.println("After setting up the scale:");

Serial.print("get value: \t\t ");
// print the average of 5 readings from the ADC minus the tare weight, set with tare()
Serial.println(scale.get_value(5));</p><p>Serial.print("get units: ");
Serial.println(scale.get_units(5), 1);
// print the average of 5 readings from the ADC minus tare weight, divided by the SCALE parameter set with set_scale

}</p><p>void loop()
{
Serial.print("Weight :");
/* ---------Weight in terms of KG-------------*/
Serial.print(scale.get_units()*0.1 , 1);
Serial.print("KG");</p><p>  scale.power_down();			        // put the ADC in sleep mode
delay(5000);
scale.power_up();
}</p>```

## Step 5: More Modifications and Links

You can connect a wifi module to it and upload the readings to an app or web server.

More details can be found here.

Update : 27/7/2015 : Had some issues like lcd displaying black boxes it was fixed by changing the analog pins A1,A0 to other digital pins eg (10,11) in the code.

Thanks: :)