How can I copy a 4 digit display as a string in Arduino 2560

I there,
Happy dad trying to help his daughter out in a school project. We have a project to take a hx711 scale and copy the weights to the Arduino so when the weight gets too low, it will dish out some kibble with a servo attached to some food dispenser. The scale actually comes with a display unit that shows how many grams is on the scale, has a Zero out function and 2 more buttons to adjust the sensitivity.
Because this display already has all the functions to give precise weight, I though that we could just take the display output on the board and mirror it to the arduino somehow using a pin read.
So basically connect a wire to the display and connect it to one of the pins (like pin 2) and the arduino would be able to get the data from the display and we could use that as the weight in the program.
For the life of me, I can't find a way to read the display. I loo
ked at topics like "how to read a digital scale" and such but it didn't help.
Can anyone guide me on this? I don't need the code but just hints on how I can get the signal that goes from the display over to the arduino.
Thank you very much and I am looking forward to the discussion.
Jacques.

As a follow up, we did try the digital scale calibration technique and removed the display from the equation. This was a bit too iffy because if the scale decalibrated we'd need to restart the process. At least by reading the display, it can be easily remedied.
Thank you again.

A link to the scale would help

What does drive the display? The arduino or is that à all in one thingy?

1. There are four wires at the right side of the small fancy display board -- are they coming from the Load Cell (the weight measuring sensor)?

2. If so, then mark the wires as:
E+ (positive side of the supply voltage to the Load Cell)
E- (negative side of the supply voltage of the Load Cell)
S+ (positive side of the signal wire of the Load cell)
S- (negative side of the signal wire of the Load Cell).

3. What is next? That will come if Step-1, 2 are passed.

As you can easily tell by the labels on the PCB ("VCC", "SCK/TX", "DT/RX" and "GND"), the four wires are some form of serial 2-wire bus, plus ground and supply voltage.

