Problem: After running a test that creates static electricity, the values acquired by a hall-effect sensor are not correct anymore.
Context: The device I am working on draws and rolls up fishing wire/rope. I monitor the number of rotation it needs to rolls the wire up with (30) magnets all around the spool and an hall-effect sensor on its side measuring the number of magnet according to the direction of the rotation.
My set-up includes three parts: a main PCB, a smaller PCB with the hall-effect sensor and a zif cable that connects both PCBs. These PCB were designed by a EE firm and produced by a reliable mass-production facility. The issue is observed over different main and sensor PCBs.
On the firmware side: the main PCB reads the sensor values using interrupts running on the iRAM, with the MCU running at 240MHz. According to the direction signal it adds or subtracts to a volatile int every-time it senses a magnet. Then at the beginning of my state machine (every 50 ms) I LOG the values on the terminal and saves them every 2 seconds in the File System.
The monitoring works perfectly when no wire is on the spool, whatever the speed of the rotation or the stress on the test set-up.
When introducing the fishing wire, a discrepancy of one third of a rotation appears after 20 rotations; in other words, instead of having the correct result of 20 rotations, it measures down to 19.66 or up to 20.33 rotations.
The Weird part:
1) After observing the discrepancy, if the wire is removed from the test set-up and the test done again the discrepancy can still be observed.
2) The discrepancy is still observed after changing the zif cable or the sensor PCB.
3) Plugging out the electronics does not make the discrepancy disappear
4) The only solution to fix the discrepancy is to flash the firmware again.
5) Without wire, the results of the test are always correct.
Hypothesis: The only reason I can think of after a week of tests is that the wire can somehow change the voltage reference somewhere on the PCB that makes some signal incorrect.
Disclaimer: I have tried to sum-up a test that took 2 full weeks of my time, I might have forgotten some details. I will try to update this post with every new findings.
Question: Can the voltage reference on the PCB be changed by wire rolling up next to a sensor?