HX711 and weight cell load problem

Hello,

I have a problem with my project with weight cell loads.

I have :

I just want to know the weighton the sensor.

So I do this setup (but I connect VCC to 5V and VDD to 3.3V due to my Genuino Zero, correct ?):

With this code to calibrate and also to have some raw data (from Sparkfun's site):

#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;
  }
}

My problem is that in the console nothing appears, like the Genuino is blocked. But when I disconnect 3.3V or the data pin, text appears but only 0 :confused:

Reading: 0 lbs

When I disconnect the 3.3V, only the next data is not 0, but always the same numbers, it not correspond the weight on sensors.

Reading:0 lbs
Reading:0 lbs
one reading: -1839.6 -> I disconnect at this moment
Reading:0 lbs
Reading:0 lbs

So have you got some ideas to resolve this problem ? It comes from Genuino Zero ?
My cell load is good connected.
I try to connect VCC and VDD to 5V : same problem.

Thank you ! :slight_smile:

I try to connect VCC and VDD to 5V : same problem.

Bad idea, that might have destroyed the Arduino ports.

Check at least the pin connected to DOUT if it's still working.

I have a problem with the weight sensor I can not determine the meaning of the wires I chose a Chinese model how I can determine the wires

the serial monitor give me 0 in out put

I used the standard wiring of load cell wires

E+ Red
E- black
A+ Green
A- white

bilelbilel:
I have a problem with the weight sensor I can not determine the meaning of the wires I chose a Chinese model how I can determine the wires

the serial monitor give me 0 in out put

I used the standard wiring of load cell wires

E+ Red
E- black
A+ Green
A- white

For connecting load cell to arduino, you need prepare an amplifier module such as HX711 and connect all wire same to below link. After, you download example library for HX711 and test your load cell. In this library you can find special program for load cell:


Library:

pylon:
Bad idea, that might have destroyed the Arduino ports.

Check at least the pin connected to DOUT if it's still working.

I have verified all the pins (analog in and digital), they all worked.

In order to add informations about my problem : my Genuino ZERO often crashes, I have to disconnect and reconnect the usb port for almost each try. (JTAG problem or COM port not detected)

It seems like this declaration block the Genuino :

scale.begin(3, 2);

Because when I launch the Genuino, in the console, only appears the instruction above this declaration (Serial.println).

UPDATE : I tried with Arduino Mega : same problem, it seems like the vdd block the program when I connect it to 5v.

caroun:
It seems like this declaration block the Genuino :

scale.begin(3, 2);

Because when I launch the Genuino, in the console, only appears the instruction above this declaration (Serial.println).

In the code you posted this line does not exist. Is it possible that you test with other code than you posted? I don't like to waste my time with such stuff...

pylon:
In the code you posted this line does not exist. Is it possible that you test with other code than you posted? I don't like to waste my time with such stuff...

Sorry it was with an other code and another librairie :confused:

But it is the same problem in my initial code (see below).

#define DOUT  3
#define CLK  2

HX711 scale(DOUT, CLK);

The program block at this moment.

I will buy an other HX711, maybe mine is broken :sob:

I will buy an other HX711, maybe mine is broken

It looks like. Because in the initializer a read is executed and there is a while loop that waits for the HX711 to react on the lowering of the clock line with a lowering of the data line. It waits forever if the chip don't react.

I change my HX711 and all worked, thank you for you replies :slight_smile:

I have the exact same problem with my HX711, and an Arduino 101. Except that i have tried two different HX711 boards.
None of them work on the 101, but they both work fine on my Leonardo. Same test code, same setup!
Have you changed anything other than the HX711, maybe a never version of the board software, or the IDE?

BR Niels

The 101 runs on 3V3, the Leonardo on 5V. There are more than enough differences between the two that might explain a different behavior.

I guess the code is not that relevant but the wiring is. But without schematics of the boards you use we cannot help you further.

This is kind of a to and from project for me, but i believe that i had it working on the 101 at some point, but i am not really certain. Any how, i found the schematics here:

Since the 101 is 5V tolerant, anything above 3v3 should just be registered as HIGH, on the pins. This works for other components using digital communication. Not perfect, i know, but that is what the circumstances allow.
I have tried using both the 3v3 and 5V supply from the 101, same results.

A 3.3volt processor needs a HX711 board with separate analogue (5volt) and digital (3.3volt) supply pins.
The diagram in post#11 is a 5volt only board.
Leo..

Just out of curiosity... why?
As far as i have found, the chip itself should be able to handle 3.3V.

I found a blog post, suggesting changing R12 from a 20K, to a 10K resistor, in order to provide sufficient excitation for the Wheatstone bridge. I tried it, but no change in the results.

BR Niels

P.S. I have now ordered the sparkfun board with independent analoug and digital VDD. Buy nice or buy twice i guess.. :slight_smile:

MorseDK:
Just out of curiosity... why?
As far as i have found, the chip itself should be able to handle 3.3V.

HX711 internal reference voltage is 1.25volt.
Most boards have a 12k:20k feedback divider.
That results in an excitation voltage of 1.25/8.2k*(20k+8.2k)= ~4.3volt.
The series transistor needs at least 0.3volt, resulting in a minimum supply for the analogue part of 4.6volt.
Leo..

'load cell', not "weight cell load" which is a tautology (load means weight)

Hi Guys

I have now tried the HX711 from sparkfun with individual analog and digital voltage reference, and its the completely same result. I have also gone through my notes, and i can see that i have had it working on the 101 at an earlier point, where i tested all my different breakout boards individually.
This leads me to believe, that it must be something new in the firmware for the 101, maybe it has something to do with the initialisation/default setting, of how it reads the pins, i am thinking of pull-ups and such.

Is there someone who might be a bit more insightful than me, who can maybe help out?

i am running IDE 1.8.2
intel curie 2.0.2
and the bogde hx711 lib, pr. 11 jan 2017

BR Niels

Ok, Short update.

I just tried it with board firmware version: intel curie 1.0.7 and everything is working perfectly, also on 5V.
The problem is clearly somewhere in the firmware update for the 101. Thank for all of your help, guys.

BR Niels

Hi Niels or anyone else?

I have the same problem with the HX711 and have read your solution. But i am just a beginner and dont know how to set the firmware to intel curie 1.0.7. Can you please explain me? It would be very nice!

Greetings Gert

please help me.. :slight_smile: :slight_smile:

i have a problem with this error program

" Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Uno"
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard -IC:\Users\Fendy\Documents\libraries\HX711-master C:\Users\Fendy\AppData\Local\Temp\build3369712106291255820.tmp\HX711Serial.cpp -o C:\Users\Fendy\AppData\Local\Temp\build3369712106291255820.tmp\HX711Serial.cpp.o

In file included from HX711Serial.ino:1:

C:\Users\Fendy\Documents\libraries\HX711-master/HX711.h:16: error: ISO C++ forbids initialization of member 'OFFSET'

C:\Users\Fendy\Documents\libraries\HX711-master/HX711.h:16: error: making 'OFFSET' static

C:\Users\Fendy\Documents\libraries\HX711-master/HX711.h:16: error: ISO C++ forbids in-class initialization of non-const static member 'OFFSET'

C:\Users\Fendy\Documents\libraries\HX711-master/HX711.h:17: error: ISO C++ forbids initialization of member 'SCALE'

C:\Users\Fendy\Documents\libraries\HX711-master/HX711.h:17: error: making 'SCALE' static

C:\Users\Fendy\Documents\libraries\HX711-master/HX711.h:17: error: ISO C++ forbids in-class initialization of non-const static member 'SCALE'