0
\$\begingroup\$

I am in the process of designing a weight scale.

To test whether I could achieve the same results in the software I decided to disconnect the MISO, MOSI, SCK and CS from a commercial weight scale MCU and run some wires to an Arduino to read the ADC count. I have successfully managed to read the count from the onboard CS5530, but the count is very unstable (+/- 30 counts, on zero values range from 24130 to 24160 and at 1kg span 123470 to 123500.) The scale itself with the same setup barely fluctuates on the last digit.

On the scale itself, the count updates instantly and I am only able to achieve poor results at 6.25SPS.

If it can help the Arduino 5V and GND are connected to the digital side of the PCB and all cables are short and soldered and the indicator has good performance and has been tested and capable to achieve 30000div with great stability and no drift.

My questions are:

  • Am I not aware of software techniques to achieve fast software filtering? I have tried moving average, exponential moving average, median, Kalman, digital LPF and even a combination of all together. The count becomes stable, but it takes seconds for the count to ramp up and stabilise. Changing the sampling rate it does not make it any faster. I have tried to sample at 3200SPS but the update time of the filter remains unchanged. I assume this is due to the limitations of the Arduino processor.
  • Is it possible to achieve the same results as on the indicator by tapping into the lines like I did or will it not work because I am introducing noise or something?
  • Could the code library used be inaccurate and therefore not reading the data from the CS5530 properly?

I do understand that without seeing what I am actually doing it is not easy to answer but I am seeking some guidance from someone that has possibly experienced something similar. I have been working on a proper PCB with a very similar design and I would like to be sure that I am able to design a software that is capable of maintaining a stable count.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ You should include images of your setup, schematics or diagrams, links to datasheets, possibly a portion of the code if necessary. You are asking us to imagine what could possibly be the problem without having a clue what your setup looks like. We don't even know the resolution and accuracy of your scale's display. \$\endgroup\$ Commented Sep 2, 2023 at 5:01
  • 3
    \$\begingroup\$ Do be aware that it's very common for manufacturers who use 24 bit ADCs for weigh scales to 'cheat' a bit by using non-linear filters to suppress the noise in the LSBs. If you run two filters, one with a long response, the other short, and compare them, with the appropriate logic and a median filter, you can get a rock-solid display that yet responds quickly to actual changes of load. You may need to up your game with your filtering foo. You might also be introducing interference with your connection, who knows? \$\endgroup\$
    – Neil_UK
    Commented Sep 2, 2023 at 6:55
  • 2
    \$\begingroup\$ How many ADC counts does the "last digit" on the display correspond to? \$\endgroup\$ Commented Sep 2, 2023 at 10:15
  • 2
    \$\begingroup\$ The variation you are seeing amounts to about 0.3 grams while measuring 1kg. Does your scale show fractions of a gram? \$\endgroup\$
    – JRE
    Commented Sep 2, 2023 at 10:39
  • 1
    \$\begingroup\$ Is that 30-count variation periodic? For example 50 Hz, 60 Hz periodic variations of samples can be filtered by simply collecting samples for one (or two, or three...) period(s). It is possible that adding your hardware has introduced this kink of variation. \$\endgroup\$
    – glen_geek
    Commented Sep 2, 2023 at 12:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.