Metal generator junction boxes and mounting systems, as well as module frames, need to be grounded for safety reasons, except in cases where the insulation for active installation components meets protection class II requirements or if the PV system’s open-circuit voltage VOCA is lower than 120 V and the system is not connected to the low-voltage grid. For grid-connected installations with transformerless inverters, framed modules should always be grounded owing to the capacity between the inside of the module and the metal frame. Grounding is advantageous in terms of electrical safety (protection against hazardous touch voltage) and also enhances lightning protection by diverting any lightning current that may occur. However, this only holds true if an equalization bonding conductor is installed parallel to the array cable or the main DC cable. Optimal lightning protection in such cases is obtained using shielded cables . Surge diverters in a small junction box only have the desired effect if they are grounded via the shortest possible path and if they exhibit the shortest possible equalization bonding conductor length to the solar generator’s metal racking and module frames.
Ref: PV system design and practice