Magnetic perturbations directly driven by pellets were studied in three different plasma scenarios in the ASDEX Upgrade tokamak to gain a deeper insight into the triggering process of type-I ELMs. In the type-I ELMy H-mode, promptly after the ELM, a mode with toroidal mode number n = −6 (the negative sign denoting the ion drift direction) was detected in the 100–150 kHz frequency range, for both spontaneous and triggered ELMs. For triggered ELMs with pellets ablating longer than the ELM crash, this mode was observed for a longer time—therefore this could be identified as the pellet-driven perturbation. However, pellets promptly trigger ELMs after entering the plasma, and the large-amplitude ELM footprint masks the pellet-driven perturbation at the instance of the trigger event, i.e. the pellet-driven mode can only be studied after the ELM in a type-I ELMy H-mode. In L-mode plasmas the pellet was observed to drive broadband Alfvén waves, detected in the 80–300 kHz frequency range with a toroidal mode number of n = −6, similar to the mode after type-I ELMs, confirming that the mode seen in the H-mode after ELMs is indeed the pellet-driven perturbation. The magnitude of the pellet-driven perturbation was observed to increase monotonically with pellet penetration, and showed an exponential decay after pellet burn-out. Similarities and differences are discussed for the type-III ELMy H-mode scenario, which resulted in the finding that the pellet only drives and/or triggers modes which can be naturally present in the target plasma. Concerning type-I ELM triggering, the pellet-driven magnetic perturbation is unlikely to be the trigger for ELMs, since the structure of the pellet-driven modes is completely different from that of the observed pre-ELM modes (coherent modes with toroidal mode number n = 3 and 4, similar to Washboard modes) or type-I ELMs themselves (also n = 3 and 4).