Analog Ground (AGND) is the reference plane used for the analog portion of a circuit. This includes the acquisition circuits of analog sensors (ADC), operational amplifier (Op-Amp) circuits, and precision references.
In these analog circuits, signals are continuous and often very weak (millivolts or microvolts). They are highly susceptible to noise and voltage fluctuations caused by high currents in other parts of the system. If AGND is not isolated or routed correctly, large return currents from digital or power stages can cause voltage drops across the ground trace (Common Impedance Coupling), distorting the analog signal and potentially causing system failure.
Digital Ground (DGND) is distinct from AGND and is used for digital logic circuits, such as microcontrollers (MCUs), button detection, USB interfaces, and FPGA logic.
The reason for a separate DGND lies in the nature of digital signals. Digital circuits rely on discrete logic levels ("0" and "1").

During the transition between logic "0" (Low) and logic "1" (High), a rapid change in current occurs (high di/dt). According to Maxwell’s electromagnetic theory and the inductance formula (V = L * di/dt), this rapid current change generates a magnetic field and voltage spikes (noise) across the parasitic inductance of the PCB traces. This phenomenon is often called Ground Bounce or switching noise.
To prevent this high-frequency digital noise from coupling into sensitive analog circuits, a separate Digital Ground (DGND) is used to contain these return currents.
While AGND and DGND are typically for low-power signals, high-power circuits require a separate reference known as Power Ground (PGND). This is common in motor drivers, solenoid valve actuators, and DC-DC converters.
High-power circuits carry large currents. PCB copper traces have a small but non-zero resistance. According to Ohm's Law (V = I * R), a large current flowing through a ground trace causes a voltage drop, creating a "ground offset."

If the ground potential shifts, the reference voltage for the rest of the system changes. For example, if a 5V system experiences a 1V ground shift due to high current, the effective voltage seen by the load might drop to 4V (5V - 1V = 4V), or logic levels might be misinterpreted. PGND is usually star-connected to the power source to minimize this effect.
Analog ground (AGND), digital ground (DGND), and power ground (PGND) are essentially subdivisions of the DC return path. Ultimately, these different grounds must connect to a single point to ensure the entire system shares the same 0V reference. This common connection point is often referred to as the Power Supply GND or the "Star Point."
Since all energy originates from the power supply, the negative terminal of the supply serves as the absolute 0V reference. The connection between AGND, DGND, and PGND is often made at a single point (using a 0-ohm resistor, ferrite bead, or net tie) near the power entry to prevent ground loops.
AC Ground (sometimes labeled CGND or Primary GND) is typically found in circuits containing AC mains power, such as AC-to-DC (SMPS) power supplies.
An AC-DC power supply is divided into two isolated sections:
1. The Primary Side (High Voltage/AC).
2. The Secondary Side (Low Voltage/DC).
The "AC Ground" serves as the reference for the high-voltage switching side (often connected to the rectified high-voltage DC minus). This is a "Hot Ground" and is dangerous to touch. The DC Ground is on the isolated secondary side.
To reduce Electromagnetic Interference (EMI) and provide a return path for high-frequency noise, engineers often connect the Primary Ground to the Secondary Ground (or Earth) using a high-voltage safety capacitor (known as a Y-Capacitor). This creates a path for AC noise without compromising DC isolation.
Generally, voltages below 36V (or 50V depending on standards) are considered "Safety Extra Low Voltage" (SELV). Voltages exceeding this threshold pose a shock hazard.
To ensure human safety, high-voltage projects (like household appliances: fans, fridges, TVs) utilize Earth Ground (EGND), also known as Protective Earth (PE). This connects the metal chassis of the device directly to the physical earth via the wall socket.

Why do household sockets have 3 terminals?
Two terminals carry the current (Live/Hot and Neutral). The third terminal is Earth Ground (EGND).
EGND has two main purposes:
1. Safety: If a wire shorts to the metal casing, current flows to the earth, tripping the circuit breaker and preventing electric shock.
2. Shielding: It acts as a shield for EMI, dumping external interference to the earth.
Unlike AGND or DGND, EGND usually does not carry circuit return current during normal operation.
Why differentiate between so many types of GND? Why not simply connect everything to one large copper plane?
While connecting all grounds together (a "Unified Ground Plane") is actually a valid technique in modern high-speed multi-layer PCB design, it requires careful layout planning. In many scenarios, simply connecting mixed-signal grounds randomly causes the following problems:
If high-power PGND and sensitive AGND share the exact same physical trace, the voltage drop caused by the high current will be superimposed onto the sensitive analog signal. This effectively adds noise to the clean signal.
Analog circuits depend on a stable reference voltage. In AC-DC converters, the primary switching ground fluctuates significantly relative to Earth. If this noise couples into the analog reference (AGND), the sensor readings or ADC values will fluctuate, leading to data errors.
Digital switching and power switching generate high-frequency noise. If this noise shares a return path with long analog cables, the cables can act as antennas, radiating this noise (EMI). Separating grounds and connecting them at a single point (or filtering them) helps contain this noise.
Separating grounds improves fault isolation. If a high-power section experiences a surge, a dedicated ground path can help direct that surge away from delicate logic chips (like the MCU), potentially saving the control electronics from destruction.