Even if those wires did come directly from the load cell and did correspond to the four you have listed (they clearly don't), just guessing their order as you have done has a 1:24 chance of being correct.

They are labeled "VCC", "SCK/TX", "DT/RX", and "GND" on the board so I would not expect them to go directly to a bare load cell.

Hi,
Thank you for the reply. That part is what we are trying to avoid because it is raw data coming from the scale. We can connect the 2 middle pins to pin 2 and 3 on the Arduino using the Bogde Github but the calibration gets too complicated and may drift after it's been programmed.
So that's why we thought if we could just read the display by connecting the pins of the display and having the data get streamed over to the arduino that would be better.

If it is possible to read data from the display (it is on some, and isn't on some others), you'd have to look into the datasheet to know. See if you can find a part number on the rear of this PCB. If you can't, you might just be out of luck. In that case - better replace it with a load cell and display for which you CAN find datasheets.

Of course, you could use an Arduino or Raspberry Pi with a camera module and then do some text recognition, but honestly that approach is so stupid I feel embarrassed for even suggesting it.

+1.

Hi,
It's both a scale, has the interface and it connects to the display. The interface could connect to the Arduino but we'd like to keep the display. So mirroring the display to the Arduino would be our favorite path.

Hi,
It's a generic scale with HX711 and an unknown display that shows the weight in grams. I'm sorry I can't be any more specific.

If those wires are coming directly from the Load Cell without any intermediate electronic buffering, then the OP could be guided to build his own display system using HX711 Module and UNO/MEGA/NANO.

You've been told twice, by two different people, that those wires could not possibly come directly from the Load Cell, and OP has posted photographic evidence that they don't.

Incidentally, you can find the HX711's protocol in its datasheet: https://cdn.sparkfun.com/datasheets/Sensors/ForceFlex/hx711_english.pdf

You could put an Arduino between the green and blue PCBs, have it read the data from the sensor and pass it on to the display.

But I suspect the IC on the backside of the display PCB does all the calibration stuff, so this way the Arduino wouldn't exactly see the same data that is displayed on the display.

(I accidentally messed up and then deleted a previous version of this post - thanks, forum software.)

1 Like

Hi again,
Thank you for all the help. Looks like reading the display will be a no-go so we're going to do the calibration and read from the LoadCell directly.
I really appreciate the fast replies from everyone. The project will get done!
Jacques.

It's possible that the wires to the LED module could be picked off, catching which segments are on when the particular digit is enabled, back-figuring that way (not for the n00bs).

1 Like

Hey,
I hoped it would have been an easy fix like connect wire A and wire B to these leads of the display then connect it to the Arduino to Pin x and Pin y and filter the stream. I never expected that there could be protocol and formats involved. Me n00b .

The display seems to be THT so it might be possible to just solder some wires to the PCB's rear. You'd still have to figure out the exact pin-out for it, of course... not something I'd like to do, but someone with more patience than me could probably do it.

(I like the idea!)

FYI: Google Translate says the display board is labeled "Pressure Sensor Test Board" with the three buttons labeled "Tare", "Correction Plus" and "Correction Minus".

The HX711 doesn't have an async serial interface so you can ignore the RX/TX labels.

You can easily add calibration buttons to your Arduino-based scale if you're worried that the calibration will drift.

image
Figure-1:

So --
1. That fancy board (Fig-1 above) is generating SCK (Serial Clock Pulses) pulses for the ADC of the HX711 Module and reading the 24-bit weight signals over the DT (Data) line.

2. I propose the following schematic (Fig-2) for time sharing operation of the Fancy Board and UNO Board; where, both boards will be acquiring signals and show the weight on their respective display units over certain time slice:


HX711Parallel

Figure-2:

3. Driving/processing routine

/* This program takes 10 samples from LC + HX711B at
   1-sec interval and then computes the average.
*/

unsigned long x = 0, y = 0;
unsigned long dataArray[10];
int j = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(A1, INPUT); //data line  //Yellow cable in my Setup
  pinMode(A0, OUTPUT);  //SCK line  //Orange cable in my Set up
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
}

void loop()
{
  digitalWrite(2, HIGH);  //Fancy Board is disconnected from HC&11
  digitalWrite(3, LOW); //UNO Board is connected with HX711 for 10-sec

  for (int j = 0; j < 10; j++)
  {
    digitalWrite(A0, LOW);//SCK is made LL
    while (digitalRead(A1) != LOW) //wait until Data Line goes LOW
      ;
    {
      for (int i = 0; i < 24; i++)  //read 24-bit data from HX711
      {
        clk();      //generate CLK pulse to get MSB-it at A1-pin
        bitWrite(x, 0, digitalRead(A1));
        x = x << 1;
      }
      clk();  //25th pulse
      Serial.println(x, HEX);
      y = x;
      x = 0;
      delay(1000);
    }
    dataArray[j] = y;
  }

  Serial.println("===averaging process=========");
  unsigned long C1 = 0;   //C1 = Count-1 against no fuel in the Tank

  for (j = 0; j < 10; j++)
  {
    C1 += dataArray[j];
  }
  Serial.print("Average Count = ");
  C1 = C1 / 10;
  Serial.println(C1, HEX);
  //--------------------------
  digitalWrite(2, LOW);  //Fancy Board is connected with HX711
  digitalWrite(3, HIGH); //UNO Board is disconnected from HX711
  delay(10000);
}

void clk()
{
  digitalWrite(A0, HIGH);
  delayMicroseconds(50);
  digitalWrite(A0, LOW);
}

4. Wiring Check
(1) Remove connection from DPin-2, 3 of UNO Board.
(2) Connect GND at Pin-19 of 74LS244.
(3) Connect 5V at Pin-1 of 74LS244.
(4) The Fancy Board should be working showing the weight of the load.
(5) Remove connections from Pin-1, 19 of 74LS244.
(6) Put back the wires on DPin-2, 3 of UNO Board.