Need to pay attention to EMI, EMC, SI, PI and other factors in PCB design. PCB circuit board design should fully consider and meet the requirements of anti-interference. There are three basic elements of interference:
(1) Interference source refers to the component, equipment or signal that produces interference. It is described in mathematical language as follows: du/dt, the place where di/dt is large is the interference source. For example, lightning, relays, thyristors, motors, high-frequency clocks, etc. may all become interference sources.
(2) Propagation path refers to the path or medium through which interference propagates from the interference source to the sensitive device. The typical interference propagation path is conduction through wires and radiation from space.
(3) Sensitive devices refer to objects that are easily disturbed. Such as: A/D, D/A converter, single chip microcomputer, digital IC, weak signal amplifier, etc.
The basic principle of anti-interference design is: suppress the interference source, cut off the interference propagation path, and improve the anti-interference performance of sensitive devices. (Similar to the prevention of infectious diseases)
1 Suppress the interference source-to suppress the interference source is to reduce the du/dt, di/dt of the interference source as much as possible. This is the most prioritized and most important principle in anti-jamming design, and it often has the effect of getting twice the result with half the effort. Reducing the du/dt of the interference source is mainly achieved by connecting capacitors in parallel at both ends of the interference source. Reducing the di/dt of the interference source is achieved by connecting inductance or resistance in series with the interference source loop and adding a freewheeling diode. Common measures to suppress interference sources are as follows:
(1) The relay coil adds a freewheeling diode to eliminate the interference of back electromotive force generated when the coil is disconnected. Only adding a freewheeling diode will delay the off time of the relay. After adding a Zener diode, the relay can operate more times per unit time.
(2) Connect a spark suppression circuit in parallel at both ends of the relay contact (usually an RC series circuit, the resistance is generally selected from a few K to tens of K, and the capacitance is 0.01uF) to reduce the impact of electric sparks.
(3) Add a filter circuit to the motor, and note that the capacitor and inductance leads should be as short as possible.
(4) Each IC on the circuit board should be connected with a 0.01μF~0.1μF high frequency capacitor in parallel to reduce the impact of IC on the power supply. Note that the wiring of high-frequency capacitors should be close to the power supply terminal and as short as possible. Otherwise, the equivalent series resistance of the capacitor will be increased and the filtering effect will be affected.
(5) Avoid 90-degree fold lines when wiring to reduce high-frequency noise emission.
(6) Both ends of the thyristor are connected in parallel with an RC suppression circuit to reduce the noise generated by the thyristor (this noise may break down the thyristor). According to the propagation path of interference, it can be divided into two types: conducted interference and radiated interference. The so-called conducted interference refers to the interference that propagates to sensitive devices through wires. The frequency bands of high-frequency interference noise and useful signals are different. You can cut off the propagation of high-frequency interference noise by adding a filter on the wire, and sometimes you can add an isolation optocoupler to solve it. Power noise is the most harmful, so pay special attention to handling. The so-called radiated interference refers to the interference that propagates to sensitive devices through space radiation. The general solution is to increase the distance between the interference source and the sensitive device, isolate them with a ground wire and add a shield on the sensitive device.
2 Common measures to cut off the interference propagation path are as follows:
(1) Fully consider the impact of the power supply on the microcontroller. If the power supply is done well, the anti-interference of the whole circuit will be solved more than half. Many single-chip computers are very sensitive to power supply noise, so it is necessary to add a filter circuit or voltage regulator to the power supply of the single-chip microcomputer to reduce the interference of power supply noise to the single-chip microcomputer. For example, magnetic beads and capacitors can be used to form a π-shaped filter circuit. Of course, 100Ω resistors can be used instead of magnetic beads when the conditions are not high.
(2) If the I/O port of the single-chip microcomputer is used to control noise devices such as motors, isolation should be added between the I/O port and the noise source (add a π-shaped filter circuit). To control noise devices such as motors, isolation should be added between the I/O port and the noise source (add a π-shaped filter circuit).
(3) Pay attention to the crystal oscillator wiring. The crystal oscillator is as close to the pins of the microcontroller as possible, the clock area is isolated with a ground wire, and the crystal oscillator shell is grounded and fixed. This measure can solve many difficult problems.
(4) Reasonable division of the circuit board, such as strong and weak signals, digital and analog signals. Keep interference sources (such as motors, relays) away from sensitive components (such as microcontrollers) as much as possible.
(5) Separate the digital area from the analog area with a ground wire, separate the digital ground from the analog ground, and finally connect it to the power ground at one point. The wiring of A/D and D/A chips is also based on this principle, and manufacturers have considered this requirement when assigning A/D and D/A chip pin arrangements.
(6) The ground wires of the single-chip microcomputer and high-power devices should be grounded separately to reduce mutual interference. Place high-power devices on the edge of the circuit board as much as possible.
(7) The use of anti-interference components such as magnetic beads, magnetic rings, power filters, and shields in key places such as the MCU I/O port, power cord, and circuit board connection line can significantly improve the anti-interference performance of the circuit.
3 Improving the anti-interference performance of sensitive devices Improving the anti-interference performance of sensitive devices refers to the method of minimizing the pickup of interference noise from the sensitive device side and recovering from abnormal conditions as soon as possible. Common measures to improve the anti-interference performance of sensitive devices are as follows:
(1) Minimize the loop loop area when wiring to reduce induced noise.
(2) When wiring, the power wire and ground wire should be as thick as possible. In addition to reducing the voltage drop, it is more important to reduce the coupling noise.
(3) For the idle I/O ports of the single-chip microcomputer, do not float, but should be grounded or connected to the power supply. The idle terminals of other ICs are grounded or connected to power without changing the system logic.
(4) The use of power supply monitoring and watchdog circuits for single-chip microcomputers, such as IMP809, IMP706, IMP813, X25043, X25045, etc., can greatly improve the anti-interference performance of the entire circuit.
(5) On the premise that the speed can meet the requirements, try to reduce the crystal oscillator of the single-chip microcomputer and select low-speed digital circuits.
(6) IC devices should be soldered directly on the circuit board as much as possible, and IC sockets should be used less.
1. Get used to clearing all unused code spaces to "0", because this is equivalent to NOP, which can be returned when the program runs away;
2. Add a few NOPs before the jump instruction, the purpose is the same as 1. 3. When there is no hardware WatchDog, software can be used to simulate WatchDog to monitor the operation of the program;
4. When dealing with the adjustment or setting of external device parameters, in order to prevent the external device from making errors due to interference, the parameters can be re-sent regularly, so that the external device can be restored to the correct position as soon as possible;
5. Anti-interference in communication, data check digit can be added, and 3 out of 2 or 5 out of 3 strategies can be adopted; 6. When there is a communication line, such as I^2C, three-wire system, etc., in practice, we found that the Data line, CLK line, INH line is set to high normally, its anti-interference effect is better than setting it to low.
Hardware aspect:
1. The ground wire and power wire must be important!
2. Decoupling of the line;
3. Separation of digital and model ground;
4. Each digital component needs 104 capacitors between the ground and the power supply;
5. In applications with relays, especially at high currents, to prevent the interference of relay contacts from sparking on the circuit, a 104 and a diode can be combined between the relay coils, and 472 capacitors can be indirect between the contacts and the normally open end. The effect is good!
6. In order to prevent the crosstalk of the I/O ports, the I/O ports can be isolated by diode isolation, gate circuit isolation, opto-couple isolation, electromagnetic isolation, etc.;
7. Of course, the anti-interference of the multi-layer board is definitely better than that of the single-sided board, but the cost is several times higher.