I'm working on a small project at my farm to automate vegetable weighting. The system consists of an STM32 MCU, some additional ICs (matrix decoder, parallel-serial converter for some push-buttons etc.), an LCD screen (HD44780 compatible) and finally, an HX711 ADC to interface a load cell. Everything is supplied by a single 12V PSU (switch mode), followed by a 3.3V and 5V regulator module (switch mode). The system was designed on two PCBs. Everything would be installed in a custom-designed, quite large sheet metal housing.
I'd be really glad to have your opinion about two things:
The first question is about noise. When I'm using the system on a test bench, the readings of the HX711 are rock stable. The final measurements are converted using a basic linear regression to get a calibrated values in decagrams. I'm using a 5 measurement long buffer for averaging (when successive measurements do not exceed a threshold value), but even without that I get stable values.
But when I assemble the system in the housing (same PSU, cables, and other components), the variance increases a lot, which means jumps of roughly 5 decagrams. I tried to introduce some noise when using the system on the bench to reproduce the issue (WiFi enabled mobile, high voltage lines etc.) but nothing seems to disturb the measurements there, only when it's outside in the metal housing.
Has anyone already faced a similar problem? What can be the issue?
The only visible difference is that on the bench, the load cell is fixed to a plank, but when I assemble the system, it has direct contact with (screwed on) the metal housing. No other electronics is touching the housing, just the body of the load cell (I couldn't find any connection between the body the cell and the wires of it with a multimeter).
Is it possible that the housing introduces the noise to the load cell or to the ADC? I'll try to do a test measurement with the load cell "floating" on its wire or with another load cell, just to see if it has any effect, but I can visit only next week, so I thought of asking this in order to get some additional ideas.
I'm just a hobbyist, and since I mentioned the housing as a possible cause of the noise, I have a question that most likely to be a basic one. Like I mentioned, all electrical components are separated from the housing, only the load cell and the push-buttons are touching it. Since there are some push-buttons, the PCB is (theoretically) protected by a debouncer IC, which has ESD protection.
But should the housing itself be connected anywhere (eg.: earth) considering the safety of the user, furthermore the safety and proper function of the system?
Thank you very much for your help in advance!