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
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.
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:
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
But it is the same problem in my initial code (see below).
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 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?
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..
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..
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
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.
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!