Grounding & EMI

Most "the sensor reads noise when the motor runs" problems are grounding and layout problems, not sensor problems. A few rules prevent nearly all of them.

Current returns through the ground — that is the whole issue

Ground is not a magic zero-volt reference; it is a conductor with resistance and inductance. When a motor dumps amps through a shared ground trace, that trace develops a voltage — and your sensor's "ground" is now several millivolts (or volts) away from the ADC's. That difference lands directly on your reading. This is a ground loop.

Star grounding and separate returns

Give noisy loads (motors, solenoids, heaters) their own return path back to the supply, and join everything at one star point — usually at the supply's ground terminal. Never let the motor return current share a trace with analogue signal ground. On a PCB, an unbroken ground plane does this automatically: return current follows the path of least inductance, right under its own signal trace.

Shielding: ground one end only

A cable shield intercepts electric fields and needs a path to ground — but grounded at both ends it becomes a ground loop and carries current, making things worse. For signal cables, ground the shield at one end only, normally the receiver/controller end. For magnetic pickup, shields help little; use a twisted pair so the signal and its return enclose almost no loop area.

Layout habits that just work

Route power and signal cables apart; cross them at 90° if they must meet. Keep loop areas small. Put a decoupling capacitor right at every IC power pin. Add a flyback diode across every relay and solenoid coil — switching an inductor generates a large voltage spike that will reset or destroy nearby electronics. Filter analogue inputs close to the ADC.

Educational overview — verify against the governing standard. Not a substitute for engineering judgment.