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.