/* 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. Wiring bluetooth: GND of HC-05 to GND Arduino, VCC of HC-05 to VCC Arduino, TX HC-05 to Arduino Pin 10 (RX) RX HC-05 to TX Arduino (TX) 1x19 steel wire specs: 4mm 1350kg 5mm 2100kg 6mm 3028kg 1mm of strain = 5% break load (for a 2 meter ruler) */ #include "HX711.h" #include SoftwareSerial BTserial(10, 11); // RX | TX #define calibration_factor -7780.0 //This value is obtained using the SparkFun_HX711_Calibration sketch #define DOUT 3 #define CLK 2 HX711 scale(DOUT, CLK); void setup() { BTserial.begin(9600); Serial.begin(9600); 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 } void loop() { //BTserial.print("4"); //BTserial.print(" mm 1x19 = "); BTserial.print(scale.get_units() / 8.46, 1); BTserial.print("%"); BTserial.print(","); //BTserial.print("5"); //BTserial.print(" mm 1x19 = "); BTserial.print(scale.get_units() / 16.24, 1); BTserial.print("%"); BTserial.print(","); //BTserial.print("6"); //BTserial.print(" mm 1x19 = "); BTserial.print(scale.get_units() / 27.93, 1); BTserial.print("%"); BTserial.print(";"); Serial.print(scale.get_units(), 1); //scale.get_units() returns a float Serial.println(); }