- Thu Feb 09, 2017 12:17 am
#193317
Hi,
I ordered 4x 50kg load sensor (https://www.sparkfun.com/products/10245), a HX711 amplifier (https://www.sparkfun.com/products/13879) and a combinator board (https://www.sparkfun.com/products/13878). Once the items arrived, I carefully read through the hookup guide (https://learn.sparkfun.com/tutorials/lo ... okup-guide) and measured the resistance between the load sensor wires (black, red, white). They gave me 2kOhm between black and white and 1kOhm between the other wires. So I used red as center and white/black as plus/minus on the combinator board. Then I connected the combinator board to the HX711 and attached it to a NodeMCU v2 (ESP-12E) arduino device.
However, I am not able to read any input value using the following (calibration) sketch:
Later I measured the voltage between GND and DAT on the HX711 and it shows 3.29 volts, regardless whether I apply force to the load sensor or not.
When I disconnect the load sensors from the combinator board and measure the resistance between the load sensor wires, the resistance does not change regardless of any force applied to the sensor.
What can I do about it? Are my load sensors defect?
I ordered 4x 50kg load sensor (https://www.sparkfun.com/products/10245), a HX711 amplifier (https://www.sparkfun.com/products/13879) and a combinator board (https://www.sparkfun.com/products/13878). Once the items arrived, I carefully read through the hookup guide (https://learn.sparkfun.com/tutorials/lo ... okup-guide) and measured the resistance between the load sensor wires (black, red, white). They gave me 2kOhm between black and white and 1kOhm between the other wires. So I used red as center and white/black as plus/minus on the combinator board. Then I connected the combinator board to the HX711 and attached it to a NodeMCU v2 (ESP-12E) arduino device.
However, I am not able to read any input value using the following (calibration) sketch:
Code: Select all
When I open the serial monitor (using the correct baud rate), I get only "0.0" as returned value for "Reading". I tried different calibration factors ranging from -705000 over to 705000 (also using values close to zero such as 7, 0.7, 0.07, 0.001 and also 1). But whatever I do. the "reading" is always 0.0./*
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 is the calibration sketch. Use it to determine the calibration_factor that the main example uses. It also
outputs the zero_factor useful for projects that have a permanent mass on the scale in between power cycles.
Setup your scale and start the sketch WITHOUT a weight on the scale
Once readings are displayed place the weight on the scale
Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight
Use this calibration_factor on the example sketch
This example assumes pounds (lbs). If you prefer kilograms, change the Serial.print(" lbs"); line to kg. The
calibration factor will be significantly different but it will be linearly related to lbs (1 lbs = 0.453592 kg).
Your calibration factor may be very positive or very negative. It all depends on the setup of your scale system
and the direction the sensors deflect from zero state
This example code uses bogde's excellent library: https://github.com/bogde/HX711
bogde's library is released under a GNU GENERAL PUBLIC LICENSE
Arduino pin 2 -> HX711 CLK
3 -> DOUT
5V -> VCC
GND -> GND
Most any pin on the Arduino Uno will be compatible with DOUT/CLK.
The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.
*/
#include "HX711.h"
#define DOUT 3
#define CLK 2
HX711 scale(DOUT, CLK);
float calibration_factor = -7050; //-7050 worked for my 440lb max scale setup
void setup() {
Serial.begin(9600);
Serial.println("HX711 calibration sketch");
Serial.println("Remove all weight from scale");
Serial.println("After readings begin, place known weight on scale");
Serial.println("Press + or a to increase calibration factor");
Serial.println("Press - or z to decrease calibration factor");
scale.set_scale();
scale.tare(); //Reset the scale to 0
long zero_factor = scale.read_average(); //Get a baseline reading
Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
Serial.println(zero_factor);
}
void loop() {
scale.set_scale(calibration_factor); //Adjust to this calibration factor
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1);
Serial.print(" lbs"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
Serial.print(" calibration_factor: ");
Serial.print(calibration_factor);
Serial.println();
if(Serial.available())
{
char temp = Serial.read();
if(temp == '+' || temp == 'a')
calibration_factor += 10;
else if(temp == '-' || temp == 'z')
calibration_factor -= 10;
}
}
Later I measured the voltage between GND and DAT on the HX711 and it shows 3.29 volts, regardless whether I apply force to the load sensor or not.
When I disconnect the load sensors from the combinator board and measure the resistance between the load sensor wires, the resistance does not change regardless of any force applied to the sensor.
What can I do about it? Are my load sensors defect?