I am running 3 cables cables from a solar heater down to my apartment (around 12 meters), one to power an electric heater and water pump (around 2000 watts in total), one to control a 12V solenoid and a temperature sensor. These 3 wires are wrapped around all the way down. The problem is I get massive fluctuations in my temperature reading +-5 degrees when I turn on the heater. Are these fluctuations due to EMI between from the power cable to the sensor cable? If yes, is it possible to calculate the distance to separate the wires in order to avoid any EMI?
So you have a 2,000 watt load to a resistive-heater and a motor that has a spark-generating slip-ring. Lets model this as 10 amps and 200 volts, our trash generator.
We'll just consider the HFI, the magnetic field coupling. (The other answer provides electric field coupling.)
For worse case, assume 4 meters of wire in the temperature sensor, with 4 millimeter of spacing between the SenseWire and the ReturnWire.
We'll model this magnetic coupling as a SINGLE transmitter wire (we place the RETURN wire at infinity and get no flux cancellation, thus a worst-case trash generator), and a loop 4meters by 4 milliMeters which is the Receiver). Math?
Vinduce = [MU0*MUr * LoopArea / (2*pi*Distance)] * dI/dT
dI/dT (with NO motor sparks) is 10amps * 377 = 3,770 amps/second
Now let MU0 be 4*pi*1e-7 Henry /meter, let MUr be 1 (air, copper) and the Vinduce becomes
Vinduce = [2e-7 * Area/Distance] * di/dT
Vinduce = 2e-7 *(4meter * 4mm)/4mm * 3,770
Note we assumed the distance between Transmitter and Receiver, inside your "3 wires twisted together", is also 4mm.
Vinduce = 2e-7 * 4 * ~~ 4,000 = 2*4*4 * 1e-7 * 1e+3
Vinduce = 32 e-4 = 3.2 milliVolts
Note motor sparks will be 100X or 1,000X faster, raising the trash coupling 100X or 1,000X.
How about Efield coupling? The Efield requires us to use Ohms Law: displacement current * Z_node.
If the displacement current is 10uAmp, and the Z_node is 100 Kohm, then the V_node is just 10uA * 100 Kohm = 1 volt of voltage at the node.
How do we compute I_displacement? Using Q = C * V, and differentiate with respect to time, we get
dQ/dT = dC/dT * V + C * dV/dT
Holding C constant, that becomes dQ/dT = C * dV/dT = I_displacement
Thus we need TWO variables to compute I_displacement:
1) The wire-wire capacitance (the exact math needs some hyperbolic sine formula, which I'll provide later)
2) the SlewRate of the interfering voltage
Seems like a lot of bother? Hang in there. This lets you compute COMPUTE the SNR, the signal-noise-ratio of your circuit, or the ENOB the Effective Number of Bits. Thus your measurement accuracy becomes predictable. Willing to work thus a little more math, to be able to predict your ADC's usefulness? I thought so.
For the Capacitance, for a (useful) first approximation, just use the math for Parallel_Plate capacitance. Given many wires or traces in typical circuits, using a WIRE_WIRE model is not useful. So use Parallel_Plate.
C_parallel_Plate = E0 *Er * Area / Distance
If you have 5 volts of MCU clock, with edge rate of 5 volts in 5 nanoSeconds, located 1mm away from an analog signal that is 5cm long and 1mm wide, what will be the Electric-Field injected trash voltage? Assume the analog signal has 10pF total capacitance (opamp Cout, Opamp Cin, and trace parasitic to Ground), and 100 Ohm Rout of the drive-the-trace opamp. (at high frequencies, such as MCU clock edges, Opamps will have high Rout).
What is the coupling capacitance from MCU trace to analog trace. Again assume parallel_plate capacitance, to get a rough idea.
C = 9e-12 Farad/meter * (Er = 1 air, FR-4) * 5cm * 1mm / 1mm
C = 9e-12 Farad/meter * 0.05 meter = 0.45e-12 = 0.5pF
This is plenty accurate, given our assumptions about mechanical topology.
I_displacement = C * dV/dT = 0.5pF * 1 volt/nanosecond
I = 0.5milli * nanoFarad * 1volt/nanosecond and the 'nanos' cancel
I= 0.5 milliamp
Remember we assumed 100 Ohm Rout; ohms law produces 50 milliVolts. For low frequencies.
We have a 5 nanosecond event. At high frequencies, we have a capacitive voltage divider: 5 volts * 0.5pF /10pF = 5v/20 = 0.25 volts
Thus we predict either 0.05 volts for low frequencies, or 0.25 volts for high frequencies. And the MCU clock edge is high freq.
Thus we predict 0.25 volts.
Surprise ----- you should not place a micro-controller clock (or dataline) very very close to an analog signal.
Your question is about the Temperature Sensor. To compute the Efield upset to the Sensor voltage, we need the Sensor Zout. And we need the dV/dT of the interfering trash.
Notice the Efield coupling gets performed at two frequencies; once you have some confidence with Efields and with the vulnerable nodes of your circuitry, you may choose to use only Low Frequency or only High Frequency coupling math; to do this, you need to model the coupling as a High Pass Filter and be certain your break frequency (the F3dB frequency) is above or below your coupling-frequency.
What is the coupling frequency of 10MHz MCU clock that has 1 nanoSecond edges? I'd use twice the edge-period, or 2 nanoSeconds, that becomes 500MHz.