Skip to content

Mitigate interference

Giovanni Blu Mitolo edited this page Apr 8, 2018 · 18 revisions

PJON Interference wiki

In some situations, interference can affect the communication medium; understanding its source and how to mitigate its effects is a key element to master understanding in electronics and digital communication.

Interference presence can be detected using the NetworkAnalysis example and its results. If the bus is detected many times as BUSY, the pin is "floating" from a logic state to the other one. This often happens because the bus, and the devices connected to it are acting as an antenna picking up impulses, often reaching the HIGH logical state also if the bus is not in use. AC wiring could induce the 50Hz wave in a SoftwareBitBang bus if close enough (see video demonstration). A pull-down resistor is commonly used to discharge the unwanted induced interference.

I/O PIN ------------------- BUS
                      |
GND -------[/\/]------/

           resistor 500 KΩ - 10

The correct resistor value to be applied is very variable (500 KΩ - 10 MΩ), depending on the bus topology and the interference strength, but is often near to the mega ohm order. To find the correct resistor value run the NetworkAnalysis example and start testing the resistors in descending order until the number of BUSY results is around 0. If interference and or CRC errors are still present, a strong palliative is the use of ferrite beads. Many devices where digital communication is used are equipped with it (see Sony Playstation wired controller). This is often provoked by AC appliances, powerful electric motors or other devices.

              _______
             |       |
I/O PIN -----|-------|----- BUS
             |_______|

            ferrite bead

Bandwidth loss related to the system's power consumption is the sign of power supply interference. Never feed devices with shared power supply with highly demanding appliances like servos, motors or actuators. If this is not possible at least position a diode connected to VIN, able to block inverse current from the VIN pin back to the wire and use a capacitor to fill temporary feeding shortages.

GND ------
         |    
        === capacitor
         |
VIN ---------[|__]------- POWER SUPPLY FEED

             diode

The above solution can reduce but not eliminate transient voltage spikes. A more decisive way to deal with transient voltage is to use diodes in opposition. This technique reduces the short duration electrical spikes can occur because of power shortages, power transitions in other large equipment on the same power line or lightning strikes.

             diode                       diode

GND ---------[__|]--------------|--------[__|]--- POWER SUPPLY FEED
                                |                
                /-----[/\/]-----/  
                |
                |     resistor
I/O PIN  -------|-------------------------------- BUS                         

A serious step toward reliability is to use a well insulated wire (mil standard for radio communication / avionics surplus), but this can only be applied for home-made / non-serial production; a more standard approach is the use of a simple coaxial cable in one of its forms, from earbuds wire to super-expensive gold-plated coaxial. Thanks to the "sock" ground shielding the use of this sort of cable highly reduces interference and is also really handy, connecting also the ground with only one wire.

 _______                                   _______
|       | I/O PIN                 I/O PIN |       |
|       |\                               /|       |
| ID 1  | > ====== COAXIAL CABLE ====== < | ID 2  |
|       |/                               \|       |
|_______| GND                         GND |_______|