-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tare the HX711 with Fish Gripper #228
Comments
i think you should use set_scale in setup only and then tare() before measurement, if possible. |
Hi @bogde ! I have tried using just tare before measurement but it throws off the value displayed on the screen terribly. I'll post my code and a video later evening. |
@bogde Here is a link to a video showing what is happening when I tare... Below is the line of code that is executed when the Tare button is pressed in the iPhone app: class TareCallback: public BLECharacteristicCallbacks { I have tried several functions (set_scale and set_offset now commented out) based on reading a few posts.... This is the section of code that runs once the scale is connected to the app over BLE...I recently added the power up/down to try to stabilize the HX711: if (deviceConnected) { |
first of all, nice project, congrats! i recently worked on a BLE firmware plus mobile app myself, i really enjoyed the whole thing. i would do: one other thing would be to try to tare on a push of a physical button on the device, or via a command on the serial port, and see if that works then go from there. |
Yeah I really enjoy working with BLE. But this is my first project managing multiple peripherals. I will refactor the Central Manager code once I get the tare function working. The deviceConnect code is in the Arduino loop so it runs continuously. Putting a tare there would not work. I do have these statements in the setup code though... scale.set_scale(CALIBRATION_FACTOR); // 852 this value is obtained by calibrating the scale with known weights; see the README for details The calibration factor is set in a define statement: #define CALIBRATION_FACTOR 19300.0 Pressing the Tare button in the app writes a "1" to the Tare characteristic....The write itself is what triggers the callback in the Arduino code to run the TareCallback I added set_scale to the TareCallback. Same results though. Below is the log output....after tare the scale jumped to 1.6 with out any weight on the scale Cull Master Scale |
Call your tare function in an interrupt that fires when the button is pressed. |
Hmmm....when I call the tare function in a ISR it reboots the esp....see logs below I have ordered a HX711 from Sparkfun as well. I dont like the drifting so I am hoping better hardware will improve things. Also as a backup plan I can restart the esp to accomplish a tare. This will be fine at this point in the project. I have already started V2 of the hardware PCB. Cull Master Scale rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) |
for some reason i thought the anyway, one other thing i would try in order to debug would be to somehow output the result of |
Looks like the scale I set in setup is still holding... Waiting a client connection to notify... |
This is interesting....the tare offset is WAY off after a tare. I am gonna try to capture the offset in a variable then reset it after a tare...fingers crossed! Initializing the scale |
Well that helped...I am not getting crazy weights anymore. Here is my code within the characteristic call incase someone else needs it. Now I just need to figure out how to get the reading to 0.00 after a fish gripper is attached to the scale hook
|
quick question: you were calling tare() after set_scale(...) in your setup, right? |
I am. |
There is an issue with a tare method. It has to have set_offset(0) inside, before the tare process. 226 |
I have built a scale to weigh fish using the HX711. I have the scale calibrated and it is showing the proper weight in testing. However due to drifting I need to tare the scale back to zero before weighing a fish. Is there a recommendation on how to do that? I have tried the calling set_scale and then tare but that throws everything off by several lbs.....thanks in advance for any help!
The text was updated successfully, but these errors were encountered